slightly rearranged freeing an acked segment to prevent keeping the reference too long

This commit is contained in:
Simon Goldschmidt 2011-10-11 21:41:58 +02:00 committed by goldsimon
parent a0bd27053d
commit de4a51e96e

View File

@ -683,6 +683,7 @@ tcp_process(struct tcp_pcb *pcb)
LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %"U16_F"\n", (u16_t)pcb->snd_queuelen));
rseg = pcb->unacked;
pcb->unacked = rseg->next;
tcp_seg_free(rseg);
/* If there's nothing left to acknowledge, stop the retransmit
timer, otherwise reset it to start again */
@ -693,8 +694,6 @@ tcp_process(struct tcp_pcb *pcb)
pcb->nrtx = 0;
}
tcp_seg_free(rseg);
/* Call the user specified function to call when sucessfully
* connected. */
TCP_EVENT_CONNECTED(pcb, ERR_OK, err);