BUG 288055 resolved issue with jetty-client
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@782 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
9aaf93c8bf
commit
53ca33accb
|
@ -23,6 +23,10 @@ public class HttpEventListenerWrapper implements HttpEventListener
|
|||
HttpEventListener _listener;
|
||||
boolean _delegatingRequests;
|
||||
boolean _delegatingResponses;
|
||||
boolean _delegationResult;
|
||||
private Buffer _version;
|
||||
private int _status;
|
||||
private Buffer _reason;
|
||||
|
||||
public HttpEventListenerWrapper()
|
||||
{
|
||||
|
@ -68,6 +72,11 @@ public class HttpEventListenerWrapper implements HttpEventListener
|
|||
_delegatingResponses = delegating;
|
||||
}
|
||||
|
||||
public void setDelegationResult( boolean result )
|
||||
{
|
||||
_delegationResult = result;
|
||||
}
|
||||
|
||||
public void onConnectionFailed(Throwable ex)
|
||||
{
|
||||
if (_delegatingRequests)
|
||||
|
@ -101,7 +110,13 @@ public class HttpEventListenerWrapper implements HttpEventListener
|
|||
public void onResponseComplete() throws IOException
|
||||
{
|
||||
if (_delegatingResponses)
|
||||
{
|
||||
if (_delegationResult == false)
|
||||
{
|
||||
_listener.onResponseStatus(_version,_status,_reason);
|
||||
}
|
||||
_listener.onResponseComplete();
|
||||
}
|
||||
}
|
||||
|
||||
public void onResponseContent(Buffer content) throws IOException
|
||||
|
@ -125,7 +140,15 @@ public class HttpEventListenerWrapper implements HttpEventListener
|
|||
public void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException
|
||||
{
|
||||
if (_delegatingResponses)
|
||||
{
|
||||
_listener.onResponseStatus(version,status,reason);
|
||||
}
|
||||
else
|
||||
{
|
||||
_version = version;
|
||||
_status = status;
|
||||
_reason = reason;
|
||||
}
|
||||
}
|
||||
|
||||
public void onRetry()
|
||||
|
|
|
@ -120,6 +120,7 @@ public class WebdavListener extends HttpEventListenerWrapper
|
|||
else
|
||||
{
|
||||
// admit defeat but retry because someone else might have
|
||||
setDelegationResult(false);
|
||||
setDelegatingRequests( true );
|
||||
setDelegatingResponses(true);
|
||||
super.onResponseComplete();
|
||||
|
|
Loading…
Reference in New Issue