Blame SOURCES/nghttp2-1.31.1-CVE-2019-9511-and-CVE-2019-9513.patch

9310a9
From 4b7aefd8fd1612d455f2f128c09230335ed0cee6 Mon Sep 17 00:00:00 2001
9310a9
From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
9310a9
Date: Tue, 6 Aug 2019 20:48:50 +0900
9310a9
Subject: [PATCH 1/3] nghttpx: Fix request stall
9310a9
9310a9
Fix request stall if backend connection is reused and buffer is full.
9310a9
9310a9
Upstream-commit: db2f612a30d54aa152ce5530fa1d683738baa4d1
9310a9
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
9310a9
---
9310a9
 integration-tests/nghttpx_http1_test.go | 29 +++++++++++++++++++++++++
9310a9
 integration-tests/server_tester.go      |  4 +++-
9310a9
 src/shrpx_downstream.cc                 | 12 +++++++++-
9310a9
 src/shrpx_downstream.h                  |  4 ++++
9310a9
 src/shrpx_http_downstream_connection.cc | 16 +++++++++++++-
9310a9
 src/shrpx_https_upstream.cc             |  4 +---
9310a9
 6 files changed, 63 insertions(+), 6 deletions(-)
9310a9
9310a9
diff --git a/integration-tests/nghttpx_http1_test.go b/integration-tests/nghttpx_http1_test.go
9310a9
index a765333..3d41677 100644
9310a9
--- a/integration-tests/nghttpx_http1_test.go
9310a9
+++ b/integration-tests/nghttpx_http1_test.go
9310a9
@@ -625,6 +625,35 @@ func TestH1H1HTTPSRedirectPort(t *testing.T) {
9310a9
 	}
9310a9
 }
9310a9
 
9310a9
+// TestH1H1POSTRequests tests that server can handle 2 requests with
9310a9
+// request body.
9310a9
+func TestH1H1POSTRequests(t *testing.T) {
9310a9
+	st := newServerTester(nil, t, noopHandler)
9310a9
+	defer st.Close()
9310a9
+
9310a9
+	res, err := st.http1(requestParam{
9310a9
+		name: "TestH1H1POSTRequestsNo1",
9310a9
+		body: make([]byte, 1),
9310a9
+	})
9310a9
+	if err != nil {
9310a9
+		t.Fatalf("Error st.http1() = %v", err)
9310a9
+	}
9310a9
+	if got, want := res.status, 200; got != want {
9310a9
+		t.Errorf("res.status: %v; want %v", got, want)
9310a9
+	}
9310a9
+
9310a9
+	res, err = st.http1(requestParam{
9310a9
+		name: "TestH1H1POSTRequestsNo2",
9310a9
+		body: make([]byte, 65536),
9310a9
+	})
9310a9
+	if err != nil {
9310a9
+		t.Fatalf("Error st.http1() = %v", err)
9310a9
+	}
9310a9
+	if got, want := res.status, 200; got != want {
9310a9
+		t.Errorf("res.status: %v; want %v", got, want)
9310a9
+	}
9310a9
+}
9310a9
+
9310a9
 // // TestH1H2ConnectFailure tests that server handles the situation that
9310a9
 // // connection attempt to HTTP/2 backend failed.
9310a9
 // func TestH1H2ConnectFailure(t *testing.T) {
9310a9
diff --git a/integration-tests/server_tester.go b/integration-tests/server_tester.go
9310a9
index d145519..1156986 100644
9310a9
--- a/integration-tests/server_tester.go
9310a9
+++ b/integration-tests/server_tester.go
9310a9
@@ -662,7 +662,9 @@ func cloneHeader(h http.Header) http.Header {
9310a9
 	return h2
9310a9
 }
9310a9
 
9310a9
-func noopHandler(w http.ResponseWriter, r *http.Request) {}
9310a9
+func noopHandler(w http.ResponseWriter, r *http.Request) {
9310a9
+	ioutil.ReadAll(r.Body)
9310a9
+}
9310a9
 
9310a9
 type APIResponse struct {
9310a9
 	Status string                 `json:"status,omitempty"`
9310a9
diff --git a/src/shrpx_downstream.cc b/src/shrpx_downstream.cc
9310a9
index 360a9a9..48db65b 100644
9310a9
--- a/src/shrpx_downstream.cc
9310a9
+++ b/src/shrpx_downstream.cc
9310a9
@@ -144,7 +144,8 @@ Downstream::Downstream(Upstream *upstream, MemchunkPool *mcpool,
9310a9
       request_header_sent_(false),
9310a9
       accesslog_written_(false),
9310a9
       new_affinity_cookie_(false),
9310a9
-      blocked_request_data_eof_(false) {
9310a9
+      blocked_request_data_eof_(false),
9310a9
+      expect_100_continue_(false) {
9310a9
 
9310a9
   auto &timeoutconf = get_config()->http2.timeout;
9310a9
 
9310a9
@@ -807,6 +808,11 @@ void Downstream::inspect_http1_request() {
9310a9
       chunked_request_ = true;
9310a9
     }
9310a9
   }
9310a9
+
9310a9
+  auto expect = req_.fs.header(http2::HD_EXPECT);
9310a9
+  expect_100_continue_ =
9310a9
+      expect &&
9310a9
+      util::strieq(expect->value, StringRef::from_lit("100-continue"));
9310a9
 }
9310a9
 
9310a9
 void Downstream::inspect_http1_response() {
9310a9
@@ -1103,4 +1109,8 @@ bool Downstream::get_blocked_request_data_eof() const {
9310a9
   return blocked_request_data_eof_;
9310a9
 }
9310a9
 
9310a9
+bool Downstream::get_expect_100_continue() const {
9310a9
+  return expect_100_continue_;
9310a9
+}
9310a9
+
9310a9
 } // namespace shrpx
9310a9
diff --git a/src/shrpx_downstream.h b/src/shrpx_downstream.h
9310a9
index c81fcf6..b9a851f 100644
9310a9
--- a/src/shrpx_downstream.h
9310a9
+++ b/src/shrpx_downstream.h
9310a9
@@ -466,6 +466,8 @@ public:
9310a9
     EVENT_TIMEOUT = 0x2,
9310a9
   };
9310a9
 
9310a9
+  bool get_expect_100_continue() const;
9310a9
+
9310a9
   enum {
9310a9
     DISPATCH_NONE,
9310a9
     DISPATCH_PENDING,
9310a9
@@ -556,6 +558,8 @@ private:
9310a9
   // true if eof is received from client before sending header fields
9310a9
   // to backend.
9310a9
   bool blocked_request_data_eof_;
9310a9
+  // true if request contains "expect: 100-continue" header field.
9310a9
+  bool expect_100_continue_;
9310a9
 };
9310a9
 
9310a9
 } // namespace shrpx
9310a9
diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc
9310a9
index f50c0f4..85ca947 100644
9310a9
--- a/src/shrpx_http_downstream_connection.cc
9310a9
+++ b/src/shrpx_http_downstream_connection.cc
9310a9
@@ -698,7 +698,8 @@ int HttpDownstreamConnection::push_request_headers() {
9310a9
   // signal_write() when we received request body chunk, and it
9310a9
   // enables us to send headers and data in one writev system call.
9310a9
   if (connect_method || downstream_->get_blocked_request_buf()->rleft() ||
9310a9
-      (!req.http2_expect_body && req.fs.content_length == 0)) {
9310a9
+      (!req.http2_expect_body && req.fs.content_length == 0) ||
9310a9
+      downstream_->get_expect_100_continue()) {
9310a9
     signal_write();
9310a9
   }
9310a9
 
9310a9
@@ -1172,6 +1173,19 @@ int HttpDownstreamConnection::write_reuse_first() {
9310a9
 
9310a9
   reuse_first_write_done_ = true;
9310a9
 
9310a9
+  // upstream->resume_read() might be called in
9310a9
+  // write_tls()/write_clear(), but before blocked_request_buf_ is
9310a9
+  // reset.  So upstream read might still be blocked.  Let's do it
9310a9
+  // again here.
9310a9
+  auto input = downstream_->get_request_buf();
9310a9
+  if (input->rleft() == 0) {
9310a9
+    auto upstream = downstream_->get_upstream();
9310a9
+    auto &req = downstream_->request();
9310a9
+
9310a9
+    upstream->resume_read(SHRPX_NO_BUFFER, downstream_,
9310a9
+                          req.unconsumed_body_length);
9310a9
+  }
9310a9
+
9310a9
   return 0;
9310a9
 }
9310a9
 
9310a9
diff --git a/src/shrpx_https_upstream.cc b/src/shrpx_https_upstream.cc
9310a9
index 452ec90..96ca2cd 100644
9310a9
--- a/src/shrpx_https_upstream.cc
9310a9
+++ b/src/shrpx_https_upstream.cc
9310a9
@@ -467,9 +467,7 @@ int htp_hdrs_completecb(http_parser *htp) {
9310a9
     // and let them decide whether responds with 100 Continue or not.
9310a9
     // For alternative mode, we have no backend, so just send 100
9310a9
     // Continue here to make the client happy.
9310a9
-    auto expect = req.fs.header(http2::HD_EXPECT);
9310a9
-    if (expect &&
9310a9
-        util::strieq(expect->value, StringRef::from_lit("100-continue"))) {
9310a9
+    if (downstream->get_expect_100_continue()) {
9310a9
       auto output = downstream->get_response_buf();
9310a9
       constexpr auto res = StringRef::from_lit("HTTP/1.1 100 Continue\r\n\r\n");
9310a9
       output->append(res);
9310a9
-- 
9310a9
2.20.1
9310a9
9310a9
9310a9
From 589a98eba0b3c7a4dbb2262c60b609cac2b1f838 Mon Sep 17 00:00:00 2001
9310a9
From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
9310a9
Date: Tue, 25 Jun 2019 22:33:35 +0900
9310a9
Subject: [PATCH 2/3] Add nghttp2_option_set_max_outbound_ack
9310a9
9310a9
Upstream-commit: a76d0723b5f52902139ff453e0ec840673e86e75
9310a9
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
9310a9
---
9310a9
 doc/Makefile.am                |  1 +
9310a9
 lib/includes/nghttp2/nghttp2.h | 11 +++++++++++
9310a9
 lib/nghttp2_option.c           |  5 +++++
9310a9
 lib/nghttp2_option.h           |  5 +++++
9310a9
 lib/nghttp2_session.c          |  9 +++++++--
9310a9
 lib/nghttp2_session.h          |  8 ++++++--
9310a9
 tests/nghttp2_session_test.c   |  4 ++--
9310a9
 7 files changed, 37 insertions(+), 6 deletions(-)
9310a9
9310a9
diff --git a/doc/Makefile.am b/doc/Makefile.am
9310a9
index 07cd34e..66e5ba3 100644
9310a9
--- a/doc/Makefile.am
9310a9
+++ b/doc/Makefile.am
9310a9
@@ -67,6 +67,7 @@ APIDOCS= \
9310a9
 	nghttp2_option_set_no_recv_client_magic.rst \
9310a9
 	nghttp2_option_set_peer_max_concurrent_streams.rst \
9310a9
 	nghttp2_option_set_user_recv_extension_type.rst \
9310a9
+	nghttp2_option_set_max_outbound_ack.rst \
9310a9
 	nghttp2_pack_settings_payload.rst \
9310a9
 	nghttp2_priority_spec_check_default.rst \
9310a9
 	nghttp2_priority_spec_default_init.rst \
9310a9
diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h
9310a9
index 14f8950..137a675 100644
9310a9
--- a/lib/includes/nghttp2/nghttp2.h
9310a9
+++ b/lib/includes/nghttp2/nghttp2.h
9310a9
@@ -2637,6 +2637,17 @@ nghttp2_option_set_max_deflate_dynamic_table_size(nghttp2_option *option,
9310a9
 NGHTTP2_EXTERN void nghttp2_option_set_no_closed_streams(nghttp2_option *option,
9310a9
                                                          int val);
9310a9
 
9310a9
+/**
9310a9
+ * @function
9310a9
+ *
9310a9
+ * This function sets the maximum number of outgoing SETTINGS ACK and
9310a9
+ * PING ACK frames retained in :type:`nghttp2_session` object.  If
9310a9
+ * more than those frames are retained, the peer is considered to be
9310a9
+ * misbehaving and session will be closed.  The default value is 1000.
9310a9
+ */
9310a9
+NGHTTP2_EXTERN void nghttp2_option_set_max_outbound_ack(nghttp2_option *option,
9310a9
+                                                        size_t val);
9310a9
+
9310a9
 /**
9310a9
  * @function
9310a9
  *
9310a9
diff --git a/lib/nghttp2_option.c b/lib/nghttp2_option.c
9310a9
index aec5dcf..ae22493 100644
9310a9
--- a/lib/nghttp2_option.c
9310a9
+++ b/lib/nghttp2_option.c
9310a9
@@ -116,3 +116,8 @@ void nghttp2_option_set_no_closed_streams(nghttp2_option *option, int val) {
9310a9
   option->opt_set_mask |= NGHTTP2_OPT_NO_CLOSED_STREAMS;
9310a9
   option->no_closed_streams = val;
9310a9
 }
9310a9
+
9310a9
+void nghttp2_option_set_max_outbound_ack(nghttp2_option *option, size_t val) {
9310a9
+  option->opt_set_mask |= NGHTTP2_OPT_MAX_OUTBOUND_ACK;
9310a9
+  option->max_outbound_ack = val;
9310a9
+}
9310a9
diff --git a/lib/nghttp2_option.h b/lib/nghttp2_option.h
9310a9
index c743e33..86d31f7 100644
9310a9
--- a/lib/nghttp2_option.h
9310a9
+++ b/lib/nghttp2_option.h
9310a9
@@ -66,6 +66,7 @@ typedef enum {
9310a9
   NGHTTP2_OPT_MAX_SEND_HEADER_BLOCK_LENGTH = 1 << 8,
9310a9
   NGHTTP2_OPT_MAX_DEFLATE_DYNAMIC_TABLE_SIZE = 1 << 9,
9310a9
   NGHTTP2_OPT_NO_CLOSED_STREAMS = 1 << 10,
9310a9
+  NGHTTP2_OPT_MAX_OUTBOUND_ACK = 1 << 11,
9310a9
 } nghttp2_option_flag;
9310a9
 
9310a9
 /**
9310a9
@@ -80,6 +81,10 @@ struct nghttp2_option {
9310a9
    * NGHTTP2_OPT_MAX_DEFLATE_DYNAMIC_TABLE_SIZE
9310a9
    */
9310a9
   size_t max_deflate_dynamic_table_size;
9310a9
+  /**
9310a9
+   * NGHTTP2_OPT_MAX_OUTBOUND_ACK
9310a9
+   */
9310a9
+  size_t max_outbound_ack;
9310a9
   /**
9310a9
    * Bitwise OR of nghttp2_option_flag to determine that which fields
9310a9
    * are specified.
9310a9
diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c
9310a9
index c58f059..8628cc7 100644
9310a9
--- a/lib/nghttp2_session.c
9310a9
+++ b/lib/nghttp2_session.c
9310a9
@@ -457,6 +457,7 @@ static int session_new(nghttp2_session **session_ptr,
9310a9
   (*session_ptr)->remote_settings.max_concurrent_streams = 100;
9310a9
 
9310a9
   (*session_ptr)->max_send_header_block_length = NGHTTP2_MAX_HEADERSLEN;
9310a9
+  (*session_ptr)->max_outbound_ack = NGHTTP2_DEFAULT_MAX_OBQ_FLOOD_ITEM;
9310a9
 
9310a9
   if (option) {
9310a9
     if ((option->opt_set_mask & NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE) &&
9310a9
@@ -516,6 +517,10 @@ static int session_new(nghttp2_session **session_ptr,
9310a9
         option->no_closed_streams) {
9310a9
       (*session_ptr)->opt_flags |= NGHTTP2_OPTMASK_NO_CLOSED_STREAMS;
9310a9
     }
9310a9
+
9310a9
+    if (option->opt_set_mask & NGHTTP2_OPT_MAX_OUTBOUND_ACK) {
9310a9
+      (*session_ptr)->max_outbound_ack = option->max_outbound_ack;
9310a9
+    }
9310a9
   }
9310a9
 
9310a9
   rv = nghttp2_hd_deflate_init2(&(*session_ptr)->hd_deflater,
9310a9
@@ -6831,7 +6836,7 @@ int nghttp2_session_add_ping(nghttp2_session *session, uint8_t flags,
9310a9
   mem = &session->mem;
9310a9
 
9310a9
   if ((flags & NGHTTP2_FLAG_ACK) &&
9310a9
-      session->obq_flood_counter_ >= NGHTTP2_MAX_OBQ_FLOOD_ITEM) {
9310a9
+      session->obq_flood_counter_ >= session->max_outbound_ack) {
9310a9
     return NGHTTP2_ERR_FLOODED;
9310a9
   }
9310a9
 
9310a9
@@ -6976,7 +6981,7 @@ int nghttp2_session_add_settings(nghttp2_session *session, uint8_t flags,
9310a9
       return NGHTTP2_ERR_INVALID_ARGUMENT;
9310a9
     }
9310a9
 
9310a9
-    if (session->obq_flood_counter_ >= NGHTTP2_MAX_OBQ_FLOOD_ITEM) {
9310a9
+    if (session->obq_flood_counter_ >= session->max_outbound_ack) {
9310a9
       return NGHTTP2_ERR_FLOODED;
9310a9
     }
9310a9
   }
9310a9
diff --git a/lib/nghttp2_session.h b/lib/nghttp2_session.h
9310a9
index c7cb27d..d9e2846 100644
9310a9
--- a/lib/nghttp2_session.h
9310a9
+++ b/lib/nghttp2_session.h
9310a9
@@ -97,7 +97,7 @@ typedef struct {
9310a9
    response frames are stacked up, which leads to memory exhaustion.
9310a9
    The value selected here is arbitrary, but safe value and if we have
9310a9
    these frames in this number, it is considered suspicious. */
9310a9
-#define NGHTTP2_MAX_OBQ_FLOOD_ITEM 10000
9310a9
+#define NGHTTP2_DEFAULT_MAX_OBQ_FLOOD_ITEM 1000
9310a9
 
9310a9
 /* The default value of maximum number of concurrent streams. */
9310a9
 #define NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS 0xffffffffu
9310a9
@@ -260,8 +260,12 @@ struct nghttp2_session {
9310a9
   size_t num_idle_streams;
9310a9
   /* The number of bytes allocated for nvbuf */
9310a9
   size_t nvbuflen;
9310a9
-  /* Counter for detecting flooding in outbound queue */
9310a9
+  /* Counter for detecting flooding in outbound queue.  If it exceeds
9310a9
+     max_outbound_ack, session will be closed. */
9310a9
   size_t obq_flood_counter_;
9310a9
+  /* The maximum number of outgoing SETTINGS ACK and PING ACK in
9310a9
+     outbound queue. */
9310a9
+  size_t max_outbound_ack;
9310a9
   /* The maximum length of header block to send.  Calculated by the
9310a9
      same way as nghttp2_hd_deflate_bound() does. */
9310a9
   size_t max_send_header_block_length;
9310a9
diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c
9310a9
index 783b0ed..debec59 100644
9310a9
--- a/tests/nghttp2_session_test.c
9310a9
+++ b/tests/nghttp2_session_test.c
9310a9
@@ -9894,7 +9894,7 @@ void test_nghttp2_session_flooding(void) {
9310a9
 
9310a9
   buf = &bufs.head->buf;
9310a9
 
9310a9
-  for (i = 0; i < NGHTTP2_MAX_OBQ_FLOOD_ITEM; ++i) {
9310a9
+  for (i = 0; i < NGHTTP2_DEFAULT_MAX_OBQ_FLOOD_ITEM; ++i) {
9310a9
     CU_ASSERT(
9310a9
         (ssize_t)nghttp2_buf_len(buf) ==
9310a9
         nghttp2_session_mem_recv(session, buf->pos, nghttp2_buf_len(buf)));
9310a9
@@ -9916,7 +9916,7 @@ void test_nghttp2_session_flooding(void) {
9310a9
 
9310a9
   buf = &bufs.head->buf;
9310a9
 
9310a9
-  for (i = 0; i < NGHTTP2_MAX_OBQ_FLOOD_ITEM; ++i) {
9310a9
+  for (i = 0; i < NGHTTP2_DEFAULT_MAX_OBQ_FLOOD_ITEM; ++i) {
9310a9
     CU_ASSERT(
9310a9
         (ssize_t)nghttp2_buf_len(buf) ==
9310a9
         nghttp2_session_mem_recv(session, buf->pos, nghttp2_buf_len(buf)));
9310a9
-- 
9310a9
2.20.1
9310a9
9310a9
9310a9
From e32b3e4c9df4abb83ca1c1c41901fadbae44699b Mon Sep 17 00:00:00 2001
9310a9
From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
9310a9
Date: Tue, 25 Jun 2019 22:38:43 +0900
9310a9
Subject: [PATCH 3/3] Don't read too greedily
9310a9
9310a9
Upstream-commit: 83d362c6d21f76599b86e7b94cd1992288a1d43c
9310a9
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
9310a9
---
9310a9
 src/HttpServer.cc           | 2 ++
9310a9
 src/shrpx_client_handler.cc | 9 +++++++--
9310a9
 2 files changed, 9 insertions(+), 2 deletions(-)
9310a9
9310a9
diff --git a/src/HttpServer.cc b/src/HttpServer.cc
9310a9
index b3e35ef..a75cee4 100644
9310a9
--- a/src/HttpServer.cc
9310a9
+++ b/src/HttpServer.cc
9310a9
@@ -650,6 +650,7 @@ int Http2Handler::read_clear() {
9310a9
       }
9310a9
       return -1;
9310a9
     }
9310a9
+    break;
9310a9
   }
9310a9
 
9310a9
   return write_(*this);
9310a9
@@ -775,6 +776,7 @@ int Http2Handler::read_tls() {
9310a9
       }
9310a9
       return -1;
9310a9
     }
9310a9
+    break;
9310a9
   }
9310a9
 
9310a9
 fin:
9310a9
diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc
9310a9
index 21430dd..fa1fc87 100644
9310a9
--- a/src/shrpx_client_handler.cc
9310a9
+++ b/src/shrpx_client_handler.cc
9310a9
@@ -111,6 +111,7 @@ void writecb(struct ev_loop *loop, ev_io *w, int revents) {
9310a9
 int ClientHandler::noop() { return 0; }
9310a9
 
9310a9
 int ClientHandler::read_clear() {
9310a9
+  auto should_break = false;
9310a9
   rb_.ensure_chunk();
9310a9
   for (;;) {
9310a9
     if (rb_.rleft() && on_read() != 0) {
9310a9
@@ -123,7 +124,7 @@ int ClientHandler::read_clear() {
9310a9
       return 0;
9310a9
     }
9310a9
 
9310a9
-    if (!ev_is_active(&conn_.rev)) {
9310a9
+    if (!ev_is_active(&conn_.rev) || should_break) {
9310a9
       return 0;
9310a9
     }
9310a9
 
9310a9
@@ -141,6 +142,7 @@ int ClientHandler::read_clear() {
9310a9
     }
9310a9
 
9310a9
     rb_.write(nread);
9310a9
+    should_break = true;
9310a9
   }
9310a9
 }
9310a9
 
9310a9
@@ -205,6 +207,8 @@ int ClientHandler::tls_handshake() {
9310a9
 }
9310a9
 
9310a9
 int ClientHandler::read_tls() {
9310a9
+  auto should_break = false;
9310a9
+
9310a9
   ERR_clear_error();
9310a9
 
9310a9
   rb_.ensure_chunk();
9310a9
@@ -221,7 +225,7 @@ int ClientHandler::read_tls() {
9310a9
       return 0;
9310a9
     }
9310a9
 
9310a9
-    if (!ev_is_active(&conn_.rev)) {
9310a9
+    if (!ev_is_active(&conn_.rev) || should_break) {
9310a9
       return 0;
9310a9
     }
9310a9
 
9310a9
@@ -239,6 +243,7 @@ int ClientHandler::read_tls() {
9310a9
     }
9310a9
 
9310a9
     rb_.write(nread);
9310a9
+    should_break = true;
9310a9
   }
9310a9
 }
9310a9
 
9310a9
-- 
9310a9
2.20.1
9310a9