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:
Jesse McConnell 2009-08-30 17:57:47 +00:00
parent 9aaf93c8bf
commit 53ca33accb
2 changed files with 24 additions and 0 deletions

View File

@ -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()

View File

@ -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();