home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 13,175 of 14,669   
   Jorgen Grahn to mockturtle   
   Re: Funny problem with TCP: 1 char per p   
   12 Nov 09 22:21:21   
   
   ca42d6a1   
   From: grahn+nntp@snipabacken.se   
      
   On Thu, 2009-11-12, mockturtle wrote:   
   >   
   >   
   > glen herrmannsfeldt ha scritto:   
   >> mockturtle  wrote:   
   >>   
   >> > I have a program that communicates with an HTTP server (lighttpd) [it   
   >> > is not an HTTP issue, stay with me...].  Both server and client run on   
   >> > the same PC and talk via 127.0.0.1. On my home computer everything   
   >> > goes fine, but when I run them (the server and the client) on my   
   >> > office computer the  server closes the connection as soon as it sees   
   >> > the double CRLF at the end of the query.  By looking at the traffic   
   >> > with wireshark and/or tcpdump I can see that on my office computer my   
   >> > client is sending the 1 char per packet, that is the request (say)   
   >> > "GET /index.html ..." is being sent   
   >>   
   >> > "G"   
   >> > "E"   
   >> > "T"   
   >> > " "   
   >> > "/"   
   >>   
   >> > ... and so on...  I guess that the server should not care (my client   
   >> > can distribute the data in the packets as it wishes), but I suspect   
   >> > that this extreme fragmentation can "confuse" it.   
   >>   
   >> TCP is a stream protocol.   
   >>   
   >> If that confuses it, then it is a bug in the receiver.   
   >>   
   >   
   > I agree, but   
   >   
   >   1) I need to make it work (it is just for testing purposes and not   
   > for production, so it does not   
   > matter if the whole system is a little brittle, as long as I am able   
   > to do my tests...)   
   >   
   >   2) it seem quite curious a behaviour to me, and I would like to   
   > understand it better :-)   
      
   You could use those Ruby scripts to test this assumption (which AFAICT   
   isn't disproven elsewhere in the thread):   
      
     Assumption: there is a bug in lighttpd which makes it freak out when   
     it reads a partial GET line (maybe specifically when it gets to see   
     the CR but not in the same read() the LF).   
      
   It's not that unlikely; I myself maintain code with such bugs. And if   
   you manage to work around the one-octet segment issue, it can still   
   happen now and then -- maybe once a month when you least expect it ...   
      
   It's easy to write a tiny Ruby program to test that. You can sleep for   
   5 s or something before the LF and the rest of the request.   
   If that exposes a bug, file a bug report and switch to another server.   
      
   (I might be wrong, but I seem to recall that lighttpd often appears in   
   the Debian Linux security updates.  If it has repeated security   
   issues, that indicates it's shoddily written in general ...)   
      
   /Jorgen   
      
   --   
     // Jorgen Grahn    O  o   .   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca