You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by da...@apache.org on 2001/01/11 03:36:14 UTC

cvs commit: jakarta-tomcat/src/native/mod_jk/common jk_ajp13_worker.c

danmil      01/01/10 18:36:14

  Modified:    src/native/mod_jk/common jk_ajp13_worker.c
  Log:
  - Clarified Ajp13 protocol: if the container tries to read
    past the end of the input stream, the server sends an empty packet back.
  
  Revision  Changes    Path
  1.3       +14 -12    jakarta-tomcat/src/native/mod_jk/common/jk_ajp13_worker.c
  
  Index: jk_ajp13_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/common/jk_ajp13_worker.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_ajp13_worker.c	2000/11/10 18:48:50	1.2
  +++ jk_ajp13_worker.c	2001/01/11 02:36:14	1.3
  @@ -57,7 +57,7 @@
    * Description: Experimental bi-directionl protocol.                       *
    * Author:      Costin <co...@costin.dnt.ro>                              *
    * Author:      Gal Shachor <sh...@il.ibm.com>                           *
  - * Version:     $Revision: 1.2 $                                           *
  + * Version:     $Revision: 1.3 $                                           *
    ***************************************************************************/
   
   #include "jk_pool.h"
  @@ -267,7 +267,7 @@
       read_buf += 4; /* leave some space for the buffer headers */
       read_buf += 2; /* leave some space for the read length */
   
  -    if(read_fully_from_server(r, read_buf, len) <= 0) {
  +    if(read_fully_from_server(r, read_buf, len) < 0) {
           jk_log(l, JK_LOG_ERROR, 
                  "read_into_msg_buff: Error - read_fully_from_server failed\n");
           return JK_FALSE;                        
  @@ -331,23 +331,25 @@
   
           case JK_AJP13_GET_BODY_CHUNK:
               {
  -	            unsigned len = (unsigned)jk_b_get_int(msg);
  +		unsigned len = (unsigned)jk_b_get_int(msg);
   
                   if(len > MAX_SEND_BODY_SZ) {
                       len = MAX_SEND_BODY_SZ;
                   }
                   if(len > ep->left_bytes_to_send) {
                       len = ep->left_bytes_to_send;
  -                }
  -                if(len > 0) {
  -                    if(read_into_msg_buff(ep, r, msg, l, len)) {
  -                        return JK_AJP13_HAS_RESPONSE;
  -                    }                  
  -
  -                    jk_log(l, JK_LOG_ERROR, 
  -                           "Error ajp13_process_callback - read_into_msg_buff failed\n");
  -                    return JK_INTERNAL_ERROR;
                   }
  +		if(len < 0) {
  +		    len = 0;
  +		}
  +
  +		if(read_into_msg_buff(ep, r, msg, l, len)) {
  +		    return JK_AJP13_HAS_RESPONSE;
  +		}                  
  +
  +		jk_log(l, JK_LOG_ERROR, 
  +		       "Error ajp13_process_callback - read_into_msg_buff failed\n");
  +		return JK_INTERNAL_ERROR;	    
               }
   	    break;