One could/should probably use something like
the add_iacs() function against a buffer with
one extra space in it.  (Read BUFSIZ-1 sort of
thing.)  Have add_iacs() bail if it needs to
blow it up more than the existing extra space.
The problem there is recognizing the half-inflated
state of the buffer full of random garbage it
was working on.  Not attractive.  There could be,
worst-case, a 2x buffer expansion required as a
result of a single completed read().

Or use an extra state variable in the buffer for
iac_safe_write() to keep track of half-inflated
IAC's.

-- Jim



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Alain M.
Sent: Wednesday, November 12, 2008 4:10 PM
To: busybox
Subject: Re: outstanding telnetd bug fix, and two new features

I have been following this...

Why dont you just let the last byte allways empty?? So thet you will 
have a spare byte... This will surely produce a spare byte?

Just my 2c,
Alain

Cathey, Jim escreveu:
> It still looks to me like iac_safe_write()
> could emit extra FF's if the socket was nearly
> full and the first safe_write of the two FF's
> only accepted one.  The thing would break out,
> but with a zero advance of the buffer pointer,
> coming back around to do it all again.  Resulting
> in at least one extra FF in the stream at that
> point.
> 
> -- Jim
> 
> 
> 
> 
> _______________________________________________
> busybox mailing list
> [email protected]
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
> 
> 
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to