Преглед изворни кода

casted argument from sizeof to socklen_t

Saumitra Vikram пре 8 година
родитељ
комит
87e8499b9e
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/civetweb.c

+ 2 - 2
src/civetweb.c

@@ -11915,8 +11915,8 @@ close_socket_gracefully(struct mg_connection *conn)
 	 * ephemeral port exhaust problem under high QPS. */
 	 * ephemeral port exhaust problem under high QPS. */
 	linger.l_onoff = 1;
 	linger.l_onoff = 1;
 	linger.l_linger = 1;
 	linger.l_linger = 1;
-	int error_code=0;
-	getsockopt(conn->client.sock, SOL_SOCKET, SO_ERROR, &error_code, sizeof(error_code));
+	socklen_t error_code=0;
+	getsockopt(conn->client.sock, SOL_SOCKET, SO_ERROR, &error_code, (socklen_t *)sizeof(error_code));
 	if (error_code==ECONNRESET) {
 	if (error_code==ECONNRESET) {
 		/* Socket already closed by client/peer, close socket without linger */
 		/* Socket already closed by client/peer, close socket without linger */
 	}
 	}