-
Notifications
You must be signed in to change notification settings - Fork 15
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
htpdate fails to read the date header #30
Comments
Yep indeed a bug... SSL_read should be called in a loop, as long as |
Please give it a try with this branch https://github.com/twekkel/htpdate/tree/LargeResponseHeader |
hi! thanks for the quick response! so the branch works a bit better. Note the rc return code is incorrect now (it will return the amount of data sent even if the receive fails). ntpdate is able to parse a date, but if fails just after:
in my case my laptop is not yet synchronized, so htpdate loops, and the second call fails as the connection is closed already. So htpdate only works with |
Using |
Some deep digging, thought me a couple of things
When the sleep is commented out at line 250 Line 250 in e29b490
I'm currently inclined to say that https://www.pool.ntp.org is a poor time source for htpdate and probably the current/original implementation is the best way to go forward. Not closing this issue, as better solutions might be available... |
btw
works fine too with the original htpdate version |
if the date header does not appear within the first 1024 bytes of the server first response, then it is not parsed at all:
This prevents for example the synchro from https://www.pool.ntp.org, as the date header appears after a bunch of other headers. It would require a bigger buffer and multiple calls to
SSL_read
to work.EDIT: in recent versions of htpdate the BUFFERSIZE was bumped to 8192 but there is still a single call to
SSL_read
so it still fails.The text was updated successfully, but these errors were encountered: