Bug 288182 PUT request fails during retry
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@790 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
eb4c9a06c4
commit
df168e8e76
|
@ -59,6 +59,7 @@ public class ContentExchange extends CachedExchange
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
@Override
|
||||||
protected void onResponseHeader(Buffer name, Buffer value) throws IOException
|
protected void onResponseHeader(Buffer name, Buffer value) throws IOException
|
||||||
{
|
{
|
||||||
super.onResponseHeader(name,value);
|
super.onResponseHeader(name,value);
|
||||||
|
@ -77,6 +78,7 @@ public class ContentExchange extends CachedExchange
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void onResponseContent(Buffer content) throws IOException
|
protected void onResponseContent(Buffer content) throws IOException
|
||||||
{
|
{
|
||||||
super.onResponseContent( content );
|
super.onResponseContent( content );
|
||||||
|
@ -85,18 +87,26 @@ public class ContentExchange extends CachedExchange
|
||||||
content.writeTo(_responseContent);
|
content.writeTo(_responseContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void onRetry() throws IOException
|
protected void onRetry() throws IOException
|
||||||
{
|
{
|
||||||
if ( _fileForUpload != null )
|
if (_fileForUpload != null)
|
||||||
{
|
{
|
||||||
_requestContent = null;
|
_requestContent = null;
|
||||||
_requestContentSource = getInputStream();
|
_requestContentSource = getInputStream();
|
||||||
}
|
}
|
||||||
else if ( _requestContentSource != null )
|
else if (_requestContentSource != null)
|
||||||
{
|
{
|
||||||
throw new IOException("Unsupported Retry attempt, no registered file for upload.");
|
if (_requestContentSource.markSupported())
|
||||||
|
{
|
||||||
|
_requestContent = null;
|
||||||
|
_requestContentSource.reset();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new IOException("Unsupported retry attempt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onRetry();
|
super.onRetry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue