1
0
Fork 0

fixed pipelining and close for polling

This commit is contained in:
Frank Celler 2015-04-01 15:53:32 +02:00
parent 00a7def28f
commit 992f4d0fbb
2 changed files with 7 additions and 4 deletions

View File

@ -163,6 +163,8 @@ actions.defineHttp({
prefix : true,
callback : function (req, res) {
require("console").log("long polling request from client %s", req.client.id);
res.responseCode = actions.HTTP_OK;
res.contentType = "application/json; charset=utf-8";
res.headers = { 'transfer-encoding': 'chunked' };

View File

@ -703,10 +703,11 @@ void HttpCommTask::finishedChunked () {
_writeBuffersStats.push_back(0);
#endif
fillWriteBuffer();
_requestPending = false;
_isChunked = false;
_requestPending = false;
fillWriteBuffer();
processRead();
}
// -----------------------------------------------------------------------------
@ -1211,7 +1212,7 @@ void HttpCommTask::completedWriteBuffer (bool& closed) {
fillWriteBuffer();
if (_closeRequested && ! hasWriteBuffer() && _writeBuffers.empty()) {
if (_closeRequested && ! hasWriteBuffer() && _writeBuffers.empty() && ! _isChunked) {
closed = true;
_server->handleCommunicationClosed(this);
}