On Fri Apr 12 13:45:28 2013, happyaron...@gmail.com wrote:
> Hi,
> 
> Can you try netcat-openbsd in Wheezy? It contains quite some fixes and
> there is something related to CRLF handling.

Good suggestion. I experimented with it (netcat-openbsd_1.105-7_powerpc)
this morning. It /may/ behave slightly differently -- hard to tell,
since timing, ARP cache and so on is involved.  But in the end, my
complaint seems to apply to Wheezy too.

Here's part of the strace for netcat-openbsd_1.105-7 being fed by the
shell script.

  poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=0, 
revents=POLLIN}])
  read(0, "foobar\nfoobar\nfoobar\nfoobar\nfoob"..., 2048) = 42
  write(3, "foobar\nfoobar\nfoobar\nfoobar\nfoob"..., 41) = 41
  write(3, "\r\n", 2)                     = 2
  poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=0, 
revents=POLLIN}])
  read(0, "foobar\n", 2048)               = 7
  write(3, "foobar", 6)                   = 6
  write(3, "\r\n", 2)                     = 2
  poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=0, 
revents=POLLIN}])
  read(0, "foobar\n", 2048)               = 7
  write(3, "foobar", 6)                   = 6
  write(3, "\r\n", 2)                     = 2
  poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}], 2, -1) = 1 ([{fd=0, 
revents=POLLIN}])
  read(0, "foobar\n", 2048)               = 7
  write(3, "foobar", 6)                   = 6
  write(3, "\r\n", 2)                     = 2
  ...

I.e. when nc has connected to the server and is ready to transmit,
at least 42 bytes (6 lines) are already waiting on stdin.  But
nc assumes it's one line and just does one LF->CRLF translation.

I suspect the same thing could happen later in the stream, except nc is
fast enough in this scenario, and stdin is consumed line by line.

BR,
/Jorgen

-- 
  // Jörgen Grahn                  | mot du jour: Daughter of Pomira  
\X/ <gr...@snipabacken.se>         |                                  


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to