]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: test-http-server-errors: Fixed logically dead code.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 5 Mar 2017 18:45:04 +0000 (19:45 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 5 Mar 2017 18:45:04 +0000 (19:45 +0100)
Problem reported by Coverity.

src/lib-http/test-http-server-errors.c

index 5c595c0f98c26716f8cb33c183596b07f1db3f89..2f26d5904075a3f9f688d4521e401c48d2186bba 100644 (file)
@@ -247,7 +247,7 @@ test_server_hanging_request_payload_input(struct _hanging_request_payload *ctx)
 
        if (ret == 0)
                return;
-       if (ret < 0) {
+       if (ctx->payload_input->stream_errno != 0) {
                if (debug) {
                        i_debug("test server: failed to read payload: %s",
                                i_stream_get_error(ctx->payload_input));
@@ -259,6 +259,8 @@ test_server_hanging_request_payload_input(struct _hanging_request_payload *ctx)
                http_server_request_unref(&req);
                return;
        }
+
+       i_assert(i_stream_is_eof(ctx->payload_input));
                
        resp = http_server_response_create(req, 200, "OK");
        http_server_response_submit(resp);