yhirose %!s(int64=5) %!d(string=hai) anos
pai
achega
49c4c2f9c1
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      httplib.h

+ 3 - 1
httplib.h

@@ -2114,7 +2114,9 @@ inline ssize_t write_content_chunked(Stream &strm,
       data_available = false;
       written_length = strm.write("0\r\n\r\n");
     };
-    data_sink.is_writable = [&](void) { return strm.is_writable(); };
+    data_sink.is_writable = [&](void) {
+      return strm.is_writable() && written_length >= 0;
+    };
 
     content_provider(offset, 0, data_sink);