tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_service_iis.c
Date Sat, 03 Apr 2004 06:47:23 GMT
mturk       2004/04/02 22:47:23

  Modified:    jk/native2/server/isapi jk_service_iis.c
  Log:
  Read from client in the loop until all the requested data is read or timeout
  occurs. This fixes random errors during read large post data.
  
  Revision  Changes    Path
  1.30      +19 -11    jakarta-tomcat-connectors/jk/native2/server/isapi/jk_service_iis.c
  
  Index: jk_service_iis.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_service_iis.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- jk_service_iis.c	21 Mar 2004 09:45:16 -0000	1.29
  +++ jk_service_iis.c	3 Apr 2004 06:47:23 -0000	1.30
  @@ -156,6 +156,7 @@
   
           if ((DWORD) s->content_read < lpEcb->cbTotalBytes) {
               DWORD rdlen, toread = len;
  +            DWORD cblen = 0;
               LPBYTE buff = (LPBYTE) b;
   
               /* 
  @@ -199,19 +200,26 @@
               /*
                * Now try to read from the client ...
                */
  -            if (lpEcb->ReadClient(lpEcb->ConnID, buff, &rdlen)) {
  -                *actually_read += rdlen;
  -                env->l->jkLog(env, env->l, JK_LOG_DEBUG,
  -                              "jk_ws_service_t::read ReadClient readed %d (actually %d)
bytes\n",
  -                              rdlen, *actually_read);
  +            
  +            while (cblen < rdlen) {
  +                toread = rdlen - cblen;
  +                if (lpEcb->ReadClient(lpEcb->ConnID, buff + cblen, &toread))
{
  +                    if (toread == 0)
  +                        break;
  +                    cblen += toread;
  +                    env->l->jkLog(env, env->l, JK_LOG_DEBUG,
  +                                  "jk_ws_service_t::read ReadClient readed %d (actually
%d) bytes\n",
  +                                  toread, *actually_read + cblen);
   
  +                }
  +                else {
  +                    env->l->jkLog(env, env->l, JK_LOG_ERROR,
  +                                  "jk_ws_service_t::read, ReadClient failed\n");
  +                    /* XXX: We should return here HSE_STATUS_ERROR */
  +                    break;
  +                }
               }
  -            else {
  -                env->l->jkLog(env, env->l, JK_LOG_ERROR,
  -                              "jk_ws_service_t::read, ReadClient failed\n");
  -                /* XXX: We should return here HSE_STATUS_ERROR */
  -                return JK_OK;
  -            }
  +            *actually_read += cblen;
           }
           env->l->jkLog(env, env->l, JK_LOG_DEBUG,
                         "jk_ws_service_t::read actually readed %d from already %d of total
%d bytes\n",
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message