]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: test-http-client-errors: Address another reliability issue in "peer reuse...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 13 Sep 2018 07:16:41 +0000 (09:16 +0200)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 13 Sep 2018 23:08:27 +0000 (01:08 +0200)
src/lib-http/test-http-client-errors.c

index 319d1a3e1ea2a65c5dafe9089926477944c94171..960bf13813ec9722c2e1f06fbd7c748d3e42afb4 100644 (file)
@@ -2681,7 +2681,7 @@ test_client_peer_reuse_failure_response2(
        if (debug)
                i_debug("RESPONSE: %u %s", resp->status, resp->reason);
 
-       test_assert((resp->status / 100) > 2);
+       test_assert(http_response_is_internal_error(resp));
        test_assert(resp->reason != NULL && *resp->reason != '\0');
        i_free(ctx);
        io_loop_stop(ioloop);
@@ -2715,7 +2715,7 @@ test_client_peer_reuse_failure_response1(
                ctx->first = FALSE;
                ctx->to = timeout_add_short(500, test_client_peer_reuse_failure_next, ctx);
        } else {
-               test_assert(resp->status == HTTP_CLIENT_REQUEST_ERROR_CONNECT_FAILED);
+               test_assert(http_response_is_internal_error(resp));
        }
 
        test_assert(resp->reason != NULL && *resp->reason != '\0');