nacho       01/09/14 20:06:43

  Modified:    src/native/mod_jk/common jk_ajp13_worker.c
  Log:
  Problems with CRLF's
  
  Revision  Changes    Path
  1.13      +37 -37    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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_ajp13_worker.c 2001/09/10 21:43:36     1.12
  +++ jk_ajp13_worker.c 2001/09/15 03:06:43     1.13
  @@ -58,7 +58,7 @@
    * Author:      Henri Gomez <[EMAIL PROTECTED]>                               *
    * Author:      Costin <[EMAIL PROTECTED]>                              *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
  - * Version:     $Revision: 1.12 $                                           *
  + * Version:     $Revision: 1.13 $                                           *
    ***************************************************************************/
   
   #include "jk_pool.h"
  @@ -79,7 +79,7 @@
   #define MAX_SEND_BODY_SZ        (DEF_BUFFER_SZ - 6)
   #define AJP13_HEADER_LEN     (4)
   #define AJP13_HEADER_SZ_LEN  (2)
  -#define CHUNK_BUFFER_PAD        (12)
  +#define CHUNK_BUFFER_PAD        (12)
   
   struct ajp13_operation;
   typedef struct ajp13_operation ajp13_operation_t;
  @@ -263,21 +263,21 @@
                                     unsigned char *buf, 
                                     unsigned len)
   {
  -    unsigned rdlen = 0;
  -    unsigned padded_len = len;
  -    
  -    if (s->is_chunked && s->no_more_chunks) {
  -     return 0;
  -    }
  -    if (s->is_chunked) {
  -        /* Corner case: buf must be large enough to hold next
  -         * chunk size (if we're on or near a chunk border).
  -         * Pad the length to a reasonable value, otherwise the
  -         * read fails and the remaining chunks are tossed.
  -         */
  -        padded_len = (len < CHUNK_BUFFER_PAD) ?
  -                      len : len - CHUNK_BUFFER_PAD;
  -    }
  +    unsigned rdlen = 0;
  +    unsigned padded_len = len;
  +    
  +    if (s->is_chunked && s->no_more_chunks) {
  +     return 0;
  +    }
  +    if (s->is_chunked) {
  +        /* Corner case: buf must be large enough to hold next
  +         * chunk size (if we're on or near a chunk border).
  +         * Pad the length to a reasonable value, otherwise the
  +         * read fails and the remaining chunks are tossed.
  +         */
  +        padded_len = (len < CHUNK_BUFFER_PAD) ?
  +                      len : len - CHUNK_BUFFER_PAD;
  +    }
   
       while(rdlen < padded_len) {
           unsigned this_time = 0;
  @@ -285,9 +285,9 @@
               return -1;
           }
   
  -        if(0 == this_time) {
  -         if (s->is_chunked) {
  -             s->no_more_chunks = 1; /* read no more */
  +        if(0 == this_time) {
  +         if (s->is_chunked) {
  +             s->no_more_chunks = 1; /* read no more */
            }
               break;
           }
  @@ -296,7 +296,7 @@
   
       return (int)rdlen;
   }
  -
  +
   /* Returns -1 on error, else number of bytes read */
   static int read_into_msg_buff(ajp13_endpoint_t *ep,
                                 jk_ws_service_t *r, 
  @@ -310,33 +310,33 @@
       
       read_buf += AJP13_HEADER_LEN;    /* leave some space for the buffer headers */
       read_buf += AJP13_HEADER_SZ_LEN; /* leave some space for the read length */
  -
  -    /* Pick the max size since we don't know the content_length */
  -    if (r->is_chunked && len == 0) {
  -     len = MAX_SEND_BODY_SZ;
  -    }
  -
  +
  +    /* Pick the max size since we don't know the content_length */
  +    if (r->is_chunked && len == 0) {
  +     len = MAX_SEND_BODY_SZ;
  +    }
  +
       if((len = 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 -1;
       } 
  -
  -    if (!r->is_chunked) {
  -     ep->left_bytes_to_send -= len;
  +
  +    if (!r->is_chunked) {
  +     ep->left_bytes_to_send -= len;
       }
   
  -    if (len > 0) {
  -     /* Recipient recognizes empty packet as end of stream, not
  -        an empty body packet */
  +    if (len > 0) {
  +     /* Recipient recognizes empty packet as end of stream, not
  +        an empty body packet */
           if(0 != jk_b_append_int(msg, (unsigned short)len)) {
               jk_log(l, JK_LOG_ERROR, 
                      "read_into_msg_buff: Error - jk_b_append_int failed\n");
               return -1;
        }
  -    }
  -
  -    jk_b_set_len(msg, jk_b_get_len(msg) + len);
  +    }
  +
  +    jk_b_set_len(msg, jk_b_get_len(msg) + len);
       
       return len;
   }
  @@ -400,7 +400,7 @@
                }
   
                /* the right place to add file storage for upload */
  -             if((len = read_into_msg_buff(ep, r, pmsg, l, len)) >= 0) {
  +             if((len = read_into_msg_buff(ep, r, pmsg, l, len)) >= 0) {
                    r->content_read += len;
                    return JK_AJP13_HAS_RESPONSE;
                }                  
  
  
  

Reply via email to