I can't handle HTTP Response with Wrong Content-Length header(larger than real entity length)

Ryuta IWAI soupcurry at 1km.jp
Sun May 8 10:12:56 EDT 2011


Hi, All.

I'm attempting to write NIO proxy server that like a littleproxy with Netty.

But I can't handle some HTTP Response that Amazon.co.jp associate.
Its response contains Wrong Content-Length header(larger than real entity
length) (links below)
and Wrong Content-Length header value is less than maxChunkSize(default
8192).

Its sequence:
* write request to remote host
* read response from remote host
* wait for reading entity_size = Content-Length or entity_size >
maxChunkSize
* (!!no execution!!) fire myhandler::messageReceived 
* close connction (If Connection hedaer is "close")


REFERENCE LINKS:
  
http://rcm-jp.amazon.co.jp/e/cm?t=wwwsutosoftco-22&o=9&p=13&l=op1&pvid=F6CFB74BD3B0D91A&ref-url=http%3A//www.sutosoft.com/room/archives/000323.html&ref-title=MASATO%u306E%u958B%u767A%u65E5%u8A18%3A%20Amazon%u304A%u307E%u304B%u305B%u30EA%u30F3%u30AF&ref-ref=http%3A//bugs.kde.org/show_bug.cgi%3Fid%3D143217&bgc=FFFFFF&bdc=000000&pcc=990000&tec=000000&tic=3399FF&ac=CC6600&pvc=6E6E6E&lgl=1&hl=1&dsc=1&f=ifr&e=utf-8
http://rcm-jp.amazon.co.jp/e/cm?t=wwwsutosoftco-22&o=9&p=13&l=op1&pvid=F6CFB74BD3B0D91A&ref-url=http%3A//www.sutosoft.com/room/archives/000323.html&ref-title=MASATO%u306E%u958B%u767A%u65E5%u8A18%3A%20Amazon%u304A%u307E%u304B%u305B%u30EA%u30F3%u30AF&ref-ref=http%3A//bugs.kde.org/show_bug.cgi%3Fid%3D143217&bgc=FFFFFF&bdc=000000&pcc=990000&tec=000000&tic=3399FF&ac=CC6600&pvc=6E6E6E&lgl=1&hl=1&dsc=1&f=ifr&e=utf-8 
  
http://rcm-jp.amazon.co.jp//e/cm?t=yanzm-22&o=9&p=8&l=as1&asins=4798027049&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=6699cc&bc1=EEEEEE&bg1=EEEEEE&f=ifr
http://rcm-jp.amazon.co.jp//e/cm?t=yanzm-22&o=9&p=8&l=as1&asins=4798027049&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=6699cc&bc1=EEEEEE&bg1=EEEEEE&f=ifr 

Finally, I expect that HTTPMessageDecoder fires myhandler before closing, if
wrong Content-Length header was containd.

Netty version:            3.2.4.Final

Thanks, 
Ryuta

--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/I-can-t-handle-HTTP-Response-with-Wrong-Content-Length-header-larger-than-real-entity-length-tp6341939p6341939.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list