If a remote side terminates a connection, then notify and destroy
client as well.
call_finish_handler:
if ((conn->opts & RSPAMD_HTTP_CLIENT_SIMPLE) == 0) {
rspamd_http_connection_ref (conn);
- conn->finish_handler (conn, priv->msg);
conn->finished = TRUE;
+ conn->finish_handler (conn, priv->msg);
rspamd_http_connection_unref (conn);
}
else {
if (conn->finished) {
REF_RELEASE (pbuf);
rspamd_http_connection_unref (conn);
+ /* Double unref to avoid dangling connections */
+ rspamd_http_connection_unref (conn);
return;
}
else {