On Tue, 2008-12-23 at 11:00 +0800, Jun Ma wrote:
> I'm implementing a proxy server and I am using the example code to send a
> http request and receive a http response. but I found that I am losing data
> in the HttpEntity from the response.getEntity(), here is the situation:
> 
> int len1 = EntityUtils.toByteArray(response.getEntity()).lenth();
> int len2 = response.getEntity().getContentLength();
> 
> and I found that len1<len2 and when I send out the response.getEntity() to
> the client, I am losing data since the data send out in the 2nd connection
> to the client browser is of len1 length.
> 
> I am using exactly the same code as the example code of HttpComponent,
> what's wrong with my situation?
> 

There are CGI scripts out there in the wild that can generate incorrect
Content-Length header value. You may want to use a packet sniffer /
traffic analyzer to see exactly what packets get sent across the wire. 

Oleg


> Best Regards,
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to