summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/lwipopts.h2
-rw-r--r--netcon/NetconEthernetTap.cpp10
2 files changed, 8 insertions, 4 deletions
diff --git a/ext/lwipopts.h b/ext/lwipopts.h
index e7b78a8f..597fee50 100644
--- a/ext/lwipopts.h
+++ b/ext/lwipopts.h
@@ -48,6 +48,8 @@
//#define TCP_MSS 2048
//#define TCP_WND 512
+#define TCP_LISTEN_BACKLOG 1
+
/*------------------------------------------------------------------------------
---------------------------------- Timers --------------------------------------
------------------------------------------------------------------------------*/
diff --git a/netcon/NetconEthernetTap.cpp b/netcon/NetconEthernetTap.cpp
index 9aa9def0..8ca6d6ab 100644
--- a/netcon/NetconEthernetTap.cpp
+++ b/netcon/NetconEthernetTap.cpp
@@ -542,7 +542,6 @@ err_t NetconEthernetTap::nc_accept(void *arg, struct tcp_pcb *newpcb, err_t err)
tap->tcp_connections.push_back(new_tcp_conn);
int send_fd = tap->_phy.getDescriptor(conn->rpcSock);
-
int n = write(larg_fd, "z", 1); // accept() in library waits for this byte
if(n > 0) {
if(sock_fd_write(send_fd, fds[1]) > 0) {
@@ -905,10 +904,14 @@ void NetconEthernetTap::handle_listen(PhySocket *sock, void **uptr, struct liste
return;
}
- // TODO: Implement liste_with_backlog
+ struct tcp_pcb* listening_pcb;
+ if(listen_rpc->backlog > 0)
+ listening_pcb = lwipstack->tcp_listen_with_backlog(conn->pcb, listen_rpc->backlog);
+ else
+ listening_pcb = lwipstack->tcp_listen(conn->pcb);
+
// FIXME: Correct return values from this method, most is handled in intercept lib
- struct tcp_pcb* listening_pcb = lwipstack->tcp_listen(conn->pcb);
if(listening_pcb != NULL) {
conn->pcb = listening_pcb;
lwipstack->tcp_accept(listening_pcb, nc_accept);
@@ -1092,7 +1095,6 @@ void NetconEthernetTap::handle_write(TcpConnection *conn)
}
if(conn->idx < max) {
int sndbuf = conn->pcb->snd_buf; // How much we are currently allowed to write to the connection
-
/* PCB send buffer is full,turn off readability notifications for the
corresponding PhySocket until nc_sent() is called and confirms that there is
now space on the buffer */