You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "John B. Hansen (JIRA)" <ji...@apache.org> on 2010/11/17 23:27:20 UTC

[jira] Created: (HTTPCORE-241) "Socket Exception: Bad file number" when passing chunked entity back to response

"Socket Exception: Bad file number" when passing chunked entity back to response
--------------------------------------------------------------------------------

                 Key: HTTPCORE-241
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-241
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore
         Environment: Android Froyo 2.2 (FRF50)
Running as Root on a Nexus One
I think Android Froyo is running HttpCore 4.0 but not sure. I tried to dump VersionInfo on several packages but didn't get any info returned.
            Reporter: John B. Hansen


I'm a new user with HttpCore and didn't know where else to turn for support.. And, this problem may be my fault...
Just looking for some suggestions...

I'm doing a ProxyServer by using a variation of ElementalHttpServer  to send a request to proxy code.
The proxy code then makes an actual client request to the target site. The proxy request gets a response
back and sets the statusline, headers, and entity back in the original response in the  handler  (which sends
 it back to the Browser).

For simple HTML sites, this works fine. But, on chunked sites (transfer-encoding=chunked) e.g. www.google.com 
I'm getting a "Socket Exception: Bad File Number" following the first response back to the browser i.e.

11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is CHUNKED
11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is STREAMING
11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): ======================= Done Handling Request-Response =======================
11-17 13:48:05.317: ERROR/MTHttpProxy:(2767): ERROR: I/O error from call to handle request: Bad file number
11-17 13:48:05.317: WARN/System.err(2767): java.net.SocketException: Bad file number
11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.readSocketImpl(Native Method)
11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.read(OSNetworkSystem.java:358)
11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:561)
11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:88)
11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)
11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:161)
11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:175)
11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.entity.BasicHttpEntity.writeTo(BasicHttpEntity.java:129)
11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:97)
11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.AbstractHttpServerConnection.sendResponseEntity(AbstractHttpServerConnection.java:182)
11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:209)
11-17 13:48:05.337: WARN/System.err(2767):     at com.test.MultiHttpProxy$WorkerThread.run(MultiHttpProxy.java:446)

BTW: I have no reason to suspect bugs in the Chunk handling. I'm just not seeing this on the few non-chunked sites I've tested.

Any ideas what could be wrong or how to debug? Any advice appreciated....Thanks!

PS, if anyone can clarify the version of HttpComponents on Android 2.2 also, that would be great. Thx.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Resolved: (HTTPCORE-241) "Socket Exception: Bad file number" when passing chunked entity back to response

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCORE-241.
----------------------------------------

    Resolution: Cannot Reproduce

> "Socket Exception: Bad file number" when passing chunked entity back to response
> --------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-241
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-241
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>         Environment: Android Froyo 2.2 (FRF50)
> Running as Root on a Nexus One
> I think Android Froyo is running HttpCore 4.0 but not sure. I tried to dump VersionInfo on several packages but didn't get any info returned.
>            Reporter: John B. Hansen
>
> I'm a new user with HttpCore and didn't know where else to turn for support.. And, this problem may be my fault...
> Just looking for some suggestions...
> I'm doing a ProxyServer by using a variation of ElementalHttpServer  to send a request to proxy code.
> The proxy code then makes an actual client request to the target site. The proxy request gets a response
> back and sets the statusline, headers, and entity back in the original response in the  handler  (which sends
>  it back to the Browser).
> For simple HTML sites, this works fine. But, on chunked sites (transfer-encoding=chunked) e.g. www.google.com 
> I'm getting a "Socket Exception: Bad File Number" following the first response back to the browser i.e.
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is CHUNKED
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is STREAMING
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): ======================= Done Handling Request-Response =======================
> 11-17 13:48:05.317: ERROR/MTHttpProxy:(2767): ERROR: I/O error from call to handle request: Bad file number
> 11-17 13:48:05.317: WARN/System.err(2767): java.net.SocketException: Bad file number
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.readSocketImpl(Native Method)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.read(OSNetworkSystem.java:358)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:561)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:88)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:161)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:175)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.entity.BasicHttpEntity.writeTo(BasicHttpEntity.java:129)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:97)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.AbstractHttpServerConnection.sendResponseEntity(AbstractHttpServerConnection.java:182)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:209)
> 11-17 13:48:05.337: WARN/System.err(2767):     at com.test.MultiHttpProxy$WorkerThread.run(MultiHttpProxy.java:446)
> BTW: I have no reason to suspect bugs in the Chunk handling. I'm just not seeing this on the few non-chunked sites I've tested.
> Any ideas what could be wrong or how to debug? Any advice appreciated....Thanks!
> PS, if anyone can clarify the version of HttpComponents on Android 2.2 also, that would be great. Thx.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-241) "Socket Exception: Bad file number" when passing chunked entity back to response

Posted by "John B. Hansen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935431#action_12935431 ] 

John B. Hansen commented on HTTPCORE-241:
-----------------------------------------

Oleg, thanks again for your support.

I'm leaning towards porting and using the latest and greatest 4.1 (GA) in my
Android App and urging Google team to support it going forward.

I'm thinking that will insulate me from changes on their side if I cannot
persuade them to upgrade the HttpCore support in Android.

Thanks again!

jh

On Wed, Nov 24, 2010 at 6:10 AM, Oleg Kalnichevski (JIRA)



> "Socket Exception: Bad file number" when passing chunked entity back to response
> --------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-241
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-241
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>         Environment: Android Froyo 2.2 (FRF50)
> Running as Root on a Nexus One
> I think Android Froyo is running HttpCore 4.0 but not sure. I tried to dump VersionInfo on several packages but didn't get any info returned.
>            Reporter: John B. Hansen
>
> I'm a new user with HttpCore and didn't know where else to turn for support.. And, this problem may be my fault...
> Just looking for some suggestions...
> I'm doing a ProxyServer by using a variation of ElementalHttpServer  to send a request to proxy code.
> The proxy code then makes an actual client request to the target site. The proxy request gets a response
> back and sets the statusline, headers, and entity back in the original response in the  handler  (which sends
>  it back to the Browser).
> For simple HTML sites, this works fine. But, on chunked sites (transfer-encoding=chunked) e.g. www.google.com 
> I'm getting a "Socket Exception: Bad File Number" following the first response back to the browser i.e.
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is CHUNKED
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is STREAMING
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): ======================= Done Handling Request-Response =======================
> 11-17 13:48:05.317: ERROR/MTHttpProxy:(2767): ERROR: I/O error from call to handle request: Bad file number
> 11-17 13:48:05.317: WARN/System.err(2767): java.net.SocketException: Bad file number
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.readSocketImpl(Native Method)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.read(OSNetworkSystem.java:358)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:561)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:88)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:161)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:175)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.entity.BasicHttpEntity.writeTo(BasicHttpEntity.java:129)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:97)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.AbstractHttpServerConnection.sendResponseEntity(AbstractHttpServerConnection.java:182)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:209)
> 11-17 13:48:05.337: WARN/System.err(2767):     at com.test.MultiHttpProxy$WorkerThread.run(MultiHttpProxy.java:446)
> BTW: I have no reason to suspect bugs in the Chunk handling. I'm just not seeing this on the few non-chunked sites I've tested.
> Any ideas what could be wrong or how to debug? Any advice appreciated....Thanks!
> PS, if anyone can clarify the version of HttpComponents on Android 2.2 also, that would be great. Thx.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-241) "Socket Exception: Bad file number" when passing chunked entity back to response

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933218#action_12933218 ] 

Oleg Kalnichevski commented on HTTPCORE-241:
--------------------------------------------

John,

Android ships with HttpCore 4.0-beta2, which is a fairly outdated. My recommendation would be to get your proxy working in the JSE environment with the latest Oracle's JRE (>1.6.0.21) and the latest release of HttpCore (4.1) and then port it to Android, once sure the HTTP protocol code works as intended. 

If you could reproduce the problem in the JSE environment with the latest HttpCore version, I'd be much easier to get it resolved.

There is a sample of a trivial reverse proxy [1] which you may want to take a look at. When testing the sample (which admittedly was a while ago) I had no issue with chunk coding.

Oleg

[1] http://svn.apache.org/repos/asf/httpcomponents/httpcore/tags/4.1/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java

> "Socket Exception: Bad file number" when passing chunked entity back to response
> --------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-241
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-241
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>         Environment: Android Froyo 2.2 (FRF50)
> Running as Root on a Nexus One
> I think Android Froyo is running HttpCore 4.0 but not sure. I tried to dump VersionInfo on several packages but didn't get any info returned.
>            Reporter: John B. Hansen
>
> I'm a new user with HttpCore and didn't know where else to turn for support.. And, this problem may be my fault...
> Just looking for some suggestions...
> I'm doing a ProxyServer by using a variation of ElementalHttpServer  to send a request to proxy code.
> The proxy code then makes an actual client request to the target site. The proxy request gets a response
> back and sets the statusline, headers, and entity back in the original response in the  handler  (which sends
>  it back to the Browser).
> For simple HTML sites, this works fine. But, on chunked sites (transfer-encoding=chunked) e.g. www.google.com 
> I'm getting a "Socket Exception: Bad File Number" following the first response back to the browser i.e.
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is CHUNKED
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is STREAMING
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): ======================= Done Handling Request-Response =======================
> 11-17 13:48:05.317: ERROR/MTHttpProxy:(2767): ERROR: I/O error from call to handle request: Bad file number
> 11-17 13:48:05.317: WARN/System.err(2767): java.net.SocketException: Bad file number
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.readSocketImpl(Native Method)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.read(OSNetworkSystem.java:358)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:561)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:88)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:161)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:175)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.entity.BasicHttpEntity.writeTo(BasicHttpEntity.java:129)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:97)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.AbstractHttpServerConnection.sendResponseEntity(AbstractHttpServerConnection.java:182)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:209)
> 11-17 13:48:05.337: WARN/System.err(2767):     at com.test.MultiHttpProxy$WorkerThread.run(MultiHttpProxy.java:446)
> BTW: I have no reason to suspect bugs in the Chunk handling. I'm just not seeing this on the few non-chunked sites I've tested.
> Any ideas what could be wrong or how to debug? Any advice appreciated....Thanks!
> PS, if anyone can clarify the version of HttpComponents on Android 2.2 also, that would be great. Thx.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-241) "Socket Exception: Bad file number" when passing chunked entity back to response

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935329#action_12935329 ] 

Oleg Kalnichevski commented on HTTPCORE-241:
--------------------------------------------

>   - ImmutableHttpProcessor references (change back to BasicHttpProcessor?)

Correct

>   - SyncBasicHttpParams references (change back to BasicHttpParams?)

Correct

>   - HttpService constructor has a few more params?

Those extra dependencies can also be injected with setters (deprecated in 4.1)

> (I'm assuming that is possible and simple)?

I _believe_ one can ship a newer version of HttpCore bundled with the application. The app class loader _should_ pick up newer classes from the app classpath.

> P.S. Do you have any insight into the HttpComponents version that Google
> will use on upcoming versions of Android?

I certainly cannot speak for Google but I can say that, sadly, the situation is a mess. Google's semi-official take on the situation can be found here [1]. Basically HttpCore/HttpClient are not a priority for them. At some point they are likely to end up removing HttpClient from the core Android platform. You may still want to raise an issue with Android project and kindly ask them to consider upgrading.

Cheers

Oleg

[1] http://markmail.org/message/xjctrn76m3pu44uz

> "Socket Exception: Bad file number" when passing chunked entity back to response
> --------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-241
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-241
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>         Environment: Android Froyo 2.2 (FRF50)
> Running as Root on a Nexus One
> I think Android Froyo is running HttpCore 4.0 but not sure. I tried to dump VersionInfo on several packages but didn't get any info returned.
>            Reporter: John B. Hansen
>
> I'm a new user with HttpCore and didn't know where else to turn for support.. And, this problem may be my fault...
> Just looking for some suggestions...
> I'm doing a ProxyServer by using a variation of ElementalHttpServer  to send a request to proxy code.
> The proxy code then makes an actual client request to the target site. The proxy request gets a response
> back and sets the statusline, headers, and entity back in the original response in the  handler  (which sends
>  it back to the Browser).
> For simple HTML sites, this works fine. But, on chunked sites (transfer-encoding=chunked) e.g. www.google.com 
> I'm getting a "Socket Exception: Bad File Number" following the first response back to the browser i.e.
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is CHUNKED
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is STREAMING
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): ======================= Done Handling Request-Response =======================
> 11-17 13:48:05.317: ERROR/MTHttpProxy:(2767): ERROR: I/O error from call to handle request: Bad file number
> 11-17 13:48:05.317: WARN/System.err(2767): java.net.SocketException: Bad file number
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.readSocketImpl(Native Method)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.read(OSNetworkSystem.java:358)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:561)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:88)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:161)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:175)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.entity.BasicHttpEntity.writeTo(BasicHttpEntity.java:129)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:97)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.AbstractHttpServerConnection.sendResponseEntity(AbstractHttpServerConnection.java:182)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:209)
> 11-17 13:48:05.337: WARN/System.err(2767):     at com.test.MultiHttpProxy$WorkerThread.run(MultiHttpProxy.java:446)
> BTW: I have no reason to suspect bugs in the Chunk handling. I'm just not seeing this on the few non-chunked sites I've tested.
> Any ideas what could be wrong or how to debug? Any advice appreciated....Thanks!
> PS, if anyone can clarify the version of HttpComponents on Android 2.2 also, that would be great. Thx.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-241) "Socket Exception: Bad file number" when passing chunked entity back to response

Posted by "John B. Hansen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933225#action_12933225 ] 

John B. Hansen commented on HTTPCORE-241:
-----------------------------------------

Oleg, Thanks for the incredibly quick response!

I will try your suggestions and respond back with more detail if I can.
Thanks again!

jh


On Wed, Nov 17, 2010 at 2:45 PM, Oleg Kalnichevski (JIRA)



> "Socket Exception: Bad file number" when passing chunked entity back to response
> --------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-241
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-241
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>         Environment: Android Froyo 2.2 (FRF50)
> Running as Root on a Nexus One
> I think Android Froyo is running HttpCore 4.0 but not sure. I tried to dump VersionInfo on several packages but didn't get any info returned.
>            Reporter: John B. Hansen
>
> I'm a new user with HttpCore and didn't know where else to turn for support.. And, this problem may be my fault...
> Just looking for some suggestions...
> I'm doing a ProxyServer by using a variation of ElementalHttpServer  to send a request to proxy code.
> The proxy code then makes an actual client request to the target site. The proxy request gets a response
> back and sets the statusline, headers, and entity back in the original response in the  handler  (which sends
>  it back to the Browser).
> For simple HTML sites, this works fine. But, on chunked sites (transfer-encoding=chunked) e.g. www.google.com 
> I'm getting a "Socket Exception: Bad File Number" following the first response back to the browser i.e.
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is CHUNKED
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is STREAMING
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): ======================= Done Handling Request-Response =======================
> 11-17 13:48:05.317: ERROR/MTHttpProxy:(2767): ERROR: I/O error from call to handle request: Bad file number
> 11-17 13:48:05.317: WARN/System.err(2767): java.net.SocketException: Bad file number
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.readSocketImpl(Native Method)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.read(OSNetworkSystem.java:358)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:561)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:88)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:161)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:175)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.entity.BasicHttpEntity.writeTo(BasicHttpEntity.java:129)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:97)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.AbstractHttpServerConnection.sendResponseEntity(AbstractHttpServerConnection.java:182)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:209)
> 11-17 13:48:05.337: WARN/System.err(2767):     at com.test.MultiHttpProxy$WorkerThread.run(MultiHttpProxy.java:446)
> BTW: I have no reason to suspect bugs in the Chunk handling. I'm just not seeing this on the few non-chunked sites I've tested.
> Any ideas what could be wrong or how to debug? Any advice appreciated....Thanks!
> PS, if anyone can clarify the version of HttpComponents on Android 2.2 also, that would be great. Thx.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-241) "Socket Exception: Bad file number" when passing chunked entity back to response

Posted by "John B. Hansen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935158#action_12935158 ] 

John B. Hansen commented on HTTPCORE-241:
-----------------------------------------

Hi Oleg,

  I took your advice and downloaded 4.1 on the desktop and worked on a fresh
build environment using J2SE 1.6.0.22. It has worked like you said.

   - The transfer encoding: chunked site worked fine
   - I was also able to make other proxy changes successfully avoiding the
   bad file number socket problems (below).

But, I still need to port 4.1 now to Android. I'm wondering if I still have
to do that because the only unresolved references
in my new code (relative to 40-beta2) are:

   - ImmutableHttpProcessor references (change back to BasicHttpProcessor?)
   - SyncBasicHttpParams references (change back to BasicHttpParams?)
   - HttpService constructor has a few more params?

I realize the 40-beta2 code is old but it is still installed on all the
ANdroid 2.2 phones. Wondering if you strongly
recommend the 4.1 porting? If you do, is that just a matter of importing the
4.1 JAR and establishing
a new namespace for it so it doesn't conflict with the HttpComponent code in
ANdroid 2.2
(I'm assuming that is possible and simple)?

Anyway, let me know what you think. I really appreciate all your help and I
can close my earlier bug if you like.

jh

P.S. Do you have any insight into the HttpComponents version that Google
will use on upcoming versions of Android?
I understand if you don't or cannot comment.

On Wed, Nov 17, 2010 at 2:45 PM, Oleg Kalnichevski (JIRA)



> "Socket Exception: Bad file number" when passing chunked entity back to response
> --------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-241
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-241
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>         Environment: Android Froyo 2.2 (FRF50)
> Running as Root on a Nexus One
> I think Android Froyo is running HttpCore 4.0 but not sure. I tried to dump VersionInfo on several packages but didn't get any info returned.
>            Reporter: John B. Hansen
>
> I'm a new user with HttpCore and didn't know where else to turn for support.. And, this problem may be my fault...
> Just looking for some suggestions...
> I'm doing a ProxyServer by using a variation of ElementalHttpServer  to send a request to proxy code.
> The proxy code then makes an actual client request to the target site. The proxy request gets a response
> back and sets the statusline, headers, and entity back in the original response in the  handler  (which sends
>  it back to the Browser).
> For simple HTML sites, this works fine. But, on chunked sites (transfer-encoding=chunked) e.g. www.google.com 
> I'm getting a "Socket Exception: Bad File Number" following the first response back to the browser i.e.
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is CHUNKED
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): proxyResponse entity is STREAMING
> 11-17 13:48:05.307: ERROR/MTHttpProxy:(2767): ======================= Done Handling Request-Response =======================
> 11-17 13:48:05.317: ERROR/MTHttpProxy:(2767): ERROR: I/O error from call to handle request: Bad file number
> 11-17 13:48:05.317: WARN/System.err(2767): java.net.SocketException: Bad file number
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.readSocketImpl(Native Method)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.platform.OSNetworkSystem.read(OSNetworkSystem.java:358)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:561)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:88)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
> 11-17 13:48:05.327: WARN/System.err(2767):     at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:161)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:175)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.entity.BasicHttpEntity.writeTo(BasicHttpEntity.java:129)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:97)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.impl.AbstractHttpServerConnection.sendResponseEntity(AbstractHttpServerConnection.java:182)
> 11-17 13:48:05.337: WARN/System.err(2767):     at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:209)
> 11-17 13:48:05.337: WARN/System.err(2767):     at com.test.MultiHttpProxy$WorkerThread.run(MultiHttpProxy.java:446)
> BTW: I have no reason to suspect bugs in the Chunk handling. I'm just not seeing this on the few non-chunked sites I've tested.
> Any ideas what could be wrong or how to debug? Any advice appreciated....Thanks!
> PS, if anyone can clarify the version of HttpComponents on Android 2.2 also, that would be great. Thx.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org