|
|
@@ -57,17 +57,19 @@ void _dns_client_conn_stream_put(struct dns_conn_stream *stream)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- /* Clean up QUIC stream */
|
|
|
- if (stream->quic_stream) {
|
|
|
- SSL_free(stream->quic_stream);
|
|
|
- stream->quic_stream = NULL;
|
|
|
- }
|
|
|
-
|
|
|
- /* Clean up HTTP/2 stream */
|
|
|
- if (stream->http2_stream) {
|
|
|
- struct http2_stream *http2_stream = stream->http2_stream;
|
|
|
- stream->http2_stream = NULL;
|
|
|
- http2_stream_put(http2_stream);
|
|
|
+ if (stream->type == DNS_SERVER_QUIC || stream->type == DNS_SERVER_HTTP3) {
|
|
|
+ /* Clean up QUIC stream */
|
|
|
+ if (stream->quic_stream) {
|
|
|
+ SSL_free(stream->quic_stream);
|
|
|
+ stream->quic_stream = NULL;
|
|
|
+ }
|
|
|
+ } else if (stream->type == DNS_SERVER_HTTPS) {
|
|
|
+ /* Clean up HTTP/2 stream */
|
|
|
+ if (stream->http2_stream) {
|
|
|
+ struct http2_stream *http2_stream = stream->http2_stream;
|
|
|
+ stream->http2_stream = NULL;
|
|
|
+ http2_stream_put(http2_stream);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (stream->query) {
|
|
|
@@ -101,18 +103,21 @@ void _dns_client_conn_server_streams_free(struct dns_server_info *server_info, s
|
|
|
|
|
|
list_del_init(&stream->server_list);
|
|
|
stream->server_info = NULL;
|
|
|
- if (stream->quic_stream) {
|
|
|
+ if (stream->type == DNS_SERVER_QUIC || stream->type == DNS_SERVER_HTTP3) {
|
|
|
+ if (stream->quic_stream) {
|
|
|
#if defined(OSSL_QUIC1_VERSION) && !defined(OPENSSL_NO_QUIC)
|
|
|
- SSL_stream_reset(stream->quic_stream, NULL, 0);
|
|
|
+ SSL_stream_reset(stream->quic_stream, NULL, 0);
|
|
|
#endif
|
|
|
- SSL_free(stream->quic_stream);
|
|
|
- stream->quic_stream = NULL;
|
|
|
- }
|
|
|
- /* Clean up HTTP/2 stream */
|
|
|
- if (stream->http2_stream) {
|
|
|
- struct http2_stream *http2_stream = stream->http2_stream;
|
|
|
- stream->http2_stream = NULL;
|
|
|
- http2_stream_put(http2_stream);
|
|
|
+ SSL_free(stream->quic_stream);
|
|
|
+ stream->quic_stream = NULL;
|
|
|
+ }
|
|
|
+ } else if (stream->type == DNS_SERVER_HTTPS) {
|
|
|
+ /* Clean up HTTP/2 stream */
|
|
|
+ if (stream->http2_stream) {
|
|
|
+ struct http2_stream *http2_stream = stream->http2_stream;
|
|
|
+ stream->http2_stream = NULL;
|
|
|
+ http2_stream_put(http2_stream);
|
|
|
+ }
|
|
|
}
|
|
|
_dns_client_conn_stream_put(stream);
|
|
|
}
|