]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
Revert "Merge branch 'odvr-doh-assert' into 'master'"
authorTomas Krizek <tomas.krizek@nic.cz>
Tue, 30 Mar 2021 11:29:21 +0000 (13:29 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 30 Mar 2021 11:29:21 +0000 (13:29 +0200)
This reverts commit 4dab349e269364b8d27415a548e90446aaac11fb, reversing
changes made to 4bcf335de92bf51b22fe3d517f532a219c4b76cd.

daemon/http.c

index b0417635029fd32e2b65eb477caf16a8ab4c85ea..d31280fce97b3dc0ade09bf3c71a6c85b4c0a62d 100644 (file)
@@ -304,8 +304,6 @@ static void http_status_reinit_error(struct http_ctx *ctx, int stream_id)
                queue_pop(ctx->streams);
 
        http_status_reinit(ctx, stream_id);
-
-       nghttp2_submit_rst_stream(ctx->h2, NGHTTP2_FLAG_NONE, stream_id, NGHTTP2_REFUSED_STREAM);
 }
 
 /*
@@ -536,10 +534,13 @@ static int data_chunk_recv_callback(nghttp2_session *h2, uint8_t flags, int32_t
        struct http_ctx *ctx = (struct http_ctx *)user_data;
        ssize_t remaining;
        ssize_t required;
-       bool is_first;
+       assert(ctx->current_stream);
+       bool is_first = queue_len(ctx->streams) == 0 || queue_tail(ctx->streams) != ctx->current_stream->stream_id;
 
-       if (ctx->current_stream == NULL || ctx->current_stream->stream_id != stream_id) {
-               kr_log_verbose("[http] incomplete stream\n");
+       if (ctx->current_stream->stream_id != stream_id) {
+               kr_log_verbose(
+                       "[http] stream %d incomplete\n",
+                       ctx->current_stream->stream_id);
                if (!set_error_status(ctx, stream_id, 501, "incomplete stream"))
                        return NGHTTP2_ERR_CALLBACK_FAILURE;
                return 0;
@@ -547,8 +548,6 @@ static int data_chunk_recv_callback(nghttp2_session *h2, uint8_t flags, int32_t
 
        remaining = ctx->buf_size - ctx->submitted - ctx->buf_pos;
        required = len;
-
-       is_first = queue_len(ctx->streams) == 0 || queue_tail(ctx->streams) != ctx->current_stream->stream_id;
        /* First data chunk of the new stream */
        if (is_first)
                required += sizeof(uint16_t);