-
Notifications
You must be signed in to change notification settings - Fork 914
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
[kinetic] Close sockets when server responds with HTTP/1.0 #1284
Conversation
7ae55fd
to
0de5a73
Compare
return false; | ||
} | ||
|
||
_response = ""; | ||
|
||
if (_header.size() < 8 || _header.find("HTTP/") != 0) | ||
XmlRpcUtil::error("Error XmlRpcClient::parseResponse: Header does not start with protocol"); |
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.
In case a response is received which doesn't contain the header this patch will add a new error. Is this really necessary?
I am also not sure about if it is reasonable to change the current behavior for HTTP 1.0 connections to not-keep-them-open.
Also how does this related to #1287?
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.
It's not really necessary, I can remove it.
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.
@mgrrx This comment seems to be still pending.
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.
sure will do ASAP
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.
I simplified the state ment. I assume it does the job without introducing the new error message.
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.
I assume it does the job without introducing the new error message.
Please make sure to test the latest change since this is a significant change for a distro which is already stable for 4 years (and the other comment suggests it doesn't work correctly atm).
If #1287 gets merged should this PR be closed or still considered to be merged? |
Sorry for coming back to this after so many months. Let me summarize why I think this PR still makes sense, especially for older releases: |
@mgrrx Please consider retargeting a different branch. Lunar is already EOL. Either target kinetic-devel (if it should only be applied to Kinetic) or melodic-devel. |
Updated as requested |
This PR tries to detect that the server responds with HTTP/1.0 and closes the connection accordingly in the manager.
I moved the clearing part of header_ to the end of parseResponse(). Putting setKeepOpen(false) into readHeader() didn't work for me as the internal state machine is affected by it. The header_ member is public but I couldn't find any usage of it, so I would assume that this doesn't affect anybody.