Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
comms/http-client: destroy connection after calling cb
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Dilly <[email protected]>
  • Loading branch information
bdilly committed Sep 11, 2015
1 parent 4852ead commit 8257928
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/lib/comms/sol-http-client-impl-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ call_connection_finish_cb(struct sol_http_client_connection *connection)
long response_code;
char *tmp;

if (!connection->cb)
if (sol_ptr_vector_remove(&global.connections, connection) < 0)
return;

if (connection->error) {
Expand Down Expand Up @@ -168,7 +168,7 @@ call_connection_finish_cb(struct sol_http_client_connection *connection)

out:
connection->cb((void *)connection->data, connection, param);
connection->cb = NULL; /* Don't call again. */
destroy_connection(connection);
}

static size_t
Expand Down Expand Up @@ -296,10 +296,6 @@ error_cb(void *data)

call_connection_finish_cb(connection);

sol_ptr_vector_remove(&global.connections, connection);

destroy_connection(connection);

return false;
}

Expand Down

0 comments on commit 8257928

Please sign in to comment.