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);
} }
@ -567,22 +567,24 @@ tcp_process(struct tcp_pcb *pcb)
if (flags & TCP_ACK && if (flags & TCP_ACK &&
!(flags & TCP_RST)) { !(flags & TCP_RST)) {
if (TCP_SEQ_LT(pcb->lastack, ackno) && if (TCP_SEQ_LT(pcb->lastack, ackno) &&
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));
LWIP_ASSERT("pcb->accept != NULL", pcb->accept != NULL); #if LWIP_CALLBACK_API
/* Call the accept function. */ LWIP_ASSERT("pcb->accept != NULL", pcb->accept != NULL);
TCP_EVENT_ACCEPT(pcb, ERR_OK, err); #endif
if (err != ERR_OK) { /* Call the accept function. */
/* If the accept function returns with an error, we abort TCP_EVENT_ACCEPT(pcb, ERR_OK, err);
the connection. */ if (err != ERR_OK) {
tcp_abort(pcb); /* If the accept function returns with an error, we abort
return ERR_ABRT; * the connection. */
} tcp_abort(pcb);
/* If there was any data contained within this ACK, return ERR_ABRT;
we'd better pass it on to the application as well. */ }
tcp_receive(pcb); /* If there was any data contained within this ACK,
pcb->cwnd = pcb->mss; * we'd better pass it on to the application as well. */
tcp_receive(pcb);
pcb->cwnd = pcb->mss;
} }
} }
break; break;