{"action":"created","issue":{"url":"https://api.github.com/repos/simsong/tcpflow/issues/109","labels_url":"https://api.github.com/repos/simsong/tcpflow/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/simsong/tcpflow/issues/109/comments","events_url":"https://api.github.com/repos/simsong/tcpflow/issues/109/events","html_url":"https://github.com/simsong/tcpflow/issues/109","id":109072914,"number":109,"title":"open_flows.erase called even if file is not opened.","user":{"login":"EaseTheWorld","id":1066923,"avatar_url":"https://avatars.githubusercontent.com/u/1066923?v=3","gravatar_id":"","url":"https://api.github.com/users/EaseTheWorld","html_url":"https://github.com/EaseTheWorld","followers_url":"https://api.github.com/users/EaseTheWorld/followers","following_url":"https://api.github.com/users/EaseTheWorld/following{/other_user}","gists_url":"https://api.github.com/users/EaseTheWorld/gists{/gist_id}","starred_url":"https://api.github.com/users/EaseTheWorld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EaseTheWorld/subscriptions","organizations_url":"https://api.github.com/users/EaseTheWorld/orgs","repos_url":"https://api.github.com/users/EaseTheWorld/repos","events_url":"https://api.github.com/users/EaseTheWorld/events{/privacy}","received_events_url":"https://api.github.com/users/EaseTheWorld/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2015-09-30T12:02:47Z","updated_at":"2015-10-05T07:24:50Z","closed_at":null,"body":"If a flow has nothing to write, its tcp->fd is never set and it is not inserted in demux.open_flows.\r\nbut in tcpip::close_file(), demux.open_flows.erase(this) is called even if fd is not set.\r\nIs it intended?\r\nI'm replacing current 'close_oldest_fd with open_flows unordered_set' code with my code.\r\nand I assumed that when 'open_flows.erase(this)' is called, 'this' is always in the open_flows set.\r\nbut it seems not.\r\n"},"comment":{"url":"https://api.github.com/repos/simsong/tcpflow/issues/comments/145448447","html_url":"https://github.com/simsong/tcpflow/issues/109#issuecomment-145448447","issue_url":"https://api.github.com/repos/simsong/tcpflow/issues/109","id":145448447,"user":{"login":"EaseTheWorld","id":1066923,"avatar_url":"https://avatars.githubusercontent.com/u/1066923?v=3","gravatar_id":"","url":"https://api.github.com/users/EaseTheWorld","html_url":"https://github.com/EaseTheWorld","followers_url":"https://api.github.com/users/EaseTheWorld/followers","following_url":"https://api.github.com/users/EaseTheWorld/following{/other_user}","gists_url":"https://api.github.com/users/EaseTheWorld/gists{/gist_id}","starred_url":"https://api.github.com/users/EaseTheWorld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EaseTheWorld/subscriptions","organizations_url":"https://api.github.com/users/EaseTheWorld/orgs","repos_url":"https://api.github.com/users/EaseTheWorld/repos","events_url":"https://api.github.com/users/EaseTheWorld/events{/privacy}","received_events_url":"https://api.github.com/users/EaseTheWorld/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T07:24:50Z","updated_at":"2015-10-05T07:24:50Z","body":"If so, then open_flows.size() check is necessary to retrisct the max fd.\r\nand open_flows.size() is also used to log max_open_flows.xml\r\nI wanted to get rid of calling std::list.size() but it seems to be necessary in some feature.\r\nI'll try to keep the feature and improve performance as much as possible."}}