{"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":13,"created_at":"2015-09-30T12:02:47Z","updated_at":"2015-10-01T13:58:29Z","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/144733602","html_url":"https://github.com/simsong/tcpflow/issues/109#issuecomment-144733602","issue_url":"https://api.github.com/repos/simsong/tcpflow/issues/109","id":144733602,"user":{"login":"simsong","id":1594284,"avatar_url":"https://avatars.githubusercontent.com/u/1594284?v=3","gravatar_id":"","url":"https://api.github.com/users/simsong","html_url":"https://github.com/simsong","followers_url":"https://api.github.com/users/simsong/followers","following_url":"https://api.github.com/users/simsong/following{/other_user}","gists_url":"https://api.github.com/users/simsong/gists{/gist_id}","starred_url":"https://api.github.com/users/simsong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simsong/subscriptions","organizations_url":"https://api.github.com/users/simsong/orgs","repos_url":"https://api.github.com/users/simsong/repos","events_url":"https://api.github.com/users/simsong/events{/privacy}","received_events_url":"https://api.github.com/users/simsong/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T13:58:29Z","updated_at":"2015-10-01T13:58:29Z","body":"I thought that you could just remove the node, change the value as you want\nit, and then re-add it. Would that not work?\n\nOn Thu, Oct 1, 2015 at 9:55 AM, EaseTheWorld <notifications@github.com>\nwrote:\n\n> I checked priority_queue, but I don't know how to move a node to the\n> end.(i.e. when a packet is arrived, the flow should be latest.)\n> and also remove the first(close oldest fd) element should be available.\n> Is it possible with priority queue?\n> 2015. 10. 1. 오후 7:42에 \"Simson L. Garfinkel\" <notifications@github.com>님이\n> 작성:\n>\n>\n> > Did you look at std::priority_queue()?\n> >\n> > I don't know how many other headers boost::intrusive::list will include.\n> >\n> >\n> > > On Oct 1, 2015, at 6:01 AM, EaseTheWorld <notifications@github.com>\n> > wrote:\n> > >\n> > > Oh. that is interesting. i didn't know boost until I see tcpflow\n> source.\n> > >\n> > > I'm gonna include one header <boost/Intrusive/list.hpp>.\n> > >\n> > > Like you said I prefer using existed library rather than implementing\n> > > myself.\n> > > At first I tried std::list, it seemed to work but turned out\n> list.size()\n> > is\n> > > not constant time complexity so I chose boost::intrusive::list.\n> > >\n> > > if you are still not comfortable with this, I'll use my implemented\n> list.\n> > > 2015. 10. 1. 오후 6:53에 \"Simson L. Garfinkel\" <notifications@github.com\n> >님이\n> > 작성:\n> > >\n> > > > Please don't use boost in the final version. It creates a huge\n> > dependency.\n> > > > I've had very bad experience with boost. If you can use just a few\n> > include\n> > > > files and incorporate them, that is okay, but no boost\n> dependencies...\n> > > >\n> > > > Sent from my iPhone\n> > > >\n> > > > > On Oct 1, 2015, at 1:25 AM, EaseTheWorld <notifications@github.com\n> >\n> > > > wrote:\n> > > > >\n> > > > > I'm seeing performance improvement with my own linked-list\n> > > > implementation.\n> > > > > but I think I can use boost::intrusive::list with same result.\n> > > > > I'll try soon.\n> > > > >\n> > > > > —\n> > > > > Reply to this email directly or view it on GitHub.\n> > > > >\n> > > >\n> > > > —\n> > > > Reply to this email directly or view it on GitHub\n> > > > <\n> https://github.com/simsong/tcpflow/issues/109#issuecomment-144682315\n> > >.\n> > > >\n> > > —\n> > > Reply to this email directly or view it on GitHub <\n> > https://github.com/simsong/tcpflow/issues/109#issuecomment-144684057>.\n> > >\n> >\n> > —\n> > Reply to this email directly or view it on GitHub\n> > <https://github.com/simsong/tcpflow/issues/109#issuecomment-144691026>.\n>\n> >\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/simsong/tcpflow/issues/109#issuecomment-144732651>.\n>\n"}}