-
Notifications
You must be signed in to change notification settings - Fork 24
Fix http server issues with "Peer-Address" messages on Ubuntu 16.04 #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| int flags = 0; | ||
| // id of client (used for reply) | ||
| idSize = ::zmq_recv( socket, id, sizeof( id ), 0 ); | ||
| idSize = ::zmq_recv( socket, id, sizeof( id ), flags ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed or just a debugging artefact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just found it below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no, the assignment below has no side effect due to the scope of flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, this assignment has no effect, yet I was sure it had solved the last of my problems when I did it. I'll remove it and test everything again on Friday.
|
Can you merge the #157 test into this PR? |
|
+1 otherwise |
|
@favreau had also seen the Peer-Address msg, iirc. |
|
retest this please |
Unexpected "Peer-Address" or empty messages caused Tide's RestServer to block in receive() after each http request in zmq_recv() at line 144 of zeroeq/http/server.cpp. Such messages did not occur with libzmq 4.0.4. This pathch ensure that none of the following unit tests block indefinitely: - zeroeq/http/server - issue157 - tide/cpp/core/RestServerTests - testServerReturnsSimpleContent and that normal receive operations (as tested with Tide's REST interface) work as expected on Ubuntu 14.04, 16.04 and OSX.
|
Updated with a fix that I think is cleaner and has been tested on all platforms. I don't know how this could be specifically unit tested, however. |
|
Gah, this is the kind of $#@! I wanted to avoid with zmq - Collage has similarly nice code. At least we're one level higher now at the http protocol (as opposed to tcp). |
These unexpected messages caused Tide's RestServer to block the main
thread after each http request in zmq_recv() at line 144 of
zeroeq/http/server.cpp.
The exact combination of operations in this patch is necessary to ensure
that none of the following unit tests block indefinitely:
and that normal receive operations (as tested with Tide's REST interface)
still work as expected (no messages skipped due to zmq_errno() == EAGAIN)