I know it well, and take a serious look even
if it will be seriously reworked in jk2...

-
Henri Gomez                 ___[_]____
EMAIL : [EMAIL PROTECTED]        (. .)                     
PGP KEY : 697ECEDD    ...oOOo..(_)..oOOo...
PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6 



>-----Original Message-----
>From: Kevin Seguin [mailto:[EMAIL PROTECTED]]
>Sent: Friday, December 07, 2001 12:16 AM
>To: Tomcat-Dev (E-mail)
>Subject: [j-t-c] problem in ajp_process_callback (in jk_ajp_common.c)
>
>
>in ajp_process_callback, here is the block of code that 
>handles sending the
>next chunk of data from the webserver to tomcat:
>
>--- snip ---
>        case JK_AJP13_GET_BODY_CHUNK:
>            {
>               unsigned len = (unsigned)jk_b_get_int(msg);
>                jk_log(l, JK_LOG_DEBUG, "received 
>JK_AJP13_GET_BODY_CHUNK,
>len=%d\n", len);
>
>                if(len > AJP13_MAX_SEND_BODY_SZ) {
>                    len = AJP13_MAX_SEND_BODY_SZ;
>                }
>                if(len > ae->left_bytes_to_send) {
>                    jk_log(l, JK_LOG_DEBUG, "len > 
>ae->left_bytes_to_send
>(%d > %d)\n",
>                           len, ae->left_bytes_to_send);
>                    len = ae->left_bytes_to_send;
>                }
>               if(len < 0) {
>                   len = 0;
>               }
>
>               /* the right place to add file storage for upload */
>               if ((len = ajp_read_into_msg_buff(ae, r, msg, 
>len, l)) >= 0)
>{
>                   r->content_read += len;
>                   return JK_AJP13_HAS_RESPONSE;
>               }                  
>
>               jk_log(l, JK_LOG_ERROR, "Error ajp_process_callback -
>ajp_read_into_msg_buff failed\n");
>               return JK_INTERNAL_ERROR;           
>            }
>           break;
>--- end snip ---
>
>in this line:
>
>               if ((len = ajp_read_into_msg_buff(ae, r, msg, 
>len, l)) >= 0)
>{
>
>shouldn't pmsg (the post message) be read into, not msg?  i 
>think you only
>run into this situation when the posted data doesn't fit into the first
>message to tomcat, or a handling servlet doesn't make use of 
>content-length
>and tries to read more bytes than are available.  i'm not sure 
>though...
>the code is a little hard to follow :)

I've written that piece of code some months ago but it was modified and 
now I'm not sure (I feel you could be rigth). This code turned to be 
a real spaghetti and should we reworked. I'll work on it as soon
as Costin will finish refactory

>anyway, i was running into a problem with an infinite loop in 
>the ajp layer.
>when i made this change, the problem went away.
>
>can someone who knows this code better than i take a look?  thanks in
>advance.

I'm on it :)

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to