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;
|
HttpEventListener _listener;
|
||||||
boolean _delegatingRequests;
|
boolean _delegatingRequests;
|
||||||
boolean _delegatingResponses;
|
boolean _delegatingResponses;
|
||||||
|
boolean _delegationResult;
|
||||||
|
private Buffer _version;
|
||||||
|
private int _status;
|
||||||
|
private Buffer _reason;
|
||||||
|
|
||||||
public HttpEventListenerWrapper()
|
public HttpEventListenerWrapper()
|
||||||
{
|
{
|
||||||
|
@ -68,6 +72,11 @@ public class HttpEventListenerWrapper implements HttpEventListener
|
||||||
_delegatingResponses = delegating;
|
_delegatingResponses = delegating;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDelegationResult( boolean result )
|
||||||
|
{
|
||||||
|
_delegationResult = result;
|
||||||
|
}
|
||||||
|
|
||||||
public void onConnectionFailed(Throwable ex)
|
public void onConnectionFailed(Throwable ex)
|
||||||
{
|
{
|
||||||
if (_delegatingRequests)
|
if (_delegatingRequests)
|
||||||
|
@ -101,7 +110,13 @@ public class HttpEventListenerWrapper implements HttpEventListener
|
||||||
public void onResponseComplete() throws IOException
|
public void onResponseComplete() throws IOException
|
||||||
{
|
{
|
||||||
if (_delegatingResponses)
|
if (_delegatingResponses)
|
||||||
|
{
|
||||||
|
if (_delegationResult == false)
|
||||||
|
{
|
||||||
|
_listener.onResponseStatus(_version,_status,_reason);
|
||||||
|
}
|
||||||
_listener.onResponseComplete();
|
_listener.onResponseComplete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onResponseContent(Buffer content) throws IOException
|
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
|
public void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException
|
||||||
{
|
{
|
||||||
if (_delegatingResponses)
|
if (_delegatingResponses)
|
||||||
|
{
|
||||||
_listener.onResponseStatus(version,status,reason);
|
_listener.onResponseStatus(version,status,reason);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_version = version;
|
||||||
|
_status = status;
|
||||||
|
_reason = reason;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRetry()
|
public void onRetry()
|
||||||
|
|
|
@ -120,6 +120,7 @@ public class WebdavListener extends HttpEventListenerWrapper
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// admit defeat but retry because someone else might have
|
// admit defeat but retry because someone else might have
|
||||||
|
setDelegationResult(false);
|
||||||
setDelegatingRequests( true );
|
setDelegatingRequests( true );
|
||||||
setDelegatingResponses(true);
|
setDelegatingResponses(true);
|
||||||
super.onResponseComplete();
|
super.onResponseComplete();
|
||||||
|
|
Loading…
Reference in New Issue