hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Lukyanov" <dlukya...@ukr.net>
Subject Problem to receive last chunk of https response with httpcore-nio
Date Sat, 25 Sep 2010 12:25:12 GMT
Hello,

I'm a wso2 esb (synapse) user/developer.
I got a problem with https nio transport.
I tried versions 4.1 alpha1 and 4.1 beta2.

The problem: 
transport failed to receive large (50k) response through nio https.
The connection is keep-alive and chunked. Every time I received only response divisible 
by 8192 and last chunk is never returned.

After digging the logs and code I found that last chunk not returned because 
of the code in this class org.apache.http.impl.nio.reactor.SSLIOSession.java

I changed one line in the code and now it's working.
Now I want to ask somebody who knows the code if this change is ok,
and maybe it should be applied to httpcore:

public synchronized boolean isAppInputReady() throws IOException {
    int bytesRead = receiveEncryptedData();
    if (bytesRead == -1) {
        this.endOfStream = true;
    }
    doHandshake();
    decryptData();
   
    // CHANGED CODE:
    return (this.appEventMask & SelectionKey.OP_READ) > 0
        && (this.inPlain.position() > 0 || (this.endOfStream && this.status
== ACTIVE) 
                                          || this.appBufferStatus.hasBufferedInput() );
    // ORIGINAL CODE:
    //return (this.appEventMask & SelectionKey.OP_READ) > 0
    //    && (this.inPlain.position() > 0 || (this.endOfStream && this.status
== ACTIVE));

}

--
Regards,
  Dmitry

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


Mime
View raw message