소스 검색

Restructure is_websocket_request (Step 4/4)

bel 9 년 전
부모
커밋
077fe37303
1개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 6
      src/civetweb.c

+ 3 - 6
src/civetweb.c

@@ -8637,11 +8637,8 @@ handle_websocket_request(struct mg_connection *conn,
 		return;
 	}
 
-	/* Step 1.3: Check Host. */
-	const char *host = mg_get_header(conn, "Host");
-	if (!host) {
-		return 0;
-	}
+	/* Step 1.3: Could check for "Host", but we do not really nead this
+	 * value for anything, so just ignore it. */
 
 	/* Step 2: If a callback is responsible, call it. */
 	if (is_callback_resource) {
@@ -8727,7 +8724,7 @@ handle_websocket_request(struct mg_connection *conn,
 static int
 is_websocket_protocol(const struct mg_connection *conn)
 {
-	const char *host, *upgrade, *connection, *version, *key;
+	const char *upgrade, *connection;
 
 	/* A websocket protocoll has the following HTTP headers:
 	 *