Timeout, partial chunk encoded body received

43 views
Skip to first unread message

Félicien Francois

unread,
Jul 30, 2015, 1:06:52 PM7/30/15
to OpenLiteSpeed Development
I have a virtualhost set up to proxy a web app (NodeJS).
I got the following error repeatedly on some requests (most are static files served by NodeJS):

> Timeout, partial chunk encoded body received

The corresponding responses are successfully sent to the client but the response body is flushed only at the end of the "Initial Request Timeout (secs)".
It means that thoose responses are incredibly low.
The issue happens on a few files, all text based, in a consistent way.

Reproduced on both 1.3.12 and 1.4.11 with 2 different nodejs apps: Ghost and Strider.
When calling the app directly (bypassing open litespeed), there is no issue and response seems 100% normal.

The setup to reproduce:
- NodeJS App serving locally
- External app set up at a virtual host level

The following options toggle seems to have no effect on the issue:
- GZIP Compression
-
Response Buffering
- Way of mapping to external app (Context vs RewriteRule)
- Client Browser used (tested with upstream Firefox, Chrome and IE)

David

unread,
Aug 6, 2015, 2:07:46 PM8/6/15
to openlitespee...@googlegroups.com
Hi,

Can you apply the below patch and re-build the binary and test?
If still have any problem, please let me known.

Thanks.
David


diff --git a/src/extensions/proxy/proxyconn.cpp b/src/extensions/proxy/proxyconn.cpp
index e9af652..e0b596d 100644
@@ -619,7 +619,7 @@ int ProxyConn::readRespBody()
         return LS_FAIL;
     if (m_pChunkIS)
     {
-        while (getState() != ABORT)
+        while (getState() != ABORT && !m_pChunkIS->eos())
         {
             char *pBuf = pHEC->getRespBuf(bufLen);
             if (!pBuf)
@@ -632,22 +632,18 @@ int ProxyConn::readRespBody()
                     m_lLastRespRecvTime = time(NULL);
                     m_iRespBodyRecv += ret;
                     int ret1 = pHEC->processRespBodyData(pBuf, ret);
-                    if (ret1)
-                        return ret1;
-                    if (ret > 1024)
+                    if (ret1 == -1)
+                        ret = LS_FAIL;
+                    if (ret > 1024 || (ret < (int)bufLen))
                         pHEC->flushResp();
-
                 }
                 if (m_pChunkIS->eos())
                 {
                     ret = 0;
                     break;
                 }
-                if (ret < (int)bufLen)
-                {
-                    pHEC->flushResp();
-                    return 0;
-                }
+                pHEC->flushResp();
+                return ret;
             }
             else
             {
--
You received this message because you are subscribed to the Google Groups "OpenLiteSpeed Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlitespeed-deve...@googlegroups.com.
To post to this group, send email to openlitespee...@googlegroups.com.
Visit this group at http://groups.google.com/group/openlitespeed-development.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages