Handle NULL connection pointer passed in by multi.c #2653

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
2 participants
@lymanepp

No description provided.

lib/url.c
@@ -4711,14 +4711,16 @@ CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn)
{
struct SingleRequest *k = &data->req;
- conn->bits.do_more = FALSE; /* by default there's no curl_do_more() to
- use */
+ if (conn != NULL)

This comment has been minimized.

@bagder

bagder Jun 12, 2018

Member

we prefer these to be just if(conn) - and notice the lack of space before the paren!

@bagder

bagder Jun 12, 2018

Member

we prefer these to be just if(conn) - and notice the lack of space before the paren!

This comment has been minimized.

@lymanepp

lymanepp Jun 13, 2018

Updated as requested.

@lymanepp

lymanepp Jun 13, 2018

Updated as requested.

@bagder

This comment has been minimized.

Show comment
Hide comment
@bagder

bagder Jun 12, 2018

Member

Please explain why we want this to work like this? Are you saying we end up there without a conn pointer during some situation?

Member

bagder commented Jun 12, 2018

Please explain why we want this to work like this? Are you saying we end up there without a conn pointer during some situation?

@lymanepp

This comment has been minimized.

Show comment
Hide comment
@lymanepp

lymanepp Jun 13, 2018

This happens when using a multi handle. You can find in multi.c where this gets called with a NULL pointer.

This happens when using a multi handle. You can find in multi.c where this gets called with a NULL pointer.

@lymanepp

This comment has been minimized.

Show comment
Hide comment
@lymanepp

lymanepp Jun 13, 2018

The CI build errors and coverage decrease to 0% are unrelated to these changes.

The CI build errors and coverage decrease to 0% are unrelated to these changes.

lymanepp added some commits Jun 13, 2018

@bagder

This comment has been minimized.

Show comment
Hide comment
@bagder

bagder Jun 13, 2018

Member

Ah right, when using HTTP/2... (when Curl_multi_add_perform() is called from http2.c)

Member

bagder commented Jun 13, 2018

Ah right, when using HTTP/2... (when Curl_multi_add_perform() is called from http2.c)

@bagder

bagder approved these changes Jun 13, 2018

@bagder

This comment has been minimized.

Show comment
Hide comment
@bagder

bagder Jun 13, 2018

Member

Thanks! (I edited it slightly before I merged.)

Member

bagder commented Jun 13, 2018

Thanks! (I edited it slightly before I merged.)

@bagder bagder closed this in a0f9670 Jun 13, 2018

@lymanepp

This comment has been minimized.

Show comment
Hide comment
@lymanepp

lymanepp Jun 13, 2018

Thanks badger!

Thanks badger!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment