hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jun Ma" <mjni...@gmail.com>
Subject Losing data in HttpResponse
Date Tue, 23 Dec 2008 03:00:29 GMT
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?

Best Regards,

Jun Ma
Shanghai Jiao Tong University
Mobile: +86 13918713028
Email: mjnicky@gmail.com
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message