Again: Fixed bug #26672 (close connection when receive window = 0) by correctly draining recvmbox/acceptmbox

This commit is contained in:
goldsimon
2010-01-13 15:59:47 +00:00
parent 6df94d3c76
commit 0e38a52edc
4 changed files with 16 additions and 74 deletions

View File

@@ -103,24 +103,12 @@ err_t
netconn_delete(struct netconn *conn)
{
struct api_msg msg;
u32_t bytes_drained;
u16_t conns_drained;
/* No ASSERT here because possible to get a (conn == NULL) if we got an accept error */
if (conn == NULL) {
return ERR_OK;
}
netconn_drain(conn, &bytes_drained, &conns_drained);
LWIP_ASSERT("Connection had recv-bytes and unaccepted connections pending -> mixed",
bytes_drained == 0 || conns_drained == 0);
if (conns_drained != 0) {
msg.msg.msg.dc.drained = conns_drained | DELCONN_UNDRAINED_CONN;
} else {
LWIP_ASSERT("Too many bytes undrained", (bytes_drained & DELCONN_UNDRAINED_CONN) == 0);
msg.msg.msg.dc.drained = bytes_drained;
}
msg.function = do_delconn;
msg.msg.conn = conn;
tcpip_apimsg(&msg);