summaryrefslogtreecommitdiff
path: root/netcon/NetconEthernetTap.cpp
diff options
context:
space:
mode:
authorJoseph Henry <josephjah@gmail.com>2015-12-21 07:17:37 -0800
committerJoseph Henry <josephjah@gmail.com>2015-12-21 07:17:37 -0800
commit4267cc138e0cb857949290b7e07cbb54a246996d (patch)
treea7ddd020fe4cf5b3ea5eb4e018e35d7c317b8c08 /netcon/NetconEthernetTap.cpp
parentde2ba8d0f755c3b5c41b838d0af3643f4f334391 (diff)
downloadinfinitytier-4267cc138e0cb857949290b7e07cbb54a246996d.tar.gz
infinitytier-4267cc138e0cb857949290b7e07cbb54a246996d.zip
Readme changes, turned off debug
Diffstat (limited to 'netcon/NetconEthernetTap.cpp')
-rw-r--r--netcon/NetconEthernetTap.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/netcon/NetconEthernetTap.cpp b/netcon/NetconEthernetTap.cpp
index 9dd888ba..59c021e1 100644
--- a/netcon/NetconEthernetTap.cpp
+++ b/netcon/NetconEthernetTap.cpp
@@ -440,16 +440,9 @@ void NetconEthernetTap::die(int exret) {
*/
void NetconEthernetTap::closeConnection(TcpConnection *conn)
{
- //return;
- //dwr(MSG_DEBUG, "closeConnection(): conn = 0x%x\n", conn);
if(!conn)
return;
dwr(MSG_DEBUG, " closeConnection(%x, %d)\n", conn->pcb, _phy.getDescriptor(conn->dataSock));
- //lwipstack->_tcp_sent(conn->pcb, NULL);
- //lwipstack->_tcp_recv(conn->pcb, NULL);
- //lwipstack->_tcp_err(conn->pcb, NULL);
- //lwipstack->_tcp_poll(conn->pcb, NULL, 0);
- //lwipstack->_tcp_arg(conn->pcb, NULL);
if(lwipstack->_tcp_close(conn->pcb) != ERR_OK) {
dwr(MSG_ERROR, " closeConnection(): Error while calling tcp_close()\n");
exit(0);
@@ -876,7 +869,7 @@ err_t NetconEthernetTap::nc_recved(void *arg, struct tcp_pcb *tpcb, struct pbuf
if(!l->conn) {
dwr(MSG_ERROR, " nc_recved(): no connection object\n");
- return ERR_OK; // ?
+ return ERR_OK;
}
if(p == NULL) {
if(l->conn && !l->conn->listening) {
@@ -892,7 +885,7 @@ err_t NetconEthernetTap::nc_recved(void *arg, struct tcp_pcb *tpcb, struct pbuf
q = p;
while(p != NULL) { // Cycle through pbufs and write them to the socket
if(p->len <= 0)
- break; // ?
+ break;
if((n = l->tap->_phy.streamSend(l->conn->dataSock,p->payload, p->len)) > 0) {
if(n < p->len) {
dwr(MSG_INFO, " nc_recved(): unable to write entire pbuf to buffer\n");
@@ -993,7 +986,7 @@ void NetconEthernetTap::nc_err(void *arg, err_t err)
break;
}
dwr(MSG_ERROR, "nc_err(): closing connection\n");
- l->tap->closeConnection(l->conn);
+ l->tap->closeConnection(l->conn);
}
/*
@@ -1024,12 +1017,9 @@ err_t NetconEthernetTap::nc_poll(void* arg, struct tcp_pcb *tpcb)
*/
err_t NetconEthernetTap::nc_sent(void* arg, struct tcp_pcb *tpcb, u16_t len)
{
- //dwr(5, " nc_sent()\n");
Larg *l = (Larg*)arg;
if(len) {
l->conn->acked+=len;
- //dwr("W = %d, A = %d\n", l->conn->written, l->conn->acked);
- //dwr("ACK = %d\n", len);
l->tap->_phy.setNotifyReadable(l->conn->dataSock, true);
l->tap->_phy.whack();
}