@@ -356,8 +356,8 @@ static int https_fetch_ctx_process_response(https_client_t *client,
356356 }
357357 }
358358
359- if (( res = curl_easy_getinfo (
360- ctx -> curl , CURLINFO_RESPONSE_CODE , & long_resp )) != CURLE_OK ) {
359+ res = curl_easy_getinfo (ctx -> curl , CURLINFO_RESPONSE_CODE , & long_resp );
360+ if ( res != CURLE_OK ) {
361361 ELOG_REQ ("CURLINFO_RESPONSE_CODE: %s" , curl_easy_strerror (res ));
362362 faulty_response = 1 ;
363363 } else if (long_resp != 200 ) {
@@ -391,8 +391,8 @@ static int https_fetch_ctx_process_response(https_client_t *client,
391391
392392 if (!faulty_response )
393393 {
394- if (( res = curl_easy_getinfo (
395- ctx -> curl , CURLINFO_CONTENT_TYPE , & str_resp )) != CURLE_OK ) {
394+ res = curl_easy_getinfo (ctx -> curl , CURLINFO_CONTENT_TYPE , & str_resp );
395+ if ( res != CURLE_OK ) {
396396 ELOG_REQ ("CURLINFO_CONTENT_TYPE: %s" , curl_easy_strerror (res ));
397397 } else if (str_resp == NULL ||
398398 strncmp (str_resp , DOH_CONTENT_TYPE , sizeof (DOH_CONTENT_TYPE ) - 1 ) != 0 ) { // at least, start with it
@@ -402,23 +402,25 @@ static int https_fetch_ctx_process_response(https_client_t *client,
402402 }
403403
404404 if (logging_debug_enabled () || faulty_response || ctx -> buflen == 0 ) {
405- if (( res = curl_easy_getinfo (
406- ctx -> curl , CURLINFO_REDIRECT_URL , & str_resp )) != CURLE_OK ) {
405+ res = curl_easy_getinfo (ctx -> curl , CURLINFO_REDIRECT_URL , & str_resp );
406+ if ( res != CURLE_OK ) {
407407 ELOG_REQ ("CURLINFO_REDIRECT_URL: %s" , curl_easy_strerror (res ));
408408 } else if (str_resp != NULL ) {
409409 WLOG_REQ ("Request would be redirected to: %s" , str_resp );
410410 if (strcmp (str_resp , client -> opt -> resolver_url ) != 0 ) {
411411 WLOG ("Please update Resolver URL to avoid redirection!" );
412412 }
413413 }
414- if ((res = curl_easy_getinfo (
415- ctx -> curl , CURLINFO_SSL_VERIFYRESULT , & long_resp )) != CURLE_OK ) {
414+
415+ res = curl_easy_getinfo (ctx -> curl , CURLINFO_SSL_VERIFYRESULT , & long_resp );
416+ if (res != CURLE_OK ) {
416417 ELOG_REQ ("CURLINFO_SSL_VERIFYRESULT: %s" , curl_easy_strerror (res ));
417418 } else if (long_resp != CURLE_OK ) {
418419 WLOG_REQ ("CURLINFO_SSL_VERIFYRESULT: %s" , curl_easy_strerror (long_resp ));
419420 }
420- if ((res = curl_easy_getinfo (
421- ctx -> curl , CURLINFO_OS_ERRNO , & long_resp )) != CURLE_OK ) {
421+
422+ res = curl_easy_getinfo (ctx -> curl , CURLINFO_OS_ERRNO , & long_resp );
423+ if (res != CURLE_OK ) {
422424 ELOG_REQ ("CURLINFO_OS_ERRNO: %s" , curl_easy_strerror (res ));
423425 } else if (long_resp != 0 ) {
424426 WLOG_REQ ("CURLINFO_OS_ERRNO: %d %s" , long_resp , strerror (long_resp ));
@@ -430,8 +432,8 @@ static int https_fetch_ctx_process_response(https_client_t *client,
430432 }
431433
432434 if (logging_debug_enabled () || client -> stat ) {
433- if (( res = curl_easy_getinfo (
434- ctx -> curl , CURLINFO_NUM_CONNECTS , & long_resp )) != CURLE_OK ) {
435+ res = curl_easy_getinfo (ctx -> curl , CURLINFO_NUM_CONNECTS , & long_resp );
436+ if ( res != CURLE_OK ) {
435437 ELOG_REQ ("CURLINFO_NUM_CONNECTS: %s" , curl_easy_strerror (res ));
436438 } else {
437439 DLOG_REQ ("CURLINFO_NUM_CONNECTS: %d" , long_resp );
@@ -442,20 +444,22 @@ static int https_fetch_ctx_process_response(https_client_t *client,
442444 }
443445
444446 if (logging_debug_enabled ()) {
445- if (( res = curl_easy_getinfo (
446- ctx -> curl , CURLINFO_EFFECTIVE_URL , & str_resp )) != CURLE_OK ) {
447+ res = curl_easy_getinfo (ctx -> curl , CURLINFO_EFFECTIVE_URL , & str_resp );
448+ if ( res != CURLE_OK ) {
447449 ELOG_REQ ("CURLINFO_EFFECTIVE_URL: %s" , curl_easy_strerror (res ));
448450 } else {
449451 DLOG_REQ ("CURLINFO_EFFECTIVE_URL: %s" , str_resp );
450452 }
451- if ((res = curl_easy_getinfo (
452- ctx -> curl , CURLINFO_HTTP_VERSION , & long_resp )) != CURLE_OK ) {
453+
454+ res = curl_easy_getinfo (ctx -> curl , CURLINFO_HTTP_VERSION , & long_resp );
455+ if (res != CURLE_OK ) {
453456 ELOG_REQ ("CURLINFO_HTTP_VERSION: %s" , curl_easy_strerror (res ));
454457 } else if (long_resp != CURL_HTTP_VERSION_NONE ) {
455458 DLOG_REQ ("CURLINFO_HTTP_VERSION: %s" , http_version_str (long_resp ));
456459 }
457- if ((res = curl_easy_getinfo (
458- ctx -> curl , CURLINFO_PROTOCOL , & long_resp )) != CURLE_OK ) {
460+
461+ res = curl_easy_getinfo (ctx -> curl , CURLINFO_PROTOCOL , & long_resp );
462+ if (res != CURLE_OK ) {
459463 ELOG_REQ ("CURLINFO_PROTOCOL: %s" , curl_easy_strerror (res ));
460464 } else if (long_resp != CURLPROTO_HTTPS ) {
461465 DLOG_REQ ("CURLINFO_PROTOCOL: %d" , long_resp );
0 commit comments