This is an automated email from the ASF dual-hosted git repository.
gmurthy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new f07975e DISPATCH-1970: Zero out the conn->config pointer since it has
already been freed. This closes #1046.
f07975e is described below
commit f07975ee4bde676438d226d885e0eb78937f99b4
Author: Ganesh Murthy <[email protected]>
AuthorDate: Thu Feb 18 14:07:52 2021 -0500
DISPATCH-1970: Zero out the conn->config pointer since it has already been
freed. This closes #1046.
---
src/adaptors/http2/http2_adaptor.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/adaptors/http2/http2_adaptor.c
b/src/adaptors/http2/http2_adaptor.c
index 25347e4..7ffdb0d 100644
--- a/src/adaptors/http2/http2_adaptor.c
+++ b/src/adaptors/http2/http2_adaptor.c
@@ -382,10 +382,6 @@ void free_qdr_http2_connection(qdr_http2_connection_t*
http_conn, bool on_shutdo
buff = DEQ_HEAD(http_conn->granted_read_buffs);
}
- if (http_conn->delete_egress_connections) {
- http_conn->config = 0;
- }
-
qd_log(http2_adaptor->log_source, QD_LOG_TRACE, "[C%"PRIu64"] Freeing
http2 connection in free_qdr_http2_connection", http_conn->conn_id);
free_qdr_http2_connection_t(http_conn);
@@ -872,13 +868,13 @@ static void _http_record_request(qdr_http2_connection_t
*conn, qdr_http2_stream_
remote_addr = conn->remote_address;
}
} else {
- remote_addr = conn->config->host;
+ remote_addr = conn->config?conn->config->host:0;
}
qd_http_record_request(http2_adaptor->core,
stream_data->method,
stream_data->request_status,
- conn->config->address,
- remote_addr, conn->config->site,
+ conn->config?conn->config->address:0,
+ remote_addr, conn->config?conn->config->site:0,
stream_data->remote_site,
conn->ingress, stream_data->bytes_in,
stream_data->bytes_out,
stream_data->stop && stream_data->start ?
stream_data->stop - stream_data->start : 0);
@@ -2094,6 +2090,8 @@ static void handle_disconnected(qdr_http2_connection_t*
conn)
conn->stream_dispatcher_stream_data = 0;
if (conn->delete_egress_connections) {
+ // The config has already been freed by the
qd_http_connector_decref() function, set it to zero here
+ conn->config = 0;
close_connections(conn);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]