mirror of https://gitee.com/bigwinds/arangodb
fixed pipelining and close for polling
This commit is contained in:
parent
00a7def28f
commit
992f4d0fbb
|
@ -163,6 +163,8 @@ actions.defineHttp({
|
||||||
prefix : true,
|
prefix : true,
|
||||||
|
|
||||||
callback : function (req, res) {
|
callback : function (req, res) {
|
||||||
|
require("console").log("long polling request from client %s", req.client.id);
|
||||||
|
|
||||||
res.responseCode = actions.HTTP_OK;
|
res.responseCode = actions.HTTP_OK;
|
||||||
res.contentType = "application/json; charset=utf-8";
|
res.contentType = "application/json; charset=utf-8";
|
||||||
res.headers = { 'transfer-encoding': 'chunked' };
|
res.headers = { 'transfer-encoding': 'chunked' };
|
||||||
|
|
|
@ -703,10 +703,11 @@ void HttpCommTask::finishedChunked () {
|
||||||
_writeBuffersStats.push_back(0);
|
_writeBuffersStats.push_back(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fillWriteBuffer();
|
|
||||||
|
|
||||||
_requestPending = false;
|
|
||||||
_isChunked = false;
|
_isChunked = false;
|
||||||
|
_requestPending = false;
|
||||||
|
|
||||||
|
fillWriteBuffer();
|
||||||
|
processRead();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@ -1211,7 +1212,7 @@ void HttpCommTask::completedWriteBuffer (bool& closed) {
|
||||||
|
|
||||||
fillWriteBuffer();
|
fillWriteBuffer();
|
||||||
|
|
||||||
if (_closeRequested && ! hasWriteBuffer() && _writeBuffers.empty()) {
|
if (_closeRequested && ! hasWriteBuffer() && _writeBuffers.empty() && ! _isChunked) {
|
||||||
closed = true;
|
closed = true;
|
||||||
_server->handleCommunicationClosed(this);
|
_server->handleCommunicationClosed(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue