View Full Version : content-ength difference
emihaly
04-13-2003, 09:03 PM
i have http proxy. i detect content-length with range in bytes and try full messages = header + cnt_length, but in yahoo.com mail i must icrease cnt-length by 2 becose it put \r\n, which is not counted in cont-length. when i login to this forum, and fill anme password, content length block is not terminated by \r\n!! Its chaos! when is header + cnt-length terminated by \r\n a nd when not?
mlampkin
04-14-2003, 04:21 AM
Well... thats part of the problem with the world these days... people cannot seem to read and (correctly) implement even the easiest standards...
So yes... some systems will tag on an extra /r or /r/n or /n or /n/r even after the data... actually giving you a byte or two (or) more data than indicated by the content length... its easy enough to work around all those bad implementations out there though... simply read the content length number of bytes... and then continue reading (and throwing out) any data that you see before a normal character (up to a reasonable limit of course - otherwise someone could start sending \r\n's and hold your connection "captive" forever)...
Michael
emihaly
04-14-2003, 06:46 AM
thanx michael, i mean, 50 percent of well proxy is standard rfc implementation and 50 percent is protect from all non rfc actions :(
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.