|
@@ -1638,7 +1638,7 @@ static int alloc_vprintf2(char **buf, const char *fmt, va_list ap) {
|
|
*buf = NULL;
|
|
*buf = NULL;
|
|
while (len == -1) {
|
|
while (len == -1) {
|
|
if (*buf) free(*buf);
|
|
if (*buf) free(*buf);
|
|
- *buf = malloc(size *= 4);
|
|
|
|
|
|
+ *buf = (char *)malloc(size *= 4);
|
|
if (!*buf) break;
|
|
if (!*buf) break;
|
|
va_copy(ap_copy, ap);
|
|
va_copy(ap_copy, ap);
|
|
len = vsnprintf(*buf, size, fmt, ap_copy);
|
|
len = vsnprintf(*buf, size, fmt, ap_copy);
|
|
@@ -3674,6 +3674,14 @@ static void handle_propfind(struct mg_connection *conn, const char *path,
|
|
conn->num_bytes_sent += mg_printf(conn, "%s\n", "</d:multistatus>");
|
|
conn->num_bytes_sent += mg_printf(conn, "%s\n", "</d:multistatus>");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void mg_lock(struct mg_connection* conn) {
|
|
|
|
+ (void) pthread_mutex_lock(&conn->mutex);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void mg_unlock(struct mg_connection* conn) {
|
|
|
|
+ (void) pthread_mutex_unlock(&conn->mutex);
|
|
|
|
+}
|
|
|
|
+
|
|
#if defined(USE_WEBSOCKET)
|
|
#if defined(USE_WEBSOCKET)
|
|
|
|
|
|
// START OF SHA-1 code
|
|
// START OF SHA-1 code
|
|
@@ -3851,14 +3859,6 @@ static void send_websocket_handshake(struct mg_connection *conn) {
|
|
"Sec-WebSocket-Accept: ", b64_sha, "\r\n\r\n");
|
|
"Sec-WebSocket-Accept: ", b64_sha, "\r\n\r\n");
|
|
}
|
|
}
|
|
|
|
|
|
-void mg_lock(struct mg_connection* conn) {
|
|
|
|
- (void) pthread_mutex_lock(&conn->mutex);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-void mg_unlock(struct mg_connection* conn) {
|
|
|
|
- (void) pthread_mutex_unlock(&conn->mutex);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void read_websocket(struct mg_connection *conn) {
|
|
static void read_websocket(struct mg_connection *conn) {
|
|
// Pointer to the beginning of the portion of the incoming websocket message queue.
|
|
// Pointer to the beginning of the portion of the incoming websocket message queue.
|
|
// The original websocket upgrade request is never removed, so the queue begins after it.
|
|
// The original websocket upgrade request is never removed, so the queue begins after it.
|