Skip to content

Commit

Permalink
doveadm-server: http: Fixed lingering connections after the request i…
Browse files Browse the repository at this point in the history
…s sent.

Turns out conn->http_client is already NULL while doveadm_http_server_connection_destroy() is called.
This is because http_server_connection_unref() sets it to NULL;
Fixed by removing useless HTTP connection reference.
  • Loading branch information
stephanbosch authored and mrannanj committed Feb 15, 2018
1 parent 7d6ced7 commit 0f6b8a8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/doveadm/client-connection-http.c
Expand Up @@ -185,7 +185,6 @@ doveadm_http_server_request_destroy(void *context)

http_server_request_unref(&(conn->http_server_request));
http_server_switch_ioloop(doveadm_http_server);
http_server_connection_unref(&(conn->http_client));
}

static void doveadm_http_server_json_error(void *context, const char *error)
Expand Down Expand Up @@ -723,7 +722,6 @@ doveadm_http_server_handle_request(void *context, struct http_server_request *re
conn->http_request = http_server_request_get(req);
struct doveadm_http_server_mount *ep = NULL;

http_server_connection_ref(conn->http_client);
http_server_request_set_destroy_callback(req, doveadm_http_server_request_destroy, conn);
http_server_request_ref(conn->http_server_request);

Expand Down

0 comments on commit 0f6b8a8

Please sign in to comment.