{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/libzmq/issues/1862","repository_url":"https://api.github.com/repos/zeromq/libzmq","labels_url":"https://api.github.com/repos/zeromq/libzmq/issues/1862/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/libzmq/issues/1862/comments","events_url":"https://api.github.com/repos/zeromq/libzmq/issues/1862/events","html_url":"https://github.com/zeromq/libzmq/pull/1862","id":142196996,"number":1862,"title":"Fixed issue #1695 (ZMQ_REQ_CORRELATE)","user":{"login":"FredTreg","id":16510148,"avatar_url":"https://avatars.githubusercontent.com/u/16510148?v=3","gravatar_id":"","url":"https://api.github.com/users/FredTreg","html_url":"https://github.com/FredTreg","followers_url":"https://api.github.com/users/FredTreg/followers","following_url":"https://api.github.com/users/FredTreg/following{/other_user}","gists_url":"https://api.github.com/users/FredTreg/gists{/gist_id}","starred_url":"https://api.github.com/users/FredTreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredTreg/subscriptions","organizations_url":"https://api.github.com/users/FredTreg/orgs","repos_url":"https://api.github.com/users/FredTreg/repos","events_url":"https://api.github.com/users/FredTreg/events{/privacy}","received_events_url":"https://api.github.com/users/FredTreg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-20T19:41:41Z","updated_at":"2016-03-20T22:29:36Z","closed_at":"2016-03-20T20:30:39Z","pull_request":{"url":"https://api.github.com/repos/zeromq/libzmq/pulls/1862","html_url":"https://github.com/zeromq/libzmq/pull/1862","diff_url":"https://github.com/zeromq/libzmq/pull/1862.diff","patch_url":"https://github.com/zeromq/libzmq/pull/1862.patch"},"body":"**Problem**: when using ZMQ_REQ_RELAXED + ZMQ_REQ_CORRELATE and two 'send' are executed in a row and no server is available at the time of the sends, then the internal request_id used to identify messages gets corrupted and the two messages end up with the same request_id. The correlation no longer works in that case and you may end up with the wrong message.\r\n\r\n**Solution**: make a copy of the `request_id` instance member of the `req_t` class before sending it down the pipe.\r\n\r\nIssues #1690 and #1695 are linked: I also updated documentation to reflect the changes (there is no longer a disconnection of the peer when two sends in a row are sent from a relaxed REQ socket).\r\n\r\nIt seems I am the first to use `malloc()` on the ZMQ project: I hope this is ok! (I could not see a way around it).\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/zeromq/libzmq/issues/comments/199048799","html_url":"https://github.com/zeromq/libzmq/pull/1862#issuecomment-199048799","issue_url":"https://api.github.com/repos/zeromq/libzmq/issues/1862","id":199048799,"user":{"login":"FredTreg","id":16510148,"avatar_url":"https://avatars.githubusercontent.com/u/16510148?v=3","gravatar_id":"","url":"https://api.github.com/users/FredTreg","html_url":"https://github.com/FredTreg","followers_url":"https://api.github.com/users/FredTreg/followers","following_url":"https://api.github.com/users/FredTreg/following{/other_user}","gists_url":"https://api.github.com/users/FredTreg/gists{/gist_id}","starred_url":"https://api.github.com/users/FredTreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredTreg/subscriptions","organizations_url":"https://api.github.com/users/FredTreg/orgs","repos_url":"https://api.github.com/users/FredTreg/repos","events_url":"https://api.github.com/users/FredTreg/events{/privacy}","received_events_url":"https://api.github.com/users/FredTreg/received_events","type":"User","site_admin":false},"created_at":"2016-03-20T22:29:36Z","updated_at":"2016-03-20T22:29:36Z","body":"Hi Pieter,\n\nI saw that tests were failing on your automated build system, specifically\ntest_req_relaxed.cpp and test_req_correlate.cpp which are the two options I\nam trying to fix.\n\nAs I had only tested my patch against the official 4.1.4, I closed my pull\nrequest. I then tested my patch with the HEAD of the master branch and\nindeed the two tests are failing. I am not sure it is related to my patch,\nbut I would like to investigate more before submitting my patch again.\n\nSorry if it caught you in the middle of the code review.\n\nThanks,\n\n2016-03-20 21:42 GMT+01:00 Pieter Hintjens <notifications@github.com>:\n\n> Why did you close the pull request?\n>\n> —\n> You are receiving this because you modified the open/close state.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/zeromq/libzmq/pull/1862#issuecomment-199016843>\n>\n"}}