File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -290,11 +290,22 @@ static int https_fetch_ctx_process_response(https_client_t *client,
290290 if (long_resp == 200 ) {
291291 faulty_response = 0 ;
292292 } else if (long_resp == 0 ) {
293- // in case of HTTP/1.1 this can happen very often depending on DNS query frequency
294- // example: server side closes the connection or curl force closes connections
295- // that have been opened a long time ago (if CURLOPT_MAXAGE_CONN can not be increased
296- // it is 118 seconds)
297- WLOG_REQ ("No response (probably connection has been closed or timed out)" );
293+ curl_off_t uploaded_bytes = 0 ;
294+ if (curl_easy_getinfo (ctx -> curl , CURLINFO_SIZE_UPLOAD_T , & uploaded_bytes ) == CURLE_OK &&
295+ uploaded_bytes > 0 ) {
296+ ELOG_REQ ("Connecting and sending request to resolver was successful, "
297+ "but no response was sent back" );
298+ if (client -> opt -> use_http_1_1 ) {
299+ // for example Unbound DoH servers does not support HTTP/1.x, only HTTP/2
300+ ELOG ("Resolver may not support current HTTP/1.1 protocol version" );
301+ }
302+ } else {
303+ // in case of HTTP/1.1 this can happen very often depending on DNS query frequency
304+ // example: server side closes the connection or curl force closes connections
305+ // that have been opened a long time ago (if CURLOPT_MAXAGE_CONN can not be increased
306+ // it is 118 seconds)
307+ WLOG_REQ ("No response (probably connection has been closed or timed out)" );
308+ }
298309 } else {
299310 ELOG_REQ ("curl response code: %d, content length: %zu" , long_resp , ctx -> buflen );
300311 if (ctx -> buflen >= 0 ) {
You can’t perform that action at this time.
0 commit comments