HTTP: finish core request before calling any callback.

This commit is contained in:
Thomas Geymayer
2013-10-28 20:34:11 +01:00
parent 2f42a8714c
commit 7076c9a0ff

View File

@@ -304,22 +304,28 @@ void Request::setReadyState(ReadyState state)
_ready_state = state;
if( state == DONE )
{
// Finish C++ part of request to ensure everything is finished (for example
// files and streams are closed) before calling any callback (possibly using
// such files)
onDone();
onAlways();
if( _cb_done )
_cb_done(this);
onDone();
}
else if( state == FAILED )
{
onFail();
onAlways();
if( _cb_fail )
_cb_fail(this);
onFail();
}
else
return;
if( _cb_always )
_cb_always(this);
onAlways();
}
//------------------------------------------------------------------------------