mirror of
https://github.com/jetty/jetty.project.git
synced 2025-03-03 20:39:18 +00:00
428660 Delay closing async HttpOutput until after UNREADY->READY
This commit is contained in:
parent
7d6c1548b1
commit
8d979408b7
@ -163,7 +163,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
/* Called to indicated that the output is already closed and the state needs to be updated to match */
|
||||
/* Called to indicated that the output is already closed (write with last==true performed) and the state needs to be updated to match */
|
||||
void closed()
|
||||
{
|
||||
loop: while(true)
|
||||
@ -894,19 +894,25 @@ public class HttpOutput extends ServletOutputStream implements Runnable
|
||||
|
||||
// all content written, but if we have not yet signal completion, we
|
||||
// need to do so
|
||||
if (_complete)
|
||||
if (_complete && !_completed)
|
||||
{
|
||||
if (!_completed)
|
||||
{
|
||||
_completed=true;
|
||||
write(BufferUtil.EMPTY_BUFFER, _complete, this);
|
||||
return Action.SCHEDULED;
|
||||
}
|
||||
closed();
|
||||
_completed=true;
|
||||
write(BufferUtil.EMPTY_BUFFER, _complete, this);
|
||||
return Action.SCHEDULED;
|
||||
}
|
||||
|
||||
return Action.SUCCEEDED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void completed()
|
||||
{
|
||||
super.completed();
|
||||
if (_complete)
|
||||
closed();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user