Преглед на файлове

conn_data_send.c: added handling of the new state for Upgrading

Evgeny Grin (Karlson2k) преди 1 година
родител
ревизия
2eb36e7375
променени са 1 файла, в които са добавени 13 реда и са изтрити 1 реда
  1. 13 1
      src/mhd2/conn_data_send.c

+ 13 - 1
src/mhd2/conn_data_send.c

@@ -288,6 +288,19 @@ mhd_conn_data_send (struct MHD_Connection *restrict c)
                         MHD_CONNECTION_FULL_REPLY_SENT);
     }
     break;
+#ifdef MHD_UPGRADE_SUPPORT
+  case MHD_CONNECTION_UPGRADE_HEADERS_SENDING:
+    res = mhd_send_data (c,
+                         c->write_buffer_append_offset
+                         - c->write_buffer_send_offset,
+                         c->write_buffer
+                         + c->write_buffer_send_offset,
+                         true,
+                         &sent);
+    if (mhd_SOCKET_ERR_NO_ERROR == res)
+      c->write_buffer_send_offset += sent;
+    break;
+#endif /* MHD_UPGRADE_SUPPORT */
   case MHD_CONNECTION_INIT:
   case MHD_CONNECTION_REQ_LINE_RECEIVING:
   case MHD_CONNECTION_REQ_LINE_RECEIVED:
@@ -309,7 +322,6 @@ mhd_conn_data_send (struct MHD_Connection *restrict c)
   case MHD_CONNECTION_PRE_CLOSING:
   case MHD_CONNECTION_CLOSED:
 #ifdef MHD_UPGRADE_SUPPORT
-  case MHD_CONNECTION_UPGRADE_HEADERS_SENDING:
   case MHD_CONNECTION_UPGRADING:
   case MHD_CONNECTION_UPGRADED:
   case MHD_CONNECTION_UPGRADED_CLEANING: