Browse Source

Issue #8: Possible issue and possible fix in websocket handling (by celeron55)

bel 11 năm trước cách đây
mục cha
commit
4e62bd5b10
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -4837,7 +4837,7 @@ static void read_websocket(struct mg_connection *conn)
                 error = 0;
                 while (len < data_len) {
                     int n = pull(NULL, conn, data + len, (int)(data_len - len));
-                    if (n < 0) {
+                    if (n <= 0) {
                         error = 1;
                         break;
                     }