Jonathan Larmour wrote:
Kelvin Lawson wrote:
I use lwip in a embedded system, one time I have got this the
following message:
"tcp_enqueue: no pbufs on queue => both queues empty"
Exactly on this line:
LWIP_ASSERT("tcp_enqueue: no pbufs on queue => both queues empty",
pcb->unacked == NULL && pcb->unsent == NULL);
I had this problem recently, and it was down to my setting for
TCP_SND_QUEUELEN. This must be less than 256, because the data type
used for storing the queue length (snd_queuelen) is 8 bits. Any
larger and the snd_queuelen counter will overflow.
Any developer care to make the obvious quick change? It's probably
more effort overall for a developer if I submitted a patch rather than
to just to do it:
#if (TCP_SND_QUEUELEN > 255)
u16_t
#else
u8_t
#endif
snd_queuelen; /* Available buffer space for sending (in tcp_segs). */
and ditto for queuelen in tcp_enqueue() in tcp_out.c.
I'd prefer to see it typedefed in one place, and the typedef used in the
other.
And if TCP_SND_QUEUELEN bigger than 65535 doesn't make sense, add:
#if (TCP_SND_QUEUELEN > 65535)
# error "some error message."
#enidf
But if you prefer I can submit this as a patch.
Jifl
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users