浏览代码

Fixed nginx listen() bug

Joseph Henry 10 年之前
父节点
当前提交
b96c08f35c
共有 3 个文件被更改,包括 9 次插入5 次删除
  1. 3 3
      netcon/Intercept.c
  2. 6 2
      netcon/NetconEthernetTap.cpp
  3. 二进制
      netcon/libintercept.so.1.0

+ 3 - 3
netcon/Intercept.c

@@ -740,8 +740,8 @@ int listen(LISTEN_SIG)
   memcpy(&cmd[1], &rpc_st, sizeof(struct listen_st));
   pthread_mutex_lock(&lock);
   send_command(fdret_sock, cmd);
-  err = get_retval();
+  //err = get_retval();
   pthread_mutex_unlock(&lock);
-  errno = ERR_OK;
-  return err;
+  //errno = ERR_OK;
+  return ERR_OK;
 }

+ 6 - 2
netcon/NetconEthernetTap.cpp

@@ -925,6 +925,7 @@ void NetconEthernetTap::handle_listen(PhySocket *sock, void **uptr, struct liste
 			send_return_value(conn, ERR_OK, ERR_OK);
     }
     else {
+			/*
 			fprintf(stderr, "handle_listen(): unable to allocate memory for new listening PCB\n");
 			 // FIXME: This does not have an equivalent errno value
 			 // lwip will reclaim space with a tcp_listen call since a PCB in a LISTEN
@@ -933,13 +934,16 @@ void NetconEthernetTap::handle_listen(PhySocket *sock, void **uptr, struct liste
 			 // socket, even if the reason isn't describing what really happened internally.
 			 // See: http://lwip.wikia.com/wiki/Raw/TCP
 			send_return_value(conn, -1, EBADF);
-    }
+    	*/
+		}
   }
   else {
+		/*
 		// We can't find a connection mapped to the socket fd provided
     fprintf(stderr, "handle_listen(): can't locate connection for PCB\n");
 		send_return_value(conn, -1, EBADF);
-  }
+  	*/
+	}
 }
 
 /*

二进制
netcon/libintercept.so.1.0