tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c
Date Tue, 06 Nov 2001 00:15:07 GMT
costin      01/11/05 16:15:07

  Modified:    jk/native/common jk_ajp_common.c
  Log:
  Dump buffer on error, add debug messages when the worker is added to the pool/reused.
  
  Cut some of the long lines closer to 80 chars/line ( also some tabs...)
  
  Revision  Changes    Path
  1.18      +38 -32    jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
  
  Index: jk_ajp_common.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- jk_ajp_common.c	2001/10/31 14:03:22	1.17
  +++ jk_ajp_common.c	2001/11/06 00:15:07	1.18
  @@ -59,7 +59,7 @@
    * Description: common stuff for bi-directional protocols ajp13/ajp14.     *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    * Author:      Henri Gomez <hgomez@slib.fr>                               *
  - * Version:     $Revision: 1.17 $                                           *
  + * Version:     $Revision: 1.18 $                                           *
    ***************************************************************************/
   
   
  @@ -630,12 +630,13 @@
       unsigned char head[AJP_HEADER_LEN];
       int           rc;
       int           msglen;
  -	unsigned int  header;
  +    unsigned int  header;
   
  -	if ((ae->proto != AJP13_PROTO) && (ae->proto != AJP14_PROTO)) {
  -		jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message: Can't handle unknown protocol
%d\n", ae->proto);
  -		return JK_FALSE;
  -	}
  +    if ((ae->proto != AJP13_PROTO) && (ae->proto != AJP14_PROTO)) {
  +	jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message:"
  +	       " Can't handle unknown protocol %d\n", ae->proto);
  +	return JK_FALSE;
  +    }
   
       rc = jk_tcp_socket_recvfull(ae->sd, head, AJP_HEADER_LEN);
   
  @@ -643,32 +644,34 @@
           jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message: Error - jk_tcp_socket_recvfull
failed\n");
           return JK_FALSE;
       }
  -
  -	header = ((unsigned int)head[0] << 8) | head[1];
  -  
  -	if (ae->proto == AJP13_PROTO) {
  -    	if (header != AJP13_SW_HEADER) {
  -
  -			if (header == AJP14_SW_HEADER)
  -				jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message: Error - received AJP14 reply
on an AJP13 connection\n");
  -			else
  -        		jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message: Error - Wrong message
format 0x%04x\n", header);
   
  -        	return JK_FALSE;
  +    header = ((unsigned int)head[0] << 8) | head[1];
  +    
  +    if (ae->proto == AJP13_PROTO) {
  +	if (header != AJP13_SW_HEADER) {
  +	    if (header == AJP14_SW_HEADER) {
  +		jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message:"
  +		       " Error - received AJP14 reply on an AJP13 connection\n");
  +	    } else {
  +		jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message:"
  +		       "Error - Wrong message format 0x%04x\n", header);
  +	    }
  +	    return JK_FALSE;
       	}
  +    } else if (ae->proto == AJP14_PROTO) {
  +	if (header != AJP14_SW_HEADER) {
  +	    if (header == AJP13_SW_HEADER) {
  +		jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message:"
  +		       " Error - received AJP13 reply on an AJP14 connection\n");
  +	    } else {
  +		jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message:"
  +		       "Error - Wrong message format 0x%04x\n", header);
  +	    }
  +	    
  +	    return JK_FALSE;
   	}
  -	else if (ae->proto == AJP14_PROTO) {
  -		if (header != AJP14_SW_HEADER) {
  +    }	
   
  -			if (header == AJP13_SW_HEADER)
  -				jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message: Error - received AJP13 reply
on an AJP14 connection\n");
  -			else
  -				jk_log(l, JK_LOG_ERROR, "ajp_connection_tcp_get_message: Error - Wrong message format
0x%04x\n", header);
  -
  -			return JK_FALSE;
  -		}
  -	}	
  -
       msglen  = ((head[2]&0xff)<<8);
       msglen += (head[3] & 0xFF);
   
  @@ -686,11 +689,11 @@
           return JK_FALSE;
       }
   
  -	if (ae->proto == AJP13_PROTO) 
  +    if (ae->proto == AJP13_PROTO) 
       	jk_dump_buff(l, JK_LOG_DEBUG, "received from ajp13", msg);
  -	else if (ae->proto == AJP14_PROTO)
  -		jk_dump_buff(l, JK_LOG_DEBUG, "received from ajp14", msg);
  -	
  +    else if (ae->proto == AJP14_PROTO)
  +	jk_dump_buff(l, JK_LOG_DEBUG, "received from ajp14", msg);
  +    
       return JK_TRUE;
   }
   
  @@ -968,6 +971,7 @@
   
           default:
   	        jk_log(l, JK_LOG_ERROR, "Error ajp_process_callback - Invalid code: %d\n", code);
  +		jk_dump_buff(l, JK_LOG_ERROR, "Message: ", msg);
   	        return JK_AJP13_ERROR;
       }
       
  @@ -1311,6 +1315,7 @@
                       }
                       JK_LEAVE_CS(&w->cs, rc);
                       if(i < w->ep_cache_sz) {
  +			jk_log(l, JK_LOG_DEBUG, "Return endpoint to pool\n");
                           return JK_TRUE;
                       }
                   }
  @@ -1353,6 +1358,7 @@
                   }
                   JK_LEAVE_CS(&aw->cs, rc);
                   if (ae) {
  +		    jk_log(l, JK_LOG_DEBUG, "Reusing endpoint\n");
                       *je = &ae->endpoint;
                       return JK_TRUE;
                   }
  
  
  

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


Mime
View raw message