lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] [lwip] tcp send problem + a problem with loopback interface


From: Ben Stragnell
Subject: [lwip-users] [lwip] tcp send problem + a problem with loopback interface
Date: Wed, 08 Jan 2003 23:02:15 -0000

This is a multi-part message in MIME format.

------=_NextPart_000_0010_01C2501C.B6C586E0
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hi,

Firstly, congratulations, Adam, on what seems to be a fantastically =
useful library.

I've encountered a couple of what I think are problems, and would be =
grateful if someone with more knowledge of lwip could comment. I should =
probably mention that I'm using the "raw" api.

First off, the loopback interface, in loopif_output(), passes packets =
straight back to loopif_input. This seems to be causing problems with =
TCP connections across the loopback interface. In the Windows port of =
version 1.4 this causes a crash - in 1.6 it seems to prevent connections =
from completing. I think the reason is that that the tcp output routine =
sends the packet, and then expects to do some more processing on the =
pcb. However, the moment that the packet is sent, the tcp input routine =
is called back, and some kind of reentrancy issue causes things to get =
trashed before the tcp output routine is able to continue. I fixed this =
issue by having the loopif driver queue the outgoing packets, and then =
later send them to netif->input in a loopif_update() routine that gets =
called from the main application loop.

Secondly, (and this is what's preventing me from making any progress)... =
when I do a tcp_write(), the data is being queued, but never sent. I'm =
calling the timers regularly, but tcp_output never seems to get called. =
Am I expected to call this manually? The httpd same code doesn't seem =
to.... I can't figure out what is supposed to trigger the actual sending =
of the data. Again, this is across the loopback interface, but it =
shouldn't matter, right?

Cheers,
Ben



------=_NextPart_000_0010_01C2501C.B6C586E0
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2719.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Firstly, congratulations, Adam,&nbsp;on =
what seems=20
to be a fantastically useful library.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've encountered a couple of what I =
think are=20
problems, and would be grateful if someone with more knowledge of lwip =
could=20
comment. I should probably mention that I'm using the "raw" =
api.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>First off, the loopback interface, in=20
loopif_output(), passes packets straight back to loopif_input. This =
seems to be=20
causing problems with TCP connections across the loopback interface. In =
the=20
Windows port of version 1.4 this causes a crash - in 1.6 it seems to =
prevent=20
connections from completing. I think the reason is that that the tcp =
output=20
routine sends the packet, and then expects to do some more processing on =
the=20
pcb. However, the moment that the packet is sent, the tcp input routine =
is=20
called back, and some kind of reentrancy issue causes things to get =
trashed=20
before the tcp output routine is able to continue. I fixed this issue by =
having=20
the loopif driver&nbsp;queue the outgoing packets, and then later send =
them to=20
netif-&gt;input in a loopif_update() routine that gets called from the =
main=20
application loop.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Secondly, (and this is what's =
preventing me from=20
making any progress)... when I do a tcp_write(), the data is being =
queued, but=20
never sent. I'm calling the timers regularly, but tcp_output never seems =
to get=20
called. Am I expected to call this manually? The httpd same code doesn't =
seem=20
to.... I can't figure out what is supposed to trigger the actual sending =
of the=20
data. Again, this is across the loopback interface, but it shouldn't =
matter,=20
right?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Cheers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Ben</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0010_01C2501C.B6C586E0--

[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]