Merge from DEVEL. Assert used field not available without callback API.

This commit is contained in:
likewise 2003-11-18 01:52:24 +00:00
parent fa9b1ba947
commit a646b5374f

View File

@ -558,7 +558,7 @@ tcp_process(struct tcp_pcb *pcb)
tcp_parseopt(pcb); tcp_parseopt(pcb);
/* Call the user specified function to call when sucessfully /* Call the user specified function to call when sucessfully
connected. */ * connected. */
TCP_EVENT_CONNECTED(pcb, ERR_OK, err); TCP_EVENT_CONNECTED(pcb, ERR_OK, err);
tcp_ack(pcb); tcp_ack(pcb);
} }
@ -570,17 +570,19 @@ tcp_process(struct tcp_pcb *pcb)
TCP_SEQ_LEQ(ackno, pcb->snd_nxt)) { TCP_SEQ_LEQ(ackno, pcb->snd_nxt)) {
pcb->state = ESTABLISHED; pcb->state = ESTABLISHED;
LWIP_DEBUGF(DEMO_DEBUG, ("TCP connection established %u -> %u.\n", inseg.tcphdr->src, inseg.tcphdr->dest)); LWIP_DEBUGF(DEMO_DEBUG, ("TCP connection established %u -> %u.\n", inseg.tcphdr->src, inseg.tcphdr->dest));
#if LWIP_CALLBACK_API
LWIP_ASSERT("pcb->accept != NULL", pcb->accept != NULL); LWIP_ASSERT("pcb->accept != NULL", pcb->accept != NULL);
#endif
/* Call the accept function. */ /* Call the accept function. */
TCP_EVENT_ACCEPT(pcb, ERR_OK, err); TCP_EVENT_ACCEPT(pcb, ERR_OK, err);
if (err != ERR_OK) { if (err != ERR_OK) {
/* If the accept function returns with an error, we abort /* If the accept function returns with an error, we abort
the connection. */ * the connection. */
tcp_abort(pcb); tcp_abort(pcb);
return ERR_ABRT; return ERR_ABRT;
} }
/* If there was any data contained within this ACK, /* If there was any data contained within this ACK,
we'd better pass it on to the application as well. */ * we'd better pass it on to the application as well. */
tcp_receive(pcb); tcp_receive(pcb);
pcb->cwnd = pcb->mss; pcb->cwnd = pcb->mss;
} }