|
@@ -818,6 +818,10 @@ websock_server_ready(struct mg_connection *conn, void *udata)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#define long_ws_buf_len (500)
|
|
|
|
+static char long_ws_buf[long_ws_buf_len];
|
|
|
|
+
|
|
|
|
+
|
|
static int
|
|
static int
|
|
websock_server_data(struct mg_connection *conn,
|
|
websock_server_data(struct mg_connection *conn,
|
|
int bits,
|
|
int bits,
|
|
@@ -850,6 +854,14 @@ websock_server_data(struct mg_connection *conn,
|
|
mg_lock_connection(conn);
|
|
mg_lock_connection(conn);
|
|
mg_websocket_write(conn, WEBSOCKET_OPCODE_TEXT, "ok - 3", 6);
|
|
mg_websocket_write(conn, WEBSOCKET_OPCODE_TEXT, "ok - 3", 6);
|
|
mg_unlock_connection(conn);
|
|
mg_unlock_connection(conn);
|
|
|
|
+ } else if (data_len == long_ws_buf_len
|
|
|
|
+ && !memcmp(data, long_ws_buf, long_ws_buf_len)) {
|
|
|
|
+ mg_lock_connection(conn);
|
|
|
|
+ mg_websocket_write(conn,
|
|
|
|
+ WEBSOCKET_OPCODE_BINARY,
|
|
|
|
+ long_ws_buf,
|
|
|
|
+ long_ws_buf_len);
|
|
|
|
+ mg_unlock_connection(conn);
|
|
} else {
|
|
} else {
|
|
|
|
|
|
#if defined(__MINGW32__) || defined(__GNUC__)
|
|
#if defined(__MINGW32__) || defined(__GNUC__)
|
|
@@ -1295,7 +1307,7 @@ START_TEST(test_request_handlers)
|
|
ebuf,
|
|
ebuf,
|
|
sizeof(ebuf),
|
|
sizeof(ebuf),
|
|
"%s",
|
|
"%s",
|
|
- "POST /cgi_test.cgi HTTP/1.0\r\nContent-Length: 3\r\n\r\nABC");
|
|
|
|
|
|
+ "POST /cgi_test.cgi/x/y.z HTTP/1.0\r\nContent-Length: 3\r\n\r\nABC");
|
|
ck_assert(client_conn != NULL);
|
|
ck_assert(client_conn != NULL);
|
|
ri = mg_get_request_info(client_conn);
|
|
ri = mg_get_request_info(client_conn);
|
|
|
|
|
|
@@ -1738,6 +1750,12 @@ START_TEST(test_request_handlers)
|
|
ws_client3_data.data = NULL;
|
|
ws_client3_data.data = NULL;
|
|
ws_client3_data.len = 0;
|
|
ws_client3_data.len = 0;
|
|
|
|
|
|
|
|
+ /* Write long data */
|
|
|
|
+ mg_websocket_client_write(ws_client3_conn,
|
|
|
|
+ WEBSOCKET_OPCODE_BINARY,
|
|
|
|
+ long_ws_buf,
|
|
|
|
+ long_ws_buf_len);
|
|
|
|
+
|
|
/* Disconnect client 3 */
|
|
/* Disconnect client 3 */
|
|
ck_assert(ws_client3_data.closed == 0);
|
|
ck_assert(ws_client3_data.closed == 0);
|
|
mg_close_connection(ws_client3_conn);
|
|
mg_close_connection(ws_client3_conn);
|
|
@@ -3635,6 +3653,8 @@ START_TEST(test_large_file)
|
|
OPTIONS[opt_cnt++] = "8443s";
|
|
OPTIONS[opt_cnt++] = "8443s";
|
|
OPTIONS[opt_cnt++] = "ssl_certificate";
|
|
OPTIONS[opt_cnt++] = "ssl_certificate";
|
|
OPTIONS[opt_cnt++] = ssl_cert;
|
|
OPTIONS[opt_cnt++] = ssl_cert;
|
|
|
|
+ OPTIONS[opt_cnt++] = "ssl_protocol_version";
|
|
|
|
+ OPTIONS[opt_cnt++] = "4";
|
|
ck_assert(ssl_cert != NULL);
|
|
ck_assert(ssl_cert != NULL);
|
|
#endif
|
|
#endif
|
|
OPTIONS[opt_cnt] = NULL;
|
|
OPTIONS[opt_cnt] = NULL;
|