Skip to content

Conversation

yglukhov
Copy link
Member

This code crashes without this PR:

import httpclient
discard newHttpClient().request("https://specially-crafted-https-server/", "GET", "")

If the server response doesn't have Content-Length.
Also added some checks to parseChunks to make sure that doesn't happen there.

More info:

recvFull closes the client when the response is read. If called again, it would crash in sslRead because the sslHandle of the socket is already nil. This PR prevents recvFull from being called on the closed client.

Copy link
Contributor

@dom96 dom96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I will wait for tests

@dom96 dom96 merged commit 471ae7e into nim-lang:devel Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants