hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HTTPCORE-123) SSL: Buffered data lost, if connection closed on server side
Date Fri, 12 Oct 2007 11:58:51 GMT

     [ https://issues.apache.org/jira/browse/HTTPCORE-123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved HTTPCORE-123.
----------------------------------------

    Resolution: Fixed

Risto,
I reviewed the patch and checked it in with some minor tweaks. Could you please re-test your
application against SVN trunk?

Many thanks for contributing the fix.

Oleg

> SSL: Buffered data lost, if connection closed on server side
> ------------------------------------------------------------
>
>                 Key: HTTPCORE-123
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-123
>             Project: HttpComponents Core
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.0-alpha6
>         Environment: jre1.5.0_06, apache2
>            Reporter: Risto ReinpƵld
>            Assignee: Oleg Kalnichevski
>            Priority: Critical
>             Fix For: 4.0-beta1
>
>
> In case of 'Connection: close' connections to https web server the connection might be
terminated on server side before data has reached the client application. Step by step scenario.
> 1. SSLIOSession.isAppInputReady receives encrypted data and sees end of stream (status
= CLOSED);
> 2. SSLIOSession.decryptData decypted the received data and puts into inPlain buffer;
> 3. NHttpClientHandler.inputReady is called. App calls decoder.read, but decoder will
not get the data in SSLIOSession.inPLain, because of the check in SSLIOSession.unwrap:
>         if (this.status != ACTIVE) {
>             return -1;
>         }
> Moving this after inPlain.position() > 0 check would quickfix the problem, but maybe
it not the best way of doing it.
> Index: SSLIOSession.java
> ===================================================================
> --- SSLIOSession.java   (revision 582811)
> +++ SSLIOSession.java   (working copy)
> @@ -298,9 +298,6 @@
>          if (dst == null) {
>              throw new IllegalArgumentException("Byte buffer may not be null");
>          }
> -        if (this.status != ACTIVE) {
> -            return -1;
> -        }
>          if (this.inPlain.position() > 0) {
>              this.inPlain.flip();
>              int n = Math.min(this.inPlain.remaining(), dst.remaining());
> @@ -309,6 +306,8 @@
>              }
>              this.inPlain.compact();
>              return n;
> +        } else if (this.status != ACTIVE) {
> +            return -1;
>          } else {
>              return 0;
>          }

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Mime
View raw message