cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.h

2005-09-14 Thread mturk
mturk   2005/09/13 23:45:00

  Modified:jk/native/common jk_ajp_common.c jk_connect.h
  Log:
  Make jk_sleep_def as nonstatic.
  
  Revision  ChangesPath
  1.120 +2 -2  
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.119
  retrieving revision 1.120
  diff -u -r1.119 -r1.120
  --- jk_ajp_common.c   26 May 2005 14:36:14 -  1.119
  +++ jk_ajp_common.c   14 Sep 2005 06:45:00 -  1.120
  @@ -36,7 +36,7 @@
   #endif
   
   /* Sleep for 100ms */
  -static void jk_sleep_def(void)
  +void jk_sleep_def(void)
   {
   #ifdef OS2
   DosSleep(100);
  
  
  
  1.16  +3 -1  jakarta-tomcat-connectors/jk/native/common/jk_connect.h
  
  Index: jk_connect.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- jk_connect.h  24 Apr 2005 09:52:57 -  1.15
  +++ jk_connect.h  14 Sep 2005 06:45:00 -  1.16
  @@ -55,6 +55,8 @@
   
   int jk_is_socket_connected(int sd);
   
  +void jk_sleep_def();
  +
   #ifdef __cplusplus
   }
   #endif  /* __cplusplus */
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-26 Thread mturk
mturk   2005/05/26 07:36:14

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Simplify cping/cpong input event.
  Set default socket buffer size to 8K.
  
  Revision  ChangesPath
  1.119 +19 -12
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.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- jk_ajp_common.c   19 May 2005 10:14:29 -  1.118
  +++ jk_ajp_common.c   26 May 2005 14:36:14 -  1.119
  @@ -766,27 +766,34 @@
   static int ajp_is_input_event(ajp_endpoint_t * ae, int timeout, jk_logger_t 
*l)
   {
   fd_set rset;
  -fd_set eset;
   struct timeval tv;
   int rc;
   
   FD_ZERO(rset);
  -FD_ZERO(eset);
   FD_SET(ae-sd, rset);
  -FD_SET(ae-sd, eset);
  -
   tv.tv_sec = timeout / 1000;
   tv.tv_usec = (timeout % 1000) * 1000;
   
  -rc = select(ae-sd + 1, rset, NULL, eset, tv);
  -
  -if ((rc  0) || (FD_ISSET(ae-sd, eset))) {
  +do {
  +rc = select(ae-sd + 1, rset, NULL, NULL, tv);
  +} while (rc  0  errno == EINTR);
  +
  +if (rc == 0) {
  +/* Timeout. Set the errno to timeout */
  +#if defined(WIN32) || (defined(NETWARE)  defined(__NOVELL_LIBC__))
  +errno = WSAETIMEDOUT - WSABASEERR;
  +#else
  +errno = ETIMEDOUT;
  +#endif
  +return JK_FALSE;
  +}
  +else if (rc  0) {
   jk_log(l, JK_LOG_WARNING,
  -   error during select [%d], rc);
  +   error during select err=%d, errno);
   return JK_FALSE;
   }
  -
  -return ((FD_ISSET(ae-sd, rset)) ? JK_TRUE : JK_FALSE);
  +else
  +return JK_TRUE;
   }
   
   
  @@ -1880,7 +1887,7 @@
   jk_get_worker_socket_timeout(props, p-name, 
AJP_DEF_SOCKET_TIMEOUT);
   
   p-socket_buf =
  -jk_get_worker_socket_buffer(props, p-name, 512);
  +jk_get_worker_socket_buffer(props, p-name, 8192);
   
   p-keepalive =
   jk_get_worker_socket_keepalive(props, p-name, JK_FALSE);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-19 Thread mturk
mturk   2005/05/19 03:14:29

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Change the log level for cping/cpong failrue. Those messages
  are informative rather then error.
  No functional change.
  
  Revision  ChangesPath
  1.118 +10 -8 
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.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- jk_ajp_common.c   18 May 2005 18:04:53 -  1.117
  +++ jk_ajp_common.c   19 May 2005 10:14:29 -  1.118
  @@ -781,7 +781,7 @@
   rc = select(ae-sd + 1, rset, NULL, eset, tv);
   
   if ((rc  0) || (FD_ISSET(ae-sd, eset))) {
  -jk_log(l, JK_LOG_ERROR,
  +jk_log(l, JK_LOG_WARNING,
  error during select [%d], rc);
   return JK_FALSE;
   }
  @@ -815,7 +815,7 @@
   /* wait for Pong reply for timeout milliseconds
*/
   if (ajp_is_input_event(ae, timeout, l) == JK_FALSE) {
  -jk_log(l, JK_LOG_ERROR, timeout in reply pong);
  +jk_log(l, JK_LOG_INFO, timeout in reply pong);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
  @@ -830,7 +830,7 @@
   }
   
   if ((cmd = jk_b_get_byte(msg)) != AJP13_CPONG_REPLY) {
  -jk_log(l, JK_LOG_ERROR,
  +jk_log(l, JK_LOG_INFO,
  awaited reply cpong, received %d instead,
  cmd);
   JK_TRACE_EXIT(l);
  @@ -853,10 +853,12 @@
   ae-worker-socket_timeout,
   ae-worker-socket_buf, l);
   if (ae-sd = 0) {
  -jk_log(l, JK_LOG_DEBUG,
  -   Connected socket %d to (%s),
  -   ae-sd, jk_dump_hinfo(ae-worker-worker_inet_addr, buf));
  -
  +if (JK_IS_DEBUG_LEVEL(l)) {
  +jk_log(l, JK_LOG_DEBUG,
  +   Connected socket %d to (%s),
  +   ae-sd,
  +   jk_dump_hinfo(ae-worker-worker_inet_addr, buf));
  +}
   /* set last_access only if needed */
   if (ae-worker-cache_timeout  0 || ae-worker-recycle_timeout  0)
   ae-last_access = time(NULL);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-15 Thread mturk
mturk   2005/05/15 05:07:27

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Log case if there is no free cache slot on ajp_done. This should
  never hapen at the first place, and should probably be removed.
  
  Revision  ChangesPath
  1.112 +8 -4  
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.111
  retrieving revision 1.112
  diff -u -r1.111 -r1.112
  --- jk_ajp_common.c   14 May 2005 10:05:42 -  1.111
  +++ jk_ajp_common.c   15 May 2005 12:07:27 -  1.112
  @@ -2074,10 +2074,14 @@
   JK_TRACE_EXIT(l);
   return JK_TRUE;
   }
  -jk_log(l, JK_LOG_INFO,
  -could not find empty cache slot from %d for worker %s
  -. Rise worker cachesize,
  +/* XXX: This should never hapen because
  + * there is always free empty cache slot
  + */
  +jk_log(l, JK_LOG_ERROR,
  +could not find empty cache slot from %d for worker %s,
   w-ep_cache_sz, w-name);
  +JK_TRACE_EXIT(l);
  +return JK_FALSE;
   }
   
   jk_log(l, JK_LOG_ERROR,
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-15 Thread mturk
mturk   2005/05/15 06:40:02

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Use info level for cping/cpong messages. Also select might return 0
  meaning that the socket has been closed in the middle of select operation,
  so do not log that as error.
  
  Revision  ChangesPath
  1.113 +3 -3  
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.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- jk_ajp_common.c   15 May 2005 12:07:27 -  1.112
  +++ jk_ajp_common.c   15 May 2005 13:40:02 -  1.113
  @@ -780,7 +780,7 @@
   
   rc = select(ae-sd + 1, rset, NULL, eset, tv);
   
  -if ((rc  1) || (FD_ISSET(ae-sd, eset))) {
  +if ((rc  0) || (FD_ISSET(ae-sd, eset))) {
   jk_log(l, JK_LOG_ERROR,
  error during select [%d], rc);
   return JK_FALSE;
  @@ -806,7 +806,7 @@
   
   /* Send CPing query */
   if (ajp_connection_tcp_send_message(ae, msg, l) != JK_TRUE) {
  -jk_log(l, JK_LOG_ERROR,
  +jk_log(l, JK_LOG_INFO,
  can't send cping query);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
  @@ -823,7 +823,7 @@
   /* Read and check for Pong reply
*/
   if (ajp_connection_tcp_get_message(ae, msg, l) != JK_TRUE) {
  -jk_log(l, JK_LOG_ERROR,
  +jk_log(l, JK_LOG_INFO,
  awaited reply cpong, not received);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-15 Thread mturk
mturk   2005/05/15 09:25:38

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Differentiate logging when trying next connection.
  
  Revision  ChangesPath
  1.114 +8 -5  
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.113
  retrieving revision 1.114
  diff -u -r1.113 -r1.114
  --- jk_ajp_common.c   15 May 2005 13:40:02 -  1.113
  +++ jk_ajp_common.c   15 May 2005 16:25:38 -  1.114
  @@ -1201,12 +1201,15 @@
* loop. */
   if (err ||
   ((rc = ajp_connection_tcp_send_message(ae, op-request, l)) != 
JK_TRUE)) {
  -jk_log(l, JK_LOG_INFO,
  -   Error sending request. Will try another pooled 
connection);
  -if (rc != JK_FATAL_ERROR)
  +if (rc != JK_FATAL_ERROR) {
  +jk_log(l, JK_LOG_INFO,
  +   Error sending request. Will try another pooled 
connection);
   ajp_next_connection(ae, l);
  +}
   else {
   op-recoverable = JK_FALSE;
  +jk_log(l, JK_LOG_INFO,
  +   Error sending request. Unrecoverable operation);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
  @@ -1498,7 +1501,7 @@
   /* we just can't recover, unset recover flag */
   if (headeratclient == JK_FALSE) {
   jk_log(l, JK_LOG_ERROR,
  -   Tomcat is down or network problems. 
  +   Tomcat is down or refused connection. 
  No response has been sent to the client (yet));
   /*
* communication with tomcat has been interrupted BEFORE
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-15 Thread mturk
mturk   2005/05/15 09:38:04

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Remove checking if socket is connected after the connect call.
  
  Revision  ChangesPath
  1.115 +1 -13 
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.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- jk_ajp_common.c   15 May 2005 16:25:38 -  1.114
  +++ jk_ajp_common.c   15 May 2005 16:38:04 -  1.115
  @@ -860,18 +860,6 @@
   /* set last_access only if needed */
   if (ae-worker-cache_timeout  0 || ae-worker-recycle_timeout  0)
   ae-last_access = time(NULL);
  -if (ae-worker-socket_timeout  0) {
  -if (!jk_is_socket_connected(ae-sd)) {
  -jk_log(l, JK_LOG_INFO,
  -   Socket %d to (%s) is not connected any more 
(errno=%d),
  -   ae-sd, jk_dump_hinfo(ae-worker-worker_inet_addr, 
buf),
  -   errno);
  -jk_close_socket(ae-sd);
  -ae-sd = -1;
  -JK_TRACE_EXIT(l);
  -return JK_FALSE;
  -}
  -}
   /* Check if we must execute a logon after the physical connect */
   if (ae-worker-logon != NULL) {
   rc = ae-worker-logon(ae, l);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-15 Thread mturk
mturk   2005/05/15 10:06:05

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Replace all 'unsigned' with 'unsigned int'. No functional change, just
  being ANSI C conformant.
  
  Revision  ChangesPath
  1.116 +7 -7  
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.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- jk_ajp_common.c   15 May 2005 16:38:04 -  1.115
  +++ jk_ajp_common.c   15 May 2005 17:06:05 -  1.116
  @@ -634,7 +634,7 @@
   d-header_values = jk_pool_alloc(p, sizeof(char *) * d-num_headers);
   
   if (d-header_names  d-header_values) {
  -unsigned i;
  +unsigned int i;
   for (i = 0; i  d-num_headers; i++) {
   unsigned short name = jk_b_pget_int(msg, msg-pos);
   
  @@ -1043,10 +1043,10 @@
*/
   
   static int ajp_read_fully_from_server(jk_ws_service_t *s, jk_logger_t *l,
  -  unsigned char *buf, unsigned len)
  +  unsigned char *buf, unsigned int len)
   {
  -unsigned rdlen = 0;
  -unsigned padded_len = len;
  +unsigned int rdlen = 0;
  +unsigned int padded_len = len;
   
   JK_TRACE_ENTER(l);
   if (s-is_chunked  s-no_more_chunks) {
  @@ -1063,7 +1063,7 @@
   }
   
   while (rdlen  padded_len) {
  -unsigned this_time = 0;
  +unsigned int this_time = 0;
   if (!s-read(s, buf + rdlen, len - rdlen, this_time)) {
   /* Remote Client read failed. */
   JK_TRACE_EXIT(l);
  @@ -1370,7 +1370,7 @@
   
   case JK_AJP13_SEND_BODY_CHUNK:
   {
  -unsigned len = (unsigned)jk_b_get_int(msg);
  +unsigned int len = (unsigned int)jk_b_get_int(msg);
   if (!r-write(r, msg-buf + msg-pos, len)) {
   jk_log(l, JK_LOG_INFO,
  Connection aborted or network problems);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-14 Thread mturk
mturk   2005/05/14 03:05:42

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Update last_access on done too.
  
  Revision  ChangesPath
  1.111 +4 -1  
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.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- jk_ajp_common.c   13 May 2005 07:19:32 -  1.110
  +++ jk_ajp_common.c   14 May 2005 10:05:42 -  1.111
  @@ -2060,6 +2060,9 @@
   }
   ajp_reset_endpoint(p, l);
   *e = NULL;
  +/* set last_access only if needed */
  +if (w-cache_timeout  0 || w-recycle_timeout  0)
  +p-last_access = time(NULL); 
   JK_LEAVE_CS(w-cs, rc);
   if (sock = 0)
   jk_shutdown_socket(sock);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-13 Thread mturk
mturk   2005/05/13 00:19:32

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Log as warning when there is no free endpoint pool entiries free.
  
  Revision  ChangesPath
  1.110 +7 -2  
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.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- jk_ajp_common.c   6 May 2005 13:59:34 -   1.109
  +++ jk_ajp_common.c   13 May 2005 07:19:32 -  1.110
  @@ -2055,10 +2055,10 @@
   for(i = w-ep_cache_sz - 1; i = 0; i--) {
   if (w-ep_cache[i] == NULL) {
   w-ep_cache[i] = p;
  -ajp_reset_endpoint(p, l);
   break;
   }
   }
  +ajp_reset_endpoint(p, l);
   *e = NULL;
   JK_LEAVE_CS(w-cs, rc);
   if (sock = 0)
  @@ -2124,6 +2124,11 @@
   JK_TRACE_EXIT(l);
   return JK_TRUE;
   }
  +else {
  +jk_log(l, JK_LOG_WARNING,
  +Unable to get the free endpoint for worker %s from 
%d slots,
  +aw-name, aw-ep_cache_sz);
  +}
   JK_LEAVE_CS(aw-cs, rc);
   }
   else {
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-06 Thread mturk
mturk   2005/05/06 06:49:32

  Modified:jk/native/common jk_ajp_common.c
  Log:
  If tomcat closes the connection after sending initial request, do not log that
  as error, because probably the 'secret' has been rejected.
  
  Revision  ChangesPath
  1.108 +14 -6 
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.107
  retrieving revision 1.108
  diff -u -r1.107 -r1.108
  --- jk_ajp_common.c   27 Apr 2005 14:12:48 -  1.107
  +++ jk_ajp_common.c   6 May 2005 13:49:32 -   1.108
  @@ -960,11 +960,19 @@
   rc = jk_tcp_socket_recvfull(ae-sd, head, AJP_HEADER_LEN);
   
   if (rc  0) {
  -jk_log(l, JK_LOG_ERROR,
  -   ERROR: can't receive the response message from tomcat, 
  -   network problems or tomcat is down (%s), err=%d,
  -   jk_dump_hinfo(ae-worker-worker_inet_addr, buf), rc);
  -JK_TRACE_EXIT(l);
  +if (rc == JK_SOCKET_EOF) {
  +jk_log(l, JK_LOG_INFO,
  +   Tomcat has forced a connection close for socket %d,
  +   ae-sd);
  +JK_TRACE_EXIT(l);
  +}
  +else {
  +jk_log(l, JK_LOG_ERROR,
  +   Can't receive the response message from tomcat, 
  +   network problems or tomcat is down (%s), err=%d,
  +   jk_dump_hinfo(ae-worker-worker_inet_addr, buf), rc);
  + JK_TRACE_EXIT(l);
  +}
   return JK_FALSE;
   }
   ae-endpoint.rd += rc;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-05-06 Thread mturk
mturk   2005/05/06 06:59:34

  Modified:jk/native/common jk_ajp_common.c
  Log:
  No need to check the proto because it can only be ajp13 or ajp14,
  when the worker is created.
  
  Revision  ChangesPath
  1.109 +1 -7  
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.108
  retrieving revision 1.109
  diff -u -r1.108 -r1.109
  --- jk_ajp_common.c   6 May 2005 13:49:32 -   1.108
  +++ jk_ajp_common.c   6 May 2005 13:59:34 -   1.109
  @@ -950,12 +950,6 @@
   char buf[32];
   
   JK_TRACE_ENTER(l);
  -if ((ae-proto != AJP13_PROTO)  (ae-proto != AJP14_PROTO)) {
  -jk_log(l, JK_LOG_ERROR,
  -   Can't handle unknown protocol %d, ae-proto);
  -JK_TRACE_EXIT(l);
  -return JK_FALSE;
  -}
   
   rc = jk_tcp_socket_recvfull(ae-sd, head, AJP_HEADER_LEN);
   
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-04-27 Thread mturk
mturk   2005/04/26 23:38:59

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Added missing ACL method.
  
  Revision  ChangesPath
  1.103 +5 -1  
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.102
  retrieving revision 1.103
  diff -u -r1.102 -r1.103
  --- jk_ajp_common.c   24 Apr 2005 09:54:47 -  1.102
  +++ jk_ajp_common.c   27 Apr 2005 06:38:59 -  1.103
  @@ -100,6 +100,10 @@
   case 3:
   switch (method[0])
   {
  +case 'A':
  +return (method[1] == 'C'
  + method[2] == 'L'
  +? SC_M_ACL : UNKNOWN_METHOD);
   case 'P':
   return (method[1] == 'U'
method[2] == 'T'
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-04-27 Thread mturk
mturk   2005/04/27 00:07:08

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Be more verbose logging socket maintain.
  
  Revision  ChangesPath
  1.104 +12 -4 
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.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- jk_ajp_common.c   27 Apr 2005 06:38:59 -  1.103
  +++ jk_ajp_common.c   27 Apr 2005 07:07:08 -  1.104
  @@ -2150,7 +2150,7 @@
   }
   JK_ENTER_CS(aw-cs, rc);
   if (rc) {
  -unsigned int i;
  +unsigned int i, n = 0;
   /* Handle worker cache and recycle timeouts */
   for (i = 0; i  aw-ep_cache_sz; i++) {
   /* Skip the closed sockets */
  @@ -2158,15 +2158,23 @@
   int elapsed = (int)difftime(now, 
aw-ep_cache[i]-last_access);
   if (((aw-cache_timeout  0)  (elapsed  
aw-cache_timeout)) ||
   ((aw-recycle_timeout  0)  (elapsed  
aw-recycle_timeout))) {
  +time_t rt = 0;
  +n++;
  +if (JK_IS_DEBUG_LEVEL(l))
  +rt = time(NULL);
   aw-ep_cache[i]-reuse = JK_FALSE;
   ajp_reset_endpoint(aw-ep_cache[i], l);
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  -cleaning cache slot=%d elapsed %u,
  -i, elapsed);
  +cleaning cache slot=%d elapsed %u in 
%d,
  +i, elapsed, (int)(difftime(time(NULL), 
rt)));
   }
   }
   }
  +if (JK_IS_DEBUG_LEVEL(l))
  +jk_log(l, JK_LOG_DEBUG,
  +recycled %u sockets in %d seconds,
  +n, (int)(difftime(time(NULL), now)));
   JK_LEAVE_CS(aw-cs, rc);
   JK_TRACE_EXIT(l);
   return JK_TRUE;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-04-27 Thread mturk
mturk   2005/04/27 00:17:46

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add SEARCH method too. Also missing like ACL.
  
  Revision  ChangesPath
  1.105 +4 -1  
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.104
  retrieving revision 1.105
  diff -u -r1.104 -r1.105
  --- jk_ajp_common.c   27 Apr 2005 07:07:08 -  1.104
  +++ jk_ajp_common.c   27 Apr 2005 07:17:46 -  1.105
  @@ -185,6 +185,9 @@
   case 'R':
   return (memcmp(method, REPORT, 6) == 0
   ? SC_M_REPORT : UNKNOWN_METHOD);
  +case 'S':
  +return (memcmp(method, SEARCH, 6) == 0
  +? SC_M_SEARCH : UNKNOWN_METHOD);
   case 'D':
   return (memcmp(method, DELETE, 6) == 0
   ? SC_M_DELETE : UNKNOWN_METHOD);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_ajp_common.h

2005-04-27 Thread mturk
mturk   2005/04/27 07:12:48

  Modified:jk/native/common jk_ajp_common.c jk_ajp_common.h
  Log:
  Also set the SC_A_STORED_METHOD when passing arbitrary
  request methods as attributes.
  
  Revision  ChangesPath
  1.107 +3 -2  
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.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- jk_ajp_common.c   27 Apr 2005 14:06:17 -  1.106
  +++ jk_ajp_common.c   27 Apr 2005 14:12:48 -  1.107
  @@ -532,7 +532,8 @@
   if (method == SC_M_JK_STORED) {
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG, unknown method %s, s-method);
  -if (jk_b_append_string(msg, s-method)) {
  +if (jk_b_append_byte(msg, SC_A_STORED_METHOD) ||
  +jk_b_append_string(msg, s-method)) {
   jk_log(l, JK_LOG_ERROR,
  failed appending the request method);
   JK_TRACE_EXIT(l);
  
  
  
  1.34  +2 -1  
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h
  
  Index: jk_ajp_common.h
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- jk_ajp_common.h   27 Apr 2005 14:06:17 -  1.33
  +++ jk_ajp_common.h   27 Apr 2005 14:12:48 -  1.34
  @@ -49,6 +49,7 @@
   #define SC_A_REQ_ATTRIBUTE  (unsigned char)10
   #define SC_A_SSL_KEY_SIZE   (unsigned char)11   /* only in if 
JkOptions +ForwardKeySize */
   #define SC_A_SECRET (unsigned char)12
  +#define SC_A_STORED_METHOD  (unsigned char)13
   #define SC_A_ARE_DONE   (unsigned char)0xFF
   
   /*
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_global.h jk_lb_worker.c

2005-04-21 Thread mturk
mturk   2005/04/21 04:18:44

  Modified:jk/native/common jk_ajp_common.c jk_global.h jk_lb_worker.c
  Log:
  Make sure the returned status codes are the same for ajp and lb
  workers.
  Status 503 if connection to tomcat fails.
  Status 502 is returned if tomcat faild in the middle of request.
  Status 400 is returned if client made faulty request
  Status 413 is returned if the headers are too large.
  Status 500 is returned in case of any other error.
  
  Revision  ChangesPath
  1.97  +7 -6  
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.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- jk_ajp_common.c   11 Apr 2005 06:51:36 -  1.96
  +++ jk_ajp_common.c   21 Apr 2005 11:18:44 -  1.97
  @@ -1605,12 +1605,12 @@
   
   JK_TRACE_ENTER(l);
   
  +if (is_error)
  +*is_error = JK_HTTP_SERVER_ERROR;
  +
   if (e  e-endpoint_private  s  is_error) {
   ajp_endpoint_t *p = e-endpoint_private;
   op-request = jk_b_new((p-pool));
  -/* Presume there will be no errors */
  -*is_error = JK_HTTP_OK;
  -
   jk_b_set_buffer_size(op-request, DEF_BUFFER_SZ);
   jk_b_reset(op-request);
   
  @@ -1674,6 +1674,7 @@
   
   err = ajp_get_reply(e, s, l, p, op);
   if (err == JK_TRUE) {
  +*is_error = JK_HTTP_OK;
   /* Done with the request */
   JK_TRACE_EXIT(l);
   return JK_TRUE;
  @@ -1686,7 +1687,7 @@
* operation is no more recoverable
*/
   if (!op-recoverable) {
  -*is_error = JK_HTTP_SERVER_ERROR;
  +*is_error = JK_HTTP_BAD_GATEWAY;
   jk_log(l, JK_LOG_ERROR,
  receiving reply from tomcat failed 
  without recovery in send loop %d, i);
  @@ -1728,7 +1729,7 @@
   /* Get another connection from the pool and try again */
   ajp_next_connection(p, l);
   }
  -
  +*is_error = JK_HTTP_SERVER_BUSY;
   /* Log the error only once per failed request. */
   jk_log(l, JK_LOG_ERROR,
  Error connecting to tomcat. Tomcat is probably not started 
  
  
  
  1.47  +9 -6  jakarta-tomcat-connectors/jk/native/common/jk_global.h
  
  Index: jk_global.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_global.h,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- jk_global.h   26 Mar 2005 09:28:56 -  1.46
  +++ jk_global.h   21 Apr 2005 11:18:44 -  1.47
  @@ -174,11 +174,14 @@
   /* HTTP Error codes
*/
   
  -#define JK_HTTP_OK  200
  -#define JK_HTTP_BAD_REQUEST 400
  -#define JK_REQUEST_TOO_LARGE413
  -#define JK_HTTP_SERVER_ERROR500
  -#define JK_HTTP_SERVER_BUSY 503
  +#define JK_HTTP_OK   200
  +#define JK_HTTP_BAD_REQUEST  400
  +#define JK_REQUEST_TOO_LARGE 413
  +#define JK_HTTP_SERVER_ERROR 500
  +#define JK_HTTP_NOT_IMPLEMENTED  501
  +#define JK_HTTP_BAD_GATEWAY  502
  +#define JK_HTTP_SERVER_BUSY  503
  +#define JK_HTTP_GATEWAY_TIME_OUT 504
   
   
   /*
  
  
  
  1.77  +3 -3  jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c
  
  Index: jk_lb_worker.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- jk_lb_worker.c13 Apr 2005 12:40:03 -  1.76
  +++ jk_lb_worker.c21 Apr 2005 11:18:44 -  1.77
  @@ -668,7 +668,7 @@
   jk_log(l, JK_LOG_ERROR,
  All tomcat instances failed, no more workers left);
   JK_TRACE_EXIT(l);
  -*is_error = JK_HTTP_SERVER_ERROR;
  +*is_error = JK_HTTP_SERVER_BUSY;
   return JK_FALSE;
   }
   --num_of_workers;
  @@ -677,7 +677,7 @@
   jk_log(l, JK_LOG_INFO,
  All tomcat instances are busy or in error state);
   JK_TRACE_EXIT(l);
  -/* Set error to Server busy */
  +/* Set error to Timeout */
   *is_error = JK_HTTP_SERVER_BUSY;
   return JK_FALSE;
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.c jk_connect.h

2005-04-21 Thread mturk
mturk   2005/04/21 04:36:29

  Modified:jk/native/common jk_ajp_common.c jk_connect.c jk_connect.h
  Log:
  Remove unused timeout parameter for testing if socket is connected.
  
  Revision  ChangesPath
  1.98  +3 -3  
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.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- jk_ajp_common.c   21 Apr 2005 11:18:44 -  1.97
  +++ jk_ajp_common.c   21 Apr 2005 11:36:29 -  1.98
  @@ -847,7 +847,7 @@
   if (ae-worker-cache_timeout  0 || ae-worker-recycle_timeout 
 0)
   ae-last_access = time(NULL);
   if (ae-worker-socket_timeout  0) {
  -if (!jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) {
  +if (!jk_is_socket_connected(ae-sd)) {
   jk_log(l, JK_LOG_INFO,
  Socket is not connected any more (errno=%d), 
errno);
   jk_close_socket(ae-sd);
  @@ -1160,7 +1160,7 @@
   while ((ae-sd  0)) {
   err = 0;
   if (ae-worker-socket_timeout) {
  -if (!jk_is_socket_connected(ae-sd, ae-worker-socket_timeout)) 
{
  +if (!jk_is_socket_connected(ae-sd)) {
   jk_log(l, JK_LOG_INFO,
  Socket is not connected any more (errno=%d), errno);
   jk_close_socket(ae-sd);
  
  
  
  1.53  +2 -8  jakarta-tomcat-connectors/jk/native/common/jk_connect.c
  
  Index: jk_connect.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- jk_connect.c  13 Apr 2005 11:12:38 -  1.52
  +++ jk_connect.c  21 Apr 2005 11:36:29 -  1.53
  @@ -548,18 +548,12 @@
   return buf;
   }
   
  -int jk_is_socket_connected(int sd, int timeout)
  +int jk_is_socket_connected(int sd)
   {
   fd_set fd;
   struct timeval tv;
   int rc;
   
  -/* socket_timeout is unused in select implemention
  - * If we change this to non blocking read, then we
  - * will use the timeout parameter.
  - */
  - timeout = 0;
  - 
   FD_ZERO(fd);
   FD_SET(sd, fd);
   
  
  
  
  1.14  +2 -2  jakarta-tomcat-connectors/jk/native/common/jk_connect.h
  
  Index: jk_connect.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- jk_connect.h  17 Feb 2005 07:09:27 -  1.13
  +++ jk_connect.h  21 Apr 2005 11:36:29 -  1.14
  @@ -51,7 +51,7 @@
   
   char *jk_dump_hinfo(struct sockaddr_in *saddr, char *buf);
   
  -int jk_is_socket_connected(int sd, int timeout);
  +int jk_is_socket_connected(int sd);
   
   #ifdef __cplusplus
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-04-21 Thread mturk
mturk   2005/04/21 04:41:06

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix bug in check next connection loop, by resetting test value to 0
  for each socket.
  
  Revision  ChangesPath
  1.99  +3 -2  
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.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- jk_ajp_common.c   21 Apr 2005 11:36:29 -  1.98
  +++ jk_ajp_common.c   21 Apr 2005 11:41:06 -  1.99
  @@ -1148,7 +1148,7 @@
   ajp_endpoint_t * ae, ajp_operation_t * op)
   {
   int err = 0;
  -int postlen, rc = 0;
  +int postlen;
   
   JK_TRACE_ENTER(l);
   /* Up to now, we can recover */
  @@ -1158,6 +1158,7 @@
* First try to reuse open connections...
*/
   while ((ae-sd  0)) {
  +int rc = 0;
   err = 0;
   if (ae-worker-socket_timeout) {
   if (!jk_is_socket_connected(ae-sd)) {
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-04-21 Thread mturk
mturk   2005/04/21 04:51:07

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Close the socket only if the lock can be obtained.
  
  Revision  ChangesPath
  1.100 +5 -4  
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.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- jk_ajp_common.c   21 Apr 2005 11:41:06 -  1.99
  +++ jk_ajp_common.c   21 Apr 2005 11:51:06 -  1.100
  @@ -729,19 +729,20 @@
   JK_ENTER_CS(aw-cs, rc);
   if (rc) {
   unsigned int i;
  -/* Close existing endpoint socket */
  +/* Mark existing endpoint socket as closed */
   ae-sd = -1;
   for (i = 0; i  aw-ep_cache_sz; i++) {
   /* Find cache slot with usable socket */
  -if (aw-ep_cache[i]  aw-ep_cache[i]-sd  0) {
  +if (aw-ep_cache[i]  aw-ep_cache[i]-sd != -1) {
   ae-sd = aw-ep_cache[i]-sd;
  - aw-ep_cache[i]-sd = -1;
  +aw-ep_cache[i]-sd = -1;
   break;
   }
   }
   JK_LEAVE_CS(aw-cs, rc);
  +/* Close previous socket */
  +jk_close_socket(sock);
   }
  -jk_close_socket(sock);
   }
   
   /*
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_msg_buff.c jk_msg_buff.h

2005-04-21 Thread mturk
mturk   2005/04/21 05:04:18

  Modified:jk/native/common jk_ajp_common.c jk_msg_buff.c jk_msg_buff.h
  Log:
  Make jk_msg_buf_t structure public to skip the need for calling functions
  for accessing structure elements.
  
  Revision  ChangesPath
  1.101 +16 -16
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.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- jk_ajp_common.c   21 Apr 2005 11:51:06 -  1.100
  +++ jk_ajp_common.c   21 Apr 2005 12:04:18 -  1.101
  @@ -621,7 +621,7 @@
   if (d-header_names  d-header_values) {
   unsigned i;
   for (i = 0; i  d-num_headers; i++) {
  -unsigned short name = jk_b_pget_int(msg, jk_b_get_pos(msg));
  +unsigned short name = jk_b_pget_int(msg, msg-pos);
   
   if ((name  0XFF00) == 0XA000) {
   jk_b_get_int(msg);
  @@ -910,9 +910,9 @@
   return JK_FATAL_ERROR;
   }
   
  -if ((rc = jk_tcp_socket_sendfull(ae-sd, jk_b_get_buff(msg),
  - jk_b_get_len(msg)))  0) {
  -ae-endpoint.wr += jk_b_get_len(msg);
  +if ((rc = jk_tcp_socket_sendfull(ae-sd, msg-buf,
  + msg-len))  0) {
  +ae-endpoint.wr += msg-len;
   JK_TRACE_EXIT(l);
   return JK_TRUE;
   }
  @@ -997,19 +997,19 @@
   msglen = ((head[2]  0xff)  8);
   msglen += (head[3]  0xFF);
   
  -if (msglen  jk_b_get_size(msg)) {
  +if (msglen  msg-maxlen) {
   jk_log(l, JK_LOG_ERROR,
  wrong message size %d %d from %s,
  -   msglen, jk_b_get_size(msg),
  +   msglen, msg-maxlen,
  jk_dump_hinfo(ae-worker-worker_inet_addr, buf));
   JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   
  -jk_b_set_len(msg, msglen);
  -jk_b_set_pos(msg, 0);
  +msg-len = msglen;
  +msg-pos = 0;
   
  -rc = jk_tcp_socket_recvfull(ae-sd, jk_b_get_buff(msg), msglen);
  +rc = jk_tcp_socket_recvfull(ae-sd, msg-buf, msglen);
   if (rc  0) {
   jk_log(l, JK_LOG_ERROR,
  ERROR: can't receive the response message from tomcat, 
  @@ -1089,7 +1089,7 @@
 jk_ws_service_t *r,
 jk_msg_buf_t *msg, int len, jk_logger_t *l)
   {
  -unsigned char *read_buf = jk_b_get_buff(msg);
  +unsigned char *read_buf = msg-buf;
   
   JK_TRACE_ENTER(l);
   jk_b_reset(msg);
  @@ -1125,7 +1125,7 @@
   }
   }
   
  -jk_b_set_len(msg, jk_b_get_len(msg) + len);
  +msg-len += len;
   
   JK_TRACE_EXIT(l);
   return len;
  @@ -1241,7 +1241,7 @@
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  request body to send %d - request body to resend %d,
  -   ae-left_bytes_to_send, jk_b_get_len(op-reply) - 
AJP_HEADER_LEN);
  +   ae-left_bytes_to_send, op-reply-len - AJP_HEADER_LEN);
   
   /*
* POST recovery job is done here and will work when data to 
  @@ -1252,7 +1252,7 @@
   
   /* Did we have something to resend (ie the op-post has been feeded 
previously */
   
  -postlen = jk_b_get_len(op-post);
  +postlen = op-post-len;
   if (postlen  AJP_HEADER_LEN) {
   if (ajp_connection_tcp_send_message(ae, op-post, l) != JK_TRUE) {
   jk_log(l, JK_LOG_ERROR, Error resending request body (%d),
  @@ -1268,7 +1268,7 @@
   }
   else if (s-reco_status == RECO_FILLED) {
   /* Recovery in LB MODE */
  -postlen = jk_b_get_len(s-reco_buf);
  +postlen = s-reco_buf-len;
   
   if (postlen  AJP_HEADER_LEN) {
   if (ajp_connection_tcp_send_message(ae, s-reco_buf, l) != 
JK_TRUE) {
  @@ -1361,7 +1361,7 @@
   case JK_AJP13_SEND_BODY_CHUNK:
   {
   unsigned len = (unsigned)jk_b_get_int(msg);
  -if (!r-write(r, jk_b_get_buff(msg) + jk_b_get_pos(msg), len)) {
  +if (!r-write(r, msg-buf + msg-pos, len)) {
   jk_log(l, JK_LOG_INFO,
  Connection aborted or network problems);
   JK_TRACE_EXIT(l);
  
  
  
  1.29  +1 -41 jakarta-tomcat-connectors/jk/native/common/jk_msg_buff.c
  
  Index: jk_msg_buff.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_msg_buff.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- jk_msg_buff.c 16 Feb 2005 11:42:46 -  1.28
  +++ jk_msg_buff.c 21 Apr 2005 12:04:18 -  1.29
  @@ -29,16 +29,6 @@
   #include jk_msg_buff.h
   #include 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_status.c

2005-04-11 Thread mturk
mturk   2005/04/10 23:51:36

  Modified:jk/native/common jk_ajp_common.c jk_status.c
  Log:
  Fix compile time warnings about missing declarations.
  
  Revision  ChangesPath
  1.96  +7 -7  
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.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- jk_ajp_common.c   26 Mar 2005 09:28:56 -  1.95
  +++ jk_ajp_common.c   11 Apr 2005 06:51:36 -  1.96
  @@ -36,7 +36,7 @@
   #endif
   
   /* Sleep for 100ms */
  -static void jk_sleep_def()
  +static void jk_sleep_def(void)
   {
   #ifdef OS2
   DosSleep(100);
  @@ -747,7 +747,7 @@
   /*
* Wait input event on ajp_endpoint for timeout ms
*/
  -int ajp_is_input_event(ajp_endpoint_t * ae, int timeout, jk_logger_t *l)
  +static int ajp_is_input_event(ajp_endpoint_t * ae, int timeout, jk_logger_t 
*l)
   {
   fd_set rset;
   fd_set eset;
  @@ -777,7 +777,7 @@
   /*
* Handle the CPING/CPONG initial query
*/
  -int ajp_handle_cping_cpong(ajp_endpoint_t * ae, int timeout, jk_logger_t *l)
  +static int ajp_handle_cping_cpong(ajp_endpoint_t * ae, int timeout, 
jk_logger_t *l)
   {
   int cmd;
   jk_msg_buf_t *msg;
  @@ -1595,9 +1595,9 @@
* We serve here the request, using AJP13/AJP14 (e-proto)
*
*/
  -int JK_METHOD ajp_service(jk_endpoint_t *e,
  -  jk_ws_service_t *s,
  -  jk_logger_t *l, int *is_error)
  +static int JK_METHOD ajp_service(jk_endpoint_t *e,
  + jk_ws_service_t *s,
  + jk_logger_t *l, int *is_error)
   {
   int i, err;
   ajp_operation_t oper;
  
  
  
  1.36  +3 -3  jakarta-tomcat-connectors/jk/native/common/jk_status.c
  
  Index: jk_status.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_status.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- jk_status.c   26 Mar 2005 14:20:48 -  1.35
  +++ jk_status.c   11 Apr 2005 06:51:36 -  1.36
  @@ -129,7 +129,7 @@
   }
   #endif
   
  -int jk_printf(jk_ws_service_t *s, const char *fmt, ...)
  +static int jk_printf(jk_ws_service_t *s, const char *fmt, ...)
   {
   int rc = 0;
   va_list args;
  @@ -166,7 +166,7 @@
   }
   
   /* Actually APR's apr_strfsize */
  -char *status_strfsize(size_t size, char *buf)
  +static char *status_strfsize(size_t size, char *buf)
   {
   const char ord[] = KMGTPE;
   const char *o = ord;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-03-26 Thread mturk
mturk   2005/03/26 00:42:14

  Modified:jk/native/common jk_ajp_common.c
  Log:
  In case there is an error in marshaling initial data return that as client
  error not as server error.
  
  Revision  ChangesPath
  1.94  +38 -19
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.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- jk_ajp_common.c   22 Feb 2005 10:27:37 -  1.93
  +++ jk_ajp_common.c   26 Mar 2005 08:42:14 -  1.94
  @@ -906,7 +906,7 @@
   jk_log(l, JK_LOG_ERROR,
  unknown protocol %d, supported are AJP13/AJP14, ae-proto);
   JK_TRACE_EXIT(l);
  -return JK_FALSE;
  +return JK_FATAL_ERROR;
   }
   
   if ((rc = jk_tcp_socket_sendfull(ae-sd, jk_b_get_buff(msg),
  @@ -1103,7 +1103,7 @@
   
   if ((len = ajp_read_fully_from_server(r, l, read_buf, len))  0) {
   jk_log(l, JK_LOG_INFO,
  -   ERROR: receiving data from client failed. 
  +   Error receiving data from client failed. 
  Connection aborted or network problems);
   JK_TRACE_EXIT(l);
   return JK_CLIENT_ERROR;
  @@ -1148,7 +1148,7 @@
   ajp_endpoint_t * ae, ajp_operation_t * op)
   {
   int err = 0;
  -int postlen;
  +int postlen, rc = 0;
   
   JK_TRACE_ENTER(l);
   /* Up to now, we can recover */
  @@ -1182,10 +1182,16 @@
* connection and try again.  If we are succesful, break out of this
* loop. */
   if (err ||
  -(ajp_connection_tcp_send_message(ae, op-request, l) == 
JK_FALSE)) {
  +((rc = ajp_connection_tcp_send_message(ae, op-request, l)) != 
JK_TRUE)) {
   jk_log(l, JK_LOG_INFO,
  Error sending request. Will try another pooled 
connection);
  -ajp_next_connection(ae, l);
  +if (rc != JK_FATAL_ERROR)
  +ajp_next_connection(ae, l);
  +else {
  +op-recoverable = JK_FALSE;
  +JK_TRACE_EXIT(l);
  +return JK_FALSE;
  +}
   }
   else
   break;
  @@ -1210,7 +1216,7 @@
* After we are connected, each error that we are going to
* have is probably unrecoverable
*/
  -if (ajp_connection_tcp_send_message(ae, op-request, l) == 
JK_FALSE) {
  +if (ajp_connection_tcp_send_message(ae, op-request, l) != 
JK_TRUE) {
   jk_log(l, JK_LOG_INFO,
  Error sending request on a fresh connection);
   JK_TRACE_EXIT(l);
  @@ -1246,7 +1252,7 @@
   
   postlen = jk_b_get_len(op-post);
   if (postlen  AJP_HEADER_LEN) {
  -if (ajp_connection_tcp_send_message(ae, op-post, l) == JK_FALSE) {
  +if (ajp_connection_tcp_send_message(ae, op-post, l) != JK_TRUE) {
   jk_log(l, JK_LOG_ERROR, Error resending request body (%d),
  postlen);
   JK_TRACE_EXIT(l);
  @@ -1263,7 +1269,7 @@
   postlen = jk_b_get_len(s-reco_buf);
   
   if (postlen  AJP_HEADER_LEN) {
  -if (ajp_connection_tcp_send_message(ae, s-reco_buf, l) == 
JK_FALSE) {
  +if (ajp_connection_tcp_send_message(ae, s-reco_buf, l) != 
JK_TRUE) {
   jk_log(l, JK_LOG_ERROR,
  Error resending request body (lb mode) (%d),
  postlen);
  @@ -1300,7 +1306,7 @@
   /* the browser stop sending data, no need to recover */
   op-recoverable = JK_FALSE;
   JK_TRACE_EXIT(l);
  -return JK_CLIENT_ERROR;
  +return len;
   }
   
   /* If a RECOVERY buffer is available in LB mode, fill it */
  @@ -1310,7 +1316,7 @@
   }
   
   s-content_read = len;
  -if (ajp_connection_tcp_send_message(ae, op-post, l) == 
JK_FALSE) {
  +if (ajp_connection_tcp_send_message(ae, op-post, l) != JK_TRUE) 
{
   jk_log(l, JK_LOG_ERROR, Error sending request body);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
  @@ -1621,7 +1627,6 @@
   
   p-left_bytes_to_send = s-content_length;
   p-reuse = JK_FALSE;
  -*is_error = 0;
   
   s-secret = p-worker-secret;
   
  @@ -1629,9 +1634,12 @@
* We get here initial request (in reqmsg)
*/
   if (!ajp_marshal_into_msgb(op-request, s, l, p)) {
  -*is_error = JK_HTTP_SERVER_ERROR;
  +*is_error = JK_HTTP_BAD_REQUEST;
  +jk_log(l, JK_LOG_INFO,
  +Creating AJP message failed, 
 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-22 Thread mturk
mturk   2005/02/22 01:58:38

  Modified:jk/native/common jk_ajp_common.c
  Log:
  On END_RESPONSE mark service as readed.
  
  Revision  ChangesPath
  1.92  +4 -1  
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.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- jk_ajp_common.c   19 Feb 2005 09:13:35 -  1.91
  +++ jk_ajp_common.c   22 Feb 2005 09:58:38 -  1.92
  @@ -1527,6 +1527,9 @@
   
   /* no more data to be sent, fine we have finish here */
   if (JK_AJP13_END_RESPONSE == rc) {
  +/* XXX: Set all readed */
  +s-content_read = s-content_length;
  +s-no_more_chunks = 1;
   JK_TRACE_EXIT(l);
   return JK_TRUE;
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-22 Thread mturk
mturk   2005/02/22 02:27:38

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Revert the latest patch. No help on close_wait.
  
  Revision  ChangesPath
  1.93  +1 -4  
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.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- jk_ajp_common.c   22 Feb 2005 09:58:38 -  1.92
  +++ jk_ajp_common.c   22 Feb 2005 10:27:37 -  1.93
  @@ -1527,9 +1527,6 @@
   
   /* no more data to be sent, fine we have finish here */
   if (JK_AJP13_END_RESPONSE == rc) {
  -/* XXX: Set all readed */
  -s-content_read = s-content_length;
  -s-no_more_chunks = 1;
   JK_TRACE_EXIT(l);
   return JK_TRUE;
   }
  
  
  

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



RE: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-22 Thread Charlie Zhang


 
Charlie Zhang 
Project Manager 
Infosys Technologies Shanghai Company Ltd.
[EMAIL PROTECTED]
50271588 * 3120 / 13601627903

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 2005年2月22日 18:28
To: [EMAIL PROTECTED]
Subject: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

mturk   2005/02/22 02:27:38

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Revert the latest patch. No help on close_wait.
  
  Revision  ChangesPath
  1.93  +1 -4  
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.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- jk_ajp_common.c   22 Feb 2005 09:58:38 -  1.92
  +++ jk_ajp_common.c   22 Feb 2005 10:27:37 -  1.93
  @@ -1527,9 +1527,6 @@
   
   /* no more data to be sent, fine we have finish here */
   if (JK_AJP13_END_RESPONSE == rc) {
  -/* XXX: Set all readed */
  -s-content_read = s-content_length;
  -s-no_more_chunks = 1;
   JK_TRACE_EXIT(l);
   return JK_TRUE;
   }
  
  
  

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


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

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.c

2005-02-19 Thread mturk
mturk   2005/02/19 01:13:35

  Modified:jk/native/common jk_ajp_common.c jk_connect.c
  Log:
  Use alternative is_socket_connected implementation using
  select with 1 microsecond timeout. It should be both faster and
  usable on netware too.
  
  Revision  ChangesPath
  1.91  +7 -9  
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.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- jk_ajp_common.c   18 Feb 2005 08:27:21 -  1.90
  +++ jk_ajp_common.c   19 Feb 2005 09:13:35 -  1.91
  @@ -847,10 +847,9 @@
   if (ae-worker-cache_timeout  0 || ae-worker-recycle_timeout 
 0)
   ae-last_access = time(NULL);
   if (ae-worker-socket_timeout  0) {
  -int rc = 0;
  -if ((rc = jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) != 1) {
  -jk_log(l, JK_LOG_INFO,
  -Socket is not connected any more (status=%d), 
rc);
  +if (!jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) {
  +jk_log(l, JK_LOG_INFO,
  +   Socket is not connected any more (errno=%d), 
errno);
   jk_close_socket(ae-sd);
   ae-sd = -1;
   JK_TRACE_EXIT(l);
  @@ -1161,10 +1160,9 @@
   while ((ae-sd  0)) {
   err = 0;
   if (ae-worker-socket_timeout) {
  -int rc = 0;
  -if ((rc = jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) != 1) {
  -jk_log(l, JK_LOG_INFO,
  -   Socket is not connected any more (status=%d), 
rc);
  +if (!jk_is_socket_connected(ae-sd, ae-worker-socket_timeout)) 
{
  +jk_log(l, JK_LOG_INFO,
  +   Socket is not connected any more (errno=%d), errno);
   jk_close_socket(ae-sd);
   ae-sd = -1;
   err++;
  
  
  
  1.43  +48 -2 jakarta-tomcat-connectors/jk/native/common/jk_connect.c
  
  Index: jk_connect.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- jk_connect.c  17 Feb 2005 08:26:42 -  1.42
  +++ jk_connect.c  19 Feb 2005 09:13:35 -  1.43
  @@ -194,18 +194,36 @@
  sock_buf);
   }
   
  -#ifdef WIN32
   if (timeout  0) {
  +#ifdef WIN32
   timeout = timeout * 1000;
   setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO,
  (char *) timeout, sizeof(int));
   setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
  (char *) timeout, sizeof(int));
  +#else
  +/* TODO: How to set the timeout for other platforms? */
  +#endif
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  timeout %d set for socket=%d,
  timeout, sock);
   }
  +#ifdef SO_NOSIGPIPE
  +/* The preferred method on Mac OS X (10.2 and later) to prevent SIGPIPEs 
when
  + * sending data to a dead peer. Possibly also existing and in use on 
other BSD
  + * systems?
  +*/
  +set = 1;
  +if (setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, (const char *)set,
  +   sizeof(int))) {
  +JK_GET_SOCKET_ERRNO();
  +jk_log(l, JK_LOG_ERROR,
  +failed setting SO_NOSIGPIPE with errno=%d, errno);
  +jk_close_socket(sock);
  +JK_TRACE_EXIT(l);
  +return -1;
  +}
   #endif
   /* Tries to connect to Tomcat (continues trying while error is EINTR) */
   do {
  @@ -405,6 +423,32 @@
   return 0;
   }
   
  +#if 1
  +int jk_is_socket_connected(int sd, int timeout)
  +{
  +fd_set fd;
  +struct timeval tv;
  + 
  +FD_ZERO(fd);
  +FD_SET(sd, fd);
  +
  +/* Wait one microsecond */
  +tv.tv_sec  = 0;
  +tv.tv_usec = 1;
  +
  +/* If we get a timeout, then we are still connected */
  +if (select(1, fd, NULL, NULL, tv) == 0)
  +return 1;
  +else {
  +#if defined(WIN32) || (defined(NETWARE)  defined(__NOVELL_LIBC__))
  +errno = WSAGetLastError() - WSABASEERR;
  +#endif
  +return 0;
  +}
  +}
  +
  +#else
  +
   #if defined(WIN32) || (defined(NETWARE)  defined(__NOVELL_LIBC__))
   #define EWOULDBLOCK (WSAEWOULDBLOCK - WSABASEERR)
   #endif
  @@ -434,3 +478,5 @@
   else
   return rc;
   }
  +
  +#endif
  
  
  

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



Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.c

2005-02-19 Thread NormW
Greetings,
Will see... :-)
N.
[EMAIL PROTECTED] wrote:
mturk   2005/02/19 01:13:35
  Modified:jk/native/common jk_ajp_common.c jk_connect.c
  Log:
  Use alternative is_socket_connected implementation using
  select with 1 microsecond timeout. It should be both faster and
  usable on netware too.
  
  Revision  ChangesPath
  1.91  +7 -9  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.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- jk_ajp_common.c	18 Feb 2005 08:27:21 -	1.90
  +++ jk_ajp_common.c	19 Feb 2005 09:13:35 -	1.91
  @@ -847,10 +847,9 @@
   if (ae-worker-cache_timeout  0 || ae-worker-recycle_timeout  0)
   ae-last_access = time(NULL);
   if (ae-worker-socket_timeout  0) {
  -int rc = 0;
  -if ((rc = jk_is_socket_connected(ae-sd, ae-worker-socket_timeout)) != 1) {
  -jk_log(l, JK_LOG_INFO,
  -Socket is not connected any more (status=%d), rc);
  +if (!jk_is_socket_connected(ae-sd, ae-worker-socket_timeout)) {
  +jk_log(l, JK_LOG_INFO,
  +   Socket is not connected any more (errno=%d), errno);
   jk_close_socket(ae-sd);
   ae-sd = -1;
   JK_TRACE_EXIT(l);
  @@ -1161,10 +1160,9 @@
   while ((ae-sd  0)) {
   err = 0;
   if (ae-worker-socket_timeout) {
  -int rc = 0;
  -if ((rc = jk_is_socket_connected(ae-sd, ae-worker-socket_timeout)) != 1) {
  -jk_log(l, JK_LOG_INFO,
  -   Socket is not connected any more (status=%d), rc);
  +if (!jk_is_socket_connected(ae-sd, ae-worker-socket_timeout)) {
  +jk_log(l, JK_LOG_INFO,
  +   Socket is not connected any more (errno=%d), errno);
   jk_close_socket(ae-sd);
   ae-sd = -1;
   err++;
  
  
  
  1.43  +48 -2 jakarta-tomcat-connectors/jk/native/common/jk_connect.c
  
  Index: jk_connect.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- jk_connect.c	17 Feb 2005 08:26:42 -	1.42
  +++ jk_connect.c	19 Feb 2005 09:13:35 -	1.43
  @@ -194,18 +194,36 @@
  sock_buf);
   }
   
  -#ifdef WIN32
   if (timeout  0) {
  +#ifdef WIN32
   timeout = timeout * 1000;
   setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO,
  (char *) timeout, sizeof(int));
   setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
  (char *) timeout, sizeof(int));
  +#else
  +/* TODO: How to set the timeout for other platforms? */
  +#endif
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  timeout %d set for socket=%d,
  timeout, sock);
   }
  +#ifdef SO_NOSIGPIPE
  +/* The preferred method on Mac OS X (10.2 and later) to prevent SIGPIPEs when
  + * sending data to a dead peer. Possibly also existing and in use on other BSD
  + * systems?
  +*/
  +set = 1;
  +if (setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, (const char *)set,
  +   sizeof(int))) {
  +JK_GET_SOCKET_ERRNO();
  +jk_log(l, JK_LOG_ERROR,
  +failed setting SO_NOSIGPIPE with errno=%d, errno);
  +jk_close_socket(sock);
  +JK_TRACE_EXIT(l);
  +return -1;
  +}
   #endif
   /* Tries to connect to Tomcat (continues trying while error is EINTR) */
   do {
  @@ -405,6 +423,32 @@
   return 0;
   }
   
  +#if 1
  +int jk_is_socket_connected(int sd, int timeout)
  +{
  +fd_set fd;
  +struct timeval tv;
  + 
  +FD_ZERO(fd);
  +FD_SET(sd, fd);
  +
  +/* Wait one microsecond */
  +tv.tv_sec  = 0;
  +tv.tv_usec = 1;
  +
  +/* If we get a timeout, then we are still connected */
  +if (select(1, fd, NULL, NULL, tv) == 0)
  +return 1;
  +else {
  +#if defined(WIN32) || (defined(NETWARE)  defined(__NOVELL_LIBC__))
  +errno = WSAGetLastError() - WSABASEERR;
  +#endif
  +return 0;
  +}
  +}
  +
  +#else
  +
   #if defined(WIN32) || (defined(NETWARE)  defined(__NOVELL_LIBC__))
   #define EWOULDBLOCK (WSAEWOULDBLOCK - WSABASEERR)
   #endif
  @@ -434,3 +478,5 @@
   else
   return rc;
   }
  +
  +#endif
  
  
  

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

Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.c

2005-02-19 Thread NormW
Good evening,
Can confirm a clean build for 2.1 and 2.0.53 Apache. Time is short now 
but will test them for basic ops in the morning. I assume these still 
need the socket_timeout at zero?
Regards,
Norm

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


Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.c

2005-02-19 Thread Mladen Turk
NormW wrote:
Good evening,
Can confirm a clean build for 2.1 and 2.0.53 Apache. Time is short now 
but will test them for basic ops in the morning. I assume these still 
need the socket_timeout at zero?
Well, new is_socket_connected implementation should be available
for netware too (that was the purpose after all).
Tell me if it works when you set the socket_timeout to a positive value.
Regards,
Mladen.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.c

2005-02-19 Thread NormW
Hi again...
Mladen Turk wrote:
NormW wrote:
Good evening,
Can confirm a clean build for 2.1 and 2.0.53 Apache. Time is short now 
but will test them for basic ops in the morning. I assume these still 
need the socket_timeout at zero?
Well, new is_socket_connected implementation should be available
for netware too (that was the purpose after all).
Tell me if it works when you set the socket_timeout to a positive value.
Okay - there is time enough to try in the morning and there will be a 
message shortly thereafter...
Regards,
Mladen.
Norm
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.c

2005-02-19 Thread NormW
Good morning,
AFAICT this is working fine with a socket timeout of 15. Neither 
/server-info/ or /status/ show the setting in use, but 15 is what's in 
the properties file and /server-info/ says that's the file in use.

Regards,
Norm
Mladen Turk wrote:
NormW wrote:
Good evening,
Can confirm a clean build for 2.1 and 2.0.53 Apache. Time is short now 
but will test them for basic ops in the morning. I assume these still 
need the socket_timeout at zero?

Well, new is_socket_connected implementation should be available
for netware too (that was the purpose after all).
Tell me if it works when you set the socket_timeout to a positive value.
Regards,
Mladen.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
.

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


cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-18 Thread mturk
mturk   2005/02/18 00:27:21

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Check if timeout has been set
  
  Revision  ChangesPath
  1.90  +2 -2  
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.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- jk_ajp_common.c   17 Feb 2005 13:29:19 -  1.89
  +++ jk_ajp_common.c   18 Feb 2005 08:27:21 -  1.90
  @@ -846,7 +846,7 @@
   /* set last_access only if needed */
   if (ae-worker-cache_timeout  0 || ae-worker-recycle_timeout 
 0)
   ae-last_access = time(NULL);
  -if (ae-worker-socket_timeout) {
  +if (ae-worker-socket_timeout  0) {
   int rc = 0;
   if ((rc = jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) != 1) {
   jk_log(l, JK_LOG_INFO,
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-17 Thread mturk
mturk   2005/02/17 04:32:16

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Create separate function for creating the entire endpoint cache.
  It is just a way to make the code more readable.
  
  Revision  ChangesPath
  1.86  +62 -49
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.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- jk_ajp_common.c   17 Feb 2005 07:14:19 -  1.85
  +++ jk_ajp_common.c   17 Feb 2005 12:32:16 -  1.86
  @@ -1780,21 +1780,45 @@
   return JK_FALSE;
   }
   
  -static ajp_endpoint_t *ajp_create_endpoint(jk_worker_t *w, int proto, time_t 
now)
  +static int ajp_create_endpoint_cache(ajp_worker_t *p, int proto, jk_logger_t 
*l)
   {
  -ajp_endpoint_t *ae = (ajp_endpoint_t *)calloc(1, sizeof(ajp_endpoint_t));
  -if (ae) {
  -ae-sd = -1;
  -ae-reuse = JK_FALSE;
  -ae-last_access = now;
  -jk_open_pool(ae-pool, ae-buf, sizeof(ae-buf));
  -ae-worker = w-worker_private;
  -ae-endpoint.endpoint_private = ae;
  -ae-proto = proto;
  -ae-endpoint.service = ajp_service;
  -ae-endpoint.done = ajp_done;
  +unsigned int i;
  +time_t now = time(NULL);
  +
  +JK_TRACE_ENTER(l);
  +p-ep_cache = (ajp_endpoint_t **)calloc(1, sizeof(ajp_endpoint_t *) *
  +p-ep_cache_sz);
  +if (!p-ep_cache) {
  +JK_TRACE_EXIT(l);
  +return JK_FALSE;
   }
  -return ae;
  +if (JK_IS_DEBUG_LEVEL(l))
  +jk_log(l, JK_LOG_DEBUG,
  +setting connection cache size to %d,
  +p-ep_cache_sz);
  +for (i = 0; i  p-ep_cache_sz; i++) {
  +p-ep_cache[i] = (ajp_endpoint_t *)calloc(1, 
sizeof(ajp_endpoint_t));
  +if (!p-ep_cache[i]) {
  +jk_log(l, JK_LOG_ERROR,
  +creating endpont cache slot %d errno=%d,
  +i, errno);
  +JK_TRACE_EXIT(l);
  +return JK_FALSE;
  +}
  +p-ep_cache[i]-sd = -1;
  +p-ep_cache[i]-reuse = JK_FALSE;
  +p-ep_cache[i]-last_access = now;
  +jk_open_pool((p-ep_cache[i]-pool), p-ep_cache[i]-buf,
  + sizeof(p-ep_cache[i]-buf));
  +p-ep_cache[i]-worker = p;
  +p-ep_cache[i]-endpoint.endpoint_private = p-ep_cache[i];
  +p-ep_cache[i]-proto = proto;
  +p-ep_cache[i]-endpoint.service = ajp_service;
  +p-ep_cache[i]-endpoint.done= ajp_done;
  +}
  +
  +JK_TRACE_EXIT(l);
  +return JK_TRUE;
   }
   
   int ajp_init(jk_worker_t *pThis,
  @@ -1903,40 +1927,16 @@
   
   p-secret = jk_get_worker_secret(props, p-name);
   p-ep_mincache_sz = 1;
  -p-ep_cache = (ajp_endpoint_t **)calloc(1, sizeof(ajp_endpoint_t *) *
  -p-ep_cache_sz);
  -if (p-ep_cache) {
  -unsigned int i;
  -time_t now = time(NULL);
  -
  -if (JK_IS_DEBUG_LEVEL(l))
  -jk_log(l, JK_LOG_DEBUG,
  -setting connection cache size to %d,
  -p-ep_cache_sz);
  -/* Initialize cache slots */
  -for (i = 0; i  p-ep_cache_sz; i++) {
  -p-ep_cache[i] = ajp_create_endpoint(pThis, proto, now);
  -if (!p-ep_cache[i]) {
  -jk_log(l, JK_LOG_ERROR,
  -creating endpont cache slot %d errno=%d,
  -i, errno);
  -JK_TRACE_EXIT(l);
  -return JK_FALSE;
  -}
  -jk_log(l, JK_LOG_DEBUG,
  -Initialized endpont cache slot %d %#lx:%#lx,
  -i, p-ep_cache[i], (p-ep_cache[i]-pool));
  -}
  -JK_INIT_CS((p-cs), i);
  -if (i == JK_FALSE) {
  -jk_log(l, JK_LOG_ERROR,
  -   creating thread lock errno=%d,
  -   errno);
  -JK_TRACE_EXIT(l);
  -return JK_FALSE;
  -}
  +/* Initialize cache slots */
  +JK_INIT_CS((p-cs), rc);
  +if (!rc) {
  +jk_log(l, JK_LOG_ERROR,
  +   creating thread lock errno=%d,
  +   errno);
  +JK_TRACE_EXIT(l);
  +return JK_FALSE;
   }
  -else {
  +if (!ajp_create_endpoint_cache(p, proto, l)) {
   jk_log(l, JK_LOG_ERROR,
  allocating ep_cache of size %d,
  p-ep_cache_sz);
  @@ -2046,8 +2046,12 @@
   if 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-17 Thread mturk
mturk   2005/02/17 04:40:55

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Close socket outside critical section. Closing sockets can take a while,
  so no need to lock all the threads.
  
  Revision  ChangesPath
  1.87  +11 -4 
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.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- jk_ajp_common.c   17 Feb 2005 12:32:16 -  1.86
  +++ jk_ajp_common.c   17 Feb 2005 12:40:54 -  1.87
  @@ -724,12 +724,12 @@
   {
   int rc;
   ajp_worker_t *aw = ae-worker;
  +int sock = ae-sd;
   
   JK_ENTER_CS(aw-cs, rc);
   if (rc) {
   unsigned int i;
   /* Close existing endpoint socket */
  -jk_close_socket(ae-sd);
   ae-sd = -1;
   for (i = 0; i  aw-ep_cache_sz; i++) {
   /* Find cache slot with usable socket */
  @@ -741,6 +741,7 @@
   }
   JK_LEAVE_CS(aw-cs, rc);
   }
  +jk_close_socket(sock);
   }
   
   /*
  @@ -2002,8 +2003,12 @@
   
   JK_ENTER_CS(w-cs, rc);
   if (rc) {
  -int i;
  -
  +int i, sock = -1;
  +
  +if (p-sd  0  !p-reuse) {
  +sock  = p-sd;
  +p-sd = -1;
  +}
   for(i = w-ep_cache_sz - 1; i = 0; i--) {
   if (w-ep_cache[i] == NULL) {
   w-ep_cache[i] = p;
  @@ -2013,6 +2018,8 @@
   }
   *e = NULL;
   JK_LEAVE_CS(w-cs, rc);
  +if (sock = 0)
  +jk_close_socket(sock);
   if (i = 0) {
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-17 Thread mturk
mturk   2005/02/17 05:25:36

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Check if socket is connected before prepost cping/cpong.
  If the socket is not connected it will fail anyhow.
  
  Revision  ChangesPath
  1.88  +14 -10
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.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- jk_ajp_common.c   17 Feb 2005 12:40:54 -  1.87
  +++ jk_ajp_common.c   17 Feb 2005 13:25:36 -  1.88
  @@ -843,8 +843,9 @@
  connected sd = %d to %s,
  ae-sd, jk_dump_hinfo(ae-worker-worker_inet_addr, 
buf));
   
  -/* set last_access */
  -ae-last_access = time(NULL);
  +/* set last_access only if needed */
  +if (ae-worker-cache_timeout  0 || ae-worker-recycle_timeout 
 0)
  +ae-last_access = time(NULL);
   if (ae-worker-socket_timeout) {
   int rc = 0;
   if ((rc = jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) != 1) {
  @@ -1159,13 +1160,7 @@
*/
   while ((ae-sd  0)) {
   err = 0;
  -/* handle cping/cpong before request if timeout is set */
  -if (ae-worker-prepost_timeout != 0) {
  -if (ajp_handle_cping_cpong(ae, ae-worker-prepost_timeout, l) ==
  -JK_FALSE)
  -err++;
  -}
  -else if (ae-worker-socket_timeout) {
  +if (ae-worker-socket_timeout) {
   int rc = 0;
   if ((rc = jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) != 1) {
   jk_log(l, JK_LOG_INFO,
  @@ -1175,6 +1170,15 @@
   err++;
   }
   }
  +else if (ae-worker-prepost_timeout != 0  !err) {
  +/* handle cping/cpong if prepost_timeout is set
  + * If the socket is disconnected no need to handle
  + * the cping/cpong
  + */
  +if (ajp_handle_cping_cpong(ae, ae-worker-prepost_timeout, l) ==
  +JK_FALSE)
  +err++;
  +}
   
   /* If we got an error or can't send data, then try to get a pooled
* connection and try again.  If we are succesful, break out of this
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-17 Thread mturk
mturk   2005/02/17 05:29:19

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Make sure that both network detection and cping/cpong can occur.
  
  Revision  ChangesPath
  1.89  +2 -2  
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.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- jk_ajp_common.c   17 Feb 2005 13:25:36 -  1.88
  +++ jk_ajp_common.c   17 Feb 2005 13:29:19 -  1.89
  @@ -1170,7 +1170,7 @@
   err++;
   }
   }
  -else if (ae-worker-prepost_timeout != 0  !err) {
  +if (ae-worker-prepost_timeout != 0  !err) {
   /* handle cping/cpong if prepost_timeout is set
* If the socket is disconnected no need to handle
* the cping/cpong
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 00:19:46

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Rewrite endpoint cache. The endpoints are now created on init,
  and are present for worker liftime. This also truly limits the number
  of connections to Tomcat.
  
  Revision  ChangesPath
  1.79  +155 -154  
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.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- jk_ajp_common.c   15 Feb 2005 12:11:20 -  1.78
  +++ jk_ajp_common.c   16 Feb 2005 08:19:46 -  1.79
  @@ -682,8 +682,15 @@
* Reset the endpoint (clean buf)
*/
   
  -static void ajp_reset_endpoint(ajp_endpoint_t * ae)
  +static void ajp_reset_endpoint(ajp_endpoint_t * ae, jk_logger_t *l)
   {
  +if (ae-sd  0  !ae-reuse) {
  +jk_close_socket(ae-sd);
  +if (JK_IS_DEBUG_LEVEL(l))
  +jk_log(l, JK_LOG_DEBUG,
  +   closed socket with sd = %d, ae-sd);
  +ae-sd = -1;
  +}
   jk_reset_pool((ae-pool));
   }
   
  @@ -699,7 +706,8 @@
   jk_close_socket(ae-sd);
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  -   closed sd = %d, ae-sd);
  +   closed socket with sd = %d, ae-sd);
  +ae-sd = -1;
   }
   
   jk_close_pool((ae-pool));
  @@ -709,35 +717,31 @@
   
   
   /*
  - * Try to reuse a previous connection
  + * Try another connection from cache
*/
   
  -static void ajp_reuse_connection(ajp_endpoint_t * ae, jk_logger_t *l)
  +static void ajp_next_connection(ajp_endpoint_t **ae, jk_logger_t *l)
   {
  -ajp_worker_t *aw = ae-worker;
  +int rc;
  +ajp_worker_t *aw = (*ae)-worker;
   
   /* Close existing endpoint socket */
  -jk_close_socket(ae-sd);
  -ae-sd = -1;
  -
  -if (aw-ep_cache_sz) {
  -int rc;
  -JK_ENTER_CS(aw-cs, rc);
  -if (rc) {
  -unsigned i;
  +jk_close_socket((*ae)-sd);
  +(*ae)-sd = -1;
   
  -for (i = 0; i  aw-ep_cache_sz; i++) {
  -/* Find cache slot with usable socket */
  -if (aw-ep_cache[i]  aw-ep_cache[i]-sd  0) {
  -ae-sd = aw-ep_cache[i]-sd;
  -aw-ep_cache[i]-sd = -1;
  -ajp_close_endpoint(aw-ep_cache[i], l);
  -aw-ep_cache[i] = NULL;
  -break;
  -}
  +JK_ENTER_CS(aw-cs, rc);
  +if (rc) {
  +unsigned int i;
  +for (i = 0; i  aw-ep_cache_sz; i++) {
  +/* Find cache slot with usable socket */
  +if (aw-ep_cache[i]  aw-ep_cache[i]-sd  0) {
  +ajp_endpoint_t *e = aw-ep_cache[i];
  +aw-ep_cache[i] = *ae;
  +*ae = e;
  +break;
   }
  -JK_LEAVE_CS(aw-cs, rc);
   }
  +JK_LEAVE_CS(aw-cs, rc);
   }
   }
   
  @@ -1157,9 +1161,9 @@
* loop. */
   if (err ||
   (ajp_connection_tcp_send_message(ae, op-request, l) == 
JK_FALSE)) {
  -jk_log(l, JK_LOG_ERROR,
  -   Error sending request try another pooled connection);
  -ajp_reuse_connection(ae, l);
  +jk_log(l, JK_LOG_INFO,
  +   Error sending request. Will try another pooled 
connection);
  +ajp_next_connection(ae, l);
   }
   else
   break;
  @@ -1366,9 +1370,7 @@
   /*
* Strange protocol error.
*/
  -if (JK_IS_DEBUG_LEVEL(l))
  -jk_log(l, JK_LOG_DEBUG, Reuse: %d, ae-reuse);
  -ae-reuse = JK_FALSE;
  +jk_log(l, JK_LOG_INFO,  Protocol error: Reuse is set to 
false);
   }
   /* Reuse in all cases */
   ae-reuse = JK_TRUE;
  @@ -1630,7 +1632,6 @@
   
   /* Up to there we can recover */
   *is_recoverable_error = JK_TRUE;
  -op-recoverable = JK_TRUE;
   
   err = ajp_get_reply(e, s, l, p, op);
   if (err  0) {
  @@ -1662,7 +1663,7 @@
   }
   }
   /* Get another connection from the pool */
  -ajp_reuse_connection(p, l);
  +ajp_next_connection(p, l);
   
   if (err == JK_CLIENT_ERROR) {
   *is_recoverable_error = JK_FALSE;
  @@ -1752,12 +1753,28 @@
   return JK_FALSE;
   }
   
  +static ajp_endpoint_t *ajp_create_endpoint(jk_worker_t *w, int proto, time_t 
now)
  +{
  +ajp_endpoint_t *ae = (ajp_endpoint_t *)calloc(1, sizeof(ajp_endpoint_t));
  +if (ae) {
  +ae-sd = -1;
  +ae-reuse = JK_FALSE;
  +  

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 02:35:46

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix typo.
  
  Revision  ChangesPath
  1.80  +2 -2  
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.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- jk_ajp_common.c   16 Feb 2005 08:19:46 -  1.79
  +++ jk_ajp_common.c   16 Feb 2005 10:35:46 -  1.80
  @@ -1882,7 +1882,7 @@
   /* Initialize cache slots */
   for (i = 0; i  p-ep_cache_sz; i++) {
   p-ep_cache[i] = ajp_create_endpoint(pThis, proto, now);
  -if (p-ep_cache[i]) {
  +if (!p-ep_cache[i]) {
   jk_log(l, JK_LOG_ERROR,
   Failed creating enpont cache slot %d errno=%d,
   i, errno);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 03:04:35

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix core dump if one of the endpoint cache entries can not
  be created by setting all pointer to zero before init.
  
  Revision  ChangesPath
  1.81  +3 -3  
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.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- jk_ajp_common.c   16 Feb 2005 10:35:46 -  1.80
  +++ jk_ajp_common.c   16 Feb 2005 11:04:35 -  1.81
  @@ -1869,8 +1869,8 @@
   
   p-secret = jk_get_worker_secret(props, p-name);
   p-ep_mincache_sz = 1;
  -p-ep_cache = (ajp_endpoint_t **) malloc(sizeof(ajp_endpoint_t *) *
  - p-ep_cache_sz);
  +p-ep_cache = (ajp_endpoint_t **)calloc(1, sizeof(ajp_endpoint_t *) *
  +p-ep_cache_sz);
   if (p-ep_cache) {
   unsigned int i;
   time_t now = time(NULL);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 03:08:15

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add some loging and fix few typos. No functional change.
  
  Revision  ChangesPath
  1.82  +6 -3  
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.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- jk_ajp_common.c   16 Feb 2005 11:04:35 -  1.81
  +++ jk_ajp_common.c   16 Feb 2005 11:08:14 -  1.82
  @@ -1884,7 +1884,7 @@
   p-ep_cache[i] = ajp_create_endpoint(pThis, proto, now);
   if (!p-ep_cache[i]) {
   jk_log(l, JK_LOG_ERROR,
  -Failed creating enpont cache slot %d errno=%d,
  +creating endpont cache slot %d errno=%d,
   i, errno);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
  @@ -1892,13 +1892,16 @@
   }
   JK_INIT_CS((p-cs), i);
   if (i == JK_FALSE) {
  +jk_log(l, JK_LOG_ERROR,
  +   creating thread lock errno=%d,
  +   errno);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
   else {
   jk_log(l, JK_LOG_ERROR,
  -   Could not malloc ep_cache of size %d,
  +   allocating ep_cache of size %d,
  p-ep_cache_sz);
   JK_TRACE_EXIT(l);
   return JK_FALSE;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-16 Thread mturk
mturk   2005/02/16 23:14:20

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix getting next socket from pool and add is_connected checking if
  socket_timeout is set. Also no need to reconect if is_connected or
  cping/cpong failed, because tomcat is either dead or disconnected.
  Use another worker instead, marking this one in error state.
  
  Revision  ChangesPath
  1.85  +82 -47
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.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- jk_ajp_common.c   16 Feb 2005 15:28:28 -  1.84
  +++ jk_ajp_common.c   17 Feb 2005 07:14:19 -  1.85
  @@ -720,24 +720,22 @@
* Try another connection from cache
*/
   
  -static void ajp_next_connection(ajp_endpoint_t **ae, jk_logger_t *l)
  +static void ajp_next_connection(ajp_endpoint_t *ae, jk_logger_t *l)
   {
   int rc;
  -ajp_worker_t *aw = (*ae)-worker;
  -
  -/* Close existing endpoint socket */
  -jk_close_socket((*ae)-sd);
  -(*ae)-sd = -1;
  +ajp_worker_t *aw = ae-worker;
   
   JK_ENTER_CS(aw-cs, rc);
   if (rc) {
   unsigned int i;
  +/* Close existing endpoint socket */
  +jk_close_socket(ae-sd);
  +ae-sd = -1;
   for (i = 0; i  aw-ep_cache_sz; i++) {
   /* Find cache slot with usable socket */
   if (aw-ep_cache[i]  aw-ep_cache[i]-sd  0) {
  -ajp_endpoint_t *e = aw-ep_cache[i];
  -aw-ep_cache[i] = *ae;
  -*ae = e;
  +ae-sd = aw-ep_cache[i]-sd;
  + aw-ep_cache[i]-sd = -1;
   break;
   }
   }
  @@ -837,7 +835,8 @@
   for (attempt = 0; attempt  ae-worker-connect_retry_attempts; 
attempt++) {
   ae-sd = jk_open_socket(ae-worker-worker_inet_addr,
   ae-worker-keepalive,
  -ae-worker-socket_timeout, l);
  +ae-worker-socket_timeout,
  +ae-worker-socket_buf, l);
   if (ae-sd = 0) {
   jk_log(l, JK_LOG_DEBUG,
  connected sd = %d to %s,
  @@ -845,6 +844,17 @@
   
   /* set last_access */
   ae-last_access = time(NULL);
  +if (ae-worker-socket_timeout) {
  +int rc = 0;
  +if ((rc = jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) != 1) {
  +jk_log(l, JK_LOG_INFO,
  +Socket is not connected any more (status=%d), 
rc);
  +jk_close_socket(ae-sd);
  +ae-sd = -1;
  +JK_TRACE_EXIT(l);
  +return JK_FALSE;
  +}
  +}
   /* Check if we must execute a logon after the physical connect */
   if (ae-worker-logon != NULL) {
   rc = ae-worker-logon(ae, l);
  @@ -1148,13 +1158,22 @@
*/
   while ((ae-sd  0)) {
   err = 0;
  -
   /* handle cping/cpong before request if timeout is set */
   if (ae-worker-prepost_timeout != 0) {
   if (ajp_handle_cping_cpong(ae, ae-worker-prepost_timeout, l) ==
   JK_FALSE)
   err++;
   }
  +else if (ae-worker-socket_timeout) {
  +int rc = 0;
  +if ((rc = jk_is_socket_connected(ae-sd, 
ae-worker-socket_timeout)) != 1) {
  +jk_log(l, JK_LOG_INFO,
  +   Socket is not connected any more (status=%d), 
rc);
  +jk_close_socket(ae-sd);
  +ae-sd = -1;
  +err++;
  +}
  +}
   
   /* If we got an error or can't send data, then try to get a pooled
* connection and try again.  If we are succesful, break out of this
  @@ -1163,7 +1182,7 @@
   (ajp_connection_tcp_send_message(ae, op-request, l) == 
JK_FALSE)) {
   jk_log(l, JK_LOG_INFO,
  Error sending request. Will try another pooled 
connection);
  -ajp_next_connection(ae, l);
  +ajp_next_connection(ae, l);
   }
   else
   break;
  @@ -1173,7 +1192,14 @@
* If we failed to reuse a connection, try to reconnect.
*/
   if (ae-sd  0) {
  -
  +
  +if (err) {
  +/* XXX: If err is set, the tomcat is either dead or disconnected 
*/
  +jk_log(l, JK_LOG_INFO,
  +   All endpoints are disconnected or dead);
  +JK_TRACE_EXIT(l);
  +return JK_FALSE;
  +}
   /* no need to handle cping/cpong here since it 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-15 Thread mturk
mturk   2005/02/15 04:11:20

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix request method processing for HEAD. Thanks to Ivo for finding
  the solution, and Pier to forward it.
  
  Revision  ChangesPath
  1.78  +2 -2  
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.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- jk_ajp_common.c   14 Feb 2005 18:07:00 -  1.77
  +++ jk_ajp_common.c   15 Feb 2005 12:11:20 -  1.78
  @@ -119,7 +119,7 @@
   return (method[1] == 'E'
method[2] == 'A'
method[3] == 'D'
  -? SC_M_GET : UNKNOWN_METHOD);
  +? SC_M_HEAD : UNKNOWN_METHOD);
   case 'P':
   return (method[1] == 'O'
method[2] == 'S'
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2005-02-14 Thread mturk
mturk   2005/02/14 09:25:24

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add host and port placeholders. Used for logging and jkstatus display.
  Count bytes readed and tranferred to/from Tomcat.
  
  Revision  ChangesPath
  1.76  +12 -10
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.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- jk_ajp_common.c   6 Feb 2005 13:45:11 -   1.75
  +++ jk_ajp_common.c   14 Feb 2005 17:25:24 -  1.76
  @@ -895,7 +895,8 @@
   }
   
   if ((rc = jk_tcp_socket_sendfull(ae-sd, jk_b_get_buff(msg),
  -   jk_b_get_len(msg)))  0) {
  + jk_b_get_len(msg)))  0) {
  +ae-endpoint.wr += jk_b_get_len(msg);
   JK_TRACE_EXIT(l);
   return JK_TRUE;
   }
  @@ -937,7 +938,7 @@
   JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
  -
  +ae-endpoint.rd += rc;
   header = ((unsigned int)head[0]  8) | head[1];
   
   if (ae-proto == AJP13_PROTO) {
  @@ -1001,6 +1002,7 @@
   JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
  +ae-endpoint.rd += rc;
   
   if (ae-proto == AJP13_PROTO) {
   if (JK_IS_DEBUG_LEVEL(l))
  @@ -1714,16 +1716,16 @@
   
   if (pThis  pThis-worker_private) {
   ajp_worker_t *p = pThis-worker_private;
  -port = jk_get_worker_port(props, p-name, port);
  -host = jk_get_worker_host(props, p-name, host);
  +p-port = jk_get_worker_port(props, p-name, port);
  +p-host = jk_get_worker_host(props, p-name, host);
   
   if (JK_IS_DEBUG_LEVEL(l))
   jk_log(l, JK_LOG_DEBUG,
  -   worker %s contact is %s:%d,
  -   p-name, host, port);
  +   worker %s contact is '%s:%d',
  +   p-name, p-host, p-port);
   
  -if (port  1024  host) {
  -if (jk_resolve(host, port, p-worker_inet_addr)) {
  +if (p-port  1024) {
  +if (jk_resolve(p-host, p-port, p-worker_inet_addr)) {
   JK_TRACE_EXIT(l);
   return JK_TRUE;
   }
  @@ -1732,7 +1734,7 @@
   }
   jk_log(l, JK_LOG_ERROR,
  invalid host and port %s %d,
  -   ((host == NULL) ? NULL : host), port);
  +   ((p-host == NULL) ? NULL : p-host), p-port);
   }
   else {
   JK_LOG_NULL_PARAMS(l);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-12-17 Thread mturk
mturk   2004/12/17 00:37:16

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix cache by removing reuse flag on reset endpoint.
  Reset endpoint only when it will be stored in the cache. In case the
  endpoit can not be stored in the cache it will be closed anyhow.
  
  Revision  ChangesPath
  1.71  +41 -44
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.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- jk_ajp_common.c   16 Dec 2004 09:56:31 -  1.70
  +++ jk_ajp_common.c   17 Dec 2004 08:37:16 -  1.71
  @@ -680,7 +680,6 @@
   
   static void ajp_reset_endpoint(ajp_endpoint_t * ae)
   {
  -ae-reuse = JK_FALSE;
   jk_reset_pool((ae-pool));
   }
   
  @@ -692,15 +691,13 @@
   {
   JK_TRACE_ENTER(l);
   
  -jk_close_pool((ae-pool));
  -
   if (ae-sd  0) {
   jk_close_socket(ae-sd);
   jk_log(l, JK_LOG_DEBUG,
  closed sd = %d\n, ae-sd);
  -ae-sd = -1;/* just to avoid twice close */
   }
   
  +jk_close_pool((ae-pool));
   free(ae);
   JK_TRACE_EXIT(l);
   }
  @@ -714,6 +711,10 @@
   {
   ajp_worker_t *aw = ae-worker;
   
  +/* Close existing endpoint socket */
  +jk_close_socket(ae-sd);
  +ae-sd = -1;
  +
   if (aw-ep_cache_sz) {
   int rc;
   JK_ENTER_CS(aw-cs, rc);
  @@ -721,7 +722,8 @@
   unsigned i;
   
   for (i = 0; i  aw-ep_cache_sz; i++) {
  -if (aw-ep_cache[i]) {
  +/* Find cache slot with usable socket */
  +if (aw-ep_cache[i]  aw-ep_cache[i]-sd  0) {
   ae-sd = aw-ep_cache[i]-sd;
   aw-ep_cache[i]-sd = -1;
   ajp_close_endpoint(aw-ep_cache[i], l);
  @@ -867,6 +869,7 @@
   int ajp_connection_tcp_send_message(ajp_endpoint_t * ae,
   jk_msg_buf_t *msg, jk_logger_t *l)
   {
  +int rc;
   
   JK_TRACE_ENTER(l); 
   if (ae-proto == AJP13_PROTO) {
  @@ -884,15 +887,16 @@
   return JK_FALSE;
   }
   
  -if (0 
  -jk_tcp_socket_sendfull(ae-sd, jk_b_get_buff(msg),
  -   jk_b_get_len(msg))) {
  +if ((rc = jk_tcp_socket_sendfull(ae-sd, jk_b_get_buff(msg),
  +   jk_b_get_len(msg)))  0) {
   JK_TRACE_EXIT(l);
  -return JK_FALSE;
  +return JK_TRUE;
   }
  +jk_log(l, JK_LOG_ERROR,
  +   sendfull returned %d with errno=%d \n, rc, errno);
   
   JK_TRACE_EXIT(l);
  -return JK_TRUE;
  +return JK_FALSE;
   }
   
   /*
  @@ -1140,13 +1144,10 @@
   /* If we got an error or can't send data, then try to get a pooled
* connection and try again.  If we are succesful, break out of this
* loop. */
  -if (err
  -|| ajp_connection_tcp_send_message(ae, op-request,
  -   l) == JK_FALSE) {
  -jk_log(l, JK_LOG_INFO,
  +if (err ||
  +(ajp_connection_tcp_send_message(ae, op-request, l) == 
JK_FALSE)) {
  +jk_log(l, JK_LOG_ERROR,
  Error sending request try another pooled connection\n);
  -jk_close_socket(ae-sd);
  -ae-sd = -1;
   ajp_reuse_connection(ae, l);
   }
   else
  @@ -1165,7 +1166,7 @@
* After we are connected, each error that we are going to
* have is probably unrecoverable
*/
  -if (!ajp_connection_tcp_send_message(ae, op-request, l)) {
  +if (ajp_connection_tcp_send_message(ae, op-request, l) == 
JK_FALSE) {
   jk_log(l, JK_LOG_INFO,
  Error sending request on a fresh connection\n);
   JK_TRACE_EXIT(l);
  @@ -1200,7 +1201,7 @@
   
   postlen = jk_b_get_len(op-post);
   if (postlen  AJP_HEADER_LEN) {
  -if (!ajp_connection_tcp_send_message(ae, op-post, l)) {
  +if (ajp_connection_tcp_send_message(ae, op-post, l) == JK_FALSE) {
   jk_log(l, JK_LOG_ERROR, Error resending request body (%d)\n,
  postlen);
   JK_TRACE_EXIT(l);
  @@ -1215,7 +1216,7 @@
   postlen = jk_b_get_len(s-reco_buf);
   
   if (postlen  AJP_HEADER_LEN) {
  -if (!ajp_connection_tcp_send_message(ae, s-reco_buf, l)) {
  +if (ajp_connection_tcp_send_message(ae, s-reco_buf, l) == 
JK_FALSE) {
   jk_log(l, JK_LOG_ERROR,
  Error resending request body (lb mode) (%d)\n,
  postlen);
  @@ -1260,7 +1261,7 @@
   }
   
   s-content_read = len;
  -   

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-12-16 Thread mturk
mturk   2004/12/16 01:56:31

  Modified:jk/native/common jk_ajp_common.c
  Log:
  No need to reset the endpoint while closing cause it will be unusable.
  
  Revision  ChangesPath
  1.70  +2 -3  
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.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- jk_ajp_common.c   16 Dec 2004 09:49:41 -  1.69
  +++ jk_ajp_common.c   16 Dec 2004 09:56:31 -  1.70
  @@ -692,7 +692,6 @@
   {
   JK_TRACE_ENTER(l);
   
  -ajp_reset_endpoint(ae);
   jk_close_pool((ae-pool));
   
   if (ae-sd  0) {
  @@ -702,8 +701,8 @@
   ae-sd = -1;/* just to avoid twice close */
   }
   
  -JK_TRACE_EXIT(l);
   free(ae);
  +JK_TRACE_EXIT(l);
   }
   
   
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-12-16 Thread mturk
mturk   2004/12/16 00:38:05

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Backport method parsing from ajp project. It's more efficient then
  previous.
  
  Revision  ChangesPath
  1.68  +173 -95   
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.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- jk_ajp_common.c   15 Dec 2004 20:31:16 -  1.67
  +++ jk_ajp_common.c   16 Dec 2004 08:38:05 -  1.68
  @@ -72,106 +72,183 @@
   {
   const char *rc = NULL;
   sc = sc  0X00FF;
  -if(sc = SC_RES_HEADERS_NUM  sc  0) {
  +if (sc = SC_RES_HEADERS_NUM  sc  0) {
   rc = response_trans_headers[sc - 1];
   }
   
   return rc;
   }
   
  +#define UNKNOWN_METHOD (-1)
   
  -static int sc_for_req_method(const char *method, unsigned char *sc)
  +static int sc_for_req_method(const char *method, size_t len)
   {
  -int rc = JK_TRUE;
  -if (0 == strcmp(method, GET)) {
  -*sc = SC_M_GET;
  -}
  -else if (0 == strcmp(method, POST)) {
  -*sc = SC_M_POST;
  -}
  -else if (0 == strcmp(method, HEAD)) {
  -*sc = SC_M_HEAD;
  -}
  -else if (0 == strcmp(method, PUT)) {
  -*sc = SC_M_PUT;
  -}
  -else if (0 == strcmp(method, DELETE)) {
  -*sc = SC_M_DELETE;
  -}
  -else if (0 == strcmp(method, OPTIONS)) {
  -*sc = SC_M_OPTIONS;
  -}
  -else if (0 == strcmp(method, TRACE)) {
  -*sc = SC_M_TRACE;
  -}
  -else if (0 == strcmp(method, PROPFIND)) {
  -*sc = SC_M_PROPFIND;
  -}
  -else if (0 == strcmp(method, PROPPATCH)) {
  -*sc = SC_M_PROPPATCH;
  -}
  -else if (0 == strcmp(method, MKCOL)) {
  -*sc = SC_M_MKCOL;
  -}
  -else if (0 == strcmp(method, COPY)) {
  -*sc = SC_M_COPY;
  -}
  -else if (0 == strcmp(method, MOVE)) {
  -*sc = SC_M_MOVE;
  -}
  -else if (0 == strcmp(method, LOCK)) {
  -*sc = SC_M_LOCK;
  -}
  -else if (0 == strcmp(method, UNLOCK)) {
  -*sc = SC_M_UNLOCK;
  -}
  -else if (0 == strcmp(method, ACL)) {
  -*sc = SC_M_ACL;
  -}
  -else if (0 == strcmp(method, REPORT)) {
  -*sc = SC_M_REPORT;
  -}
  -else if (0 == strcmp(method, VERSION-CONTROL)) {
  -*sc = SC_M_VERSION_CONTROL;
  -}
  -else if (0 == strcmp(method, CHECKIN)) {
  -*sc = SC_M_CHECKIN;
  -}
  -else if (0 == strcmp(method, CHECKOUT)) {
  -*sc = SC_M_CHECKOUT;
  -}
  -else if (0 == strcmp(method, UNCHECKOUT)) {
  -*sc = SC_M_UNCHECKOUT;
  -}
  -else if (0 == strcmp(method, SEARCH)) {
  -*sc = SC_M_SEARCH;
  -}
  -else if (0 == strcmp(method, MKWORKSPACE)) {
  -*sc = SC_M_MKWORKSPACE;
  -}
  -else if (0 == strcmp(method, UPDATE)) {
  -*sc = SC_M_UPDATE;
  -}
  -else if (0 == strcmp(method, LABEL)) {
  -*sc = SC_M_LABEL;
  -}
  -else if (0 == strcmp(method, MERGE)) {
  -*sc = SC_M_MERGE;
  -}
  -else if (0 == strcmp(method, BASELINE-CONTROL)) {
  -*sc = SC_M_BASELINE_CONTROL;
  -}
  -else if (0 == strcmp(method, MKACTIVITY)) {
  -*sc = SC_M_MKACTIVITY;
  -}
  -else {
  -rc = JK_FALSE;
  -}
  +/* Note: the following code was generated by the shilka tool from
  +   the cocom parsing/compilation toolkit. It is an optimized lookup
  +   based on analysis of the input keywords. Postprocessing was done
  +   on the shilka output, but the basic structure and analysis is
  +   from there. Should new HTTP methods be added, then manual insertion
  +   into this code is fine, or simply re-running the shilka tool on
  +   the appropriate input. */
  +
  +/* Note: it is also quite reasonable to just use our method_registry,
  +   but I'm assuming (probably incorrectly) we want more speed here
  +   (based on the optimizations the previous code was doing). */
  +
  +switch (len)
  +{
  +case 3:
  +switch (method[0])
  +{
  +case 'P':
  +return (method[1] == 'U'
  + method[2] == 'T'
  +? SC_M_PUT : UNKNOWN_METHOD);
  +case 'G':
  +return (method[1] == 'E'
  + method[2] == 'T'
  +? SC_M_GET : UNKNOWN_METHOD);
  +default:
  +return UNKNOWN_METHOD;
  +}
   
  -return rc;
  -}
  +case 4:
  +switch (method[0])
  +{
  +case 'H':
  +return (method[1] == 'E'
  + method[2] == 'A'
  + method[3] == 'D'
  +? SC_M_GET : UNKNOWN_METHOD);
  +   

Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-12-16 Thread newsletter
This is an automated message that will hopefully answer any questions you might 
have:


HOW TO UNSUBSCRIBE:
Visit www.insanepictures.com/unsubscribe.shtml and enter your email address 
into the unsubscribe box.


HOW TO SUBSCRIBE:
Visit www.insanepictures.com and enter your email address into the subscribe 
box.


HOW TO CHANGE YOUR EMAIL ADDRESS:
First unsubscribe, then subscribe with your new email address, using the 
instructions above.


HOW TO CONTACT US:
If you would like to send us a comment, ask a question, submit a picture or 
joke, or are interested in advertising, you can email us at [EMAIL PROTECTED]


Regards,
InsanePictures.com



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


cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_ajp_common.h

2004-12-16 Thread mturk
mturk   2004/12/16 01:49:42

  Modified:jk/native/common jk_ajp_common.c jk_ajp_common.h
  Log:
  Use zero for default cache timeout value, and properly set the last
  access time value.
  
  Revision  ChangesPath
  1.69  +9 -9  
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.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- jk_ajp_common.c   16 Dec 2004 08:38:05 -  1.68
  +++ jk_ajp_common.c   16 Dec 2004 09:49:41 -  1.69
  @@ -1958,14 +1958,13 @@
   if (pThis  pThis-worker_private  je) {
   ajp_worker_t *aw = pThis-worker_private;
   ajp_endpoint_t *ae = NULL;
  +time_t now = time(NULL);
   
   if (aw-ep_cache_sz) {
   int rc;
   JK_ENTER_CS(aw-cs, rc);
   if (rc) {
   unsigned i;
  -time_t now;
  -now = time(NULL);
   for (i = 0; i  aw-ep_cache_sz; i++) {
   if (aw-ep_cache[i]) {
   ae = aw-ep_cache[i];
  @@ -1974,9 +1973,10 @@
   }
   }
   /* Handle enpoint cache timeouts */
  -if (aw-cache_timeout) {
  -for (; i  aw-ep_cache_sz; i++) {
  -if (aw-ep_cache[i]) {
  +if (ae  aw-cache_timeout) {
  +for (i = 0; i  aw-ep_cache_sz; i++) {
  +/* Skip the cached enty */
  +if (aw-ep_cache[i]  (ae != aw-ep_cache[i])) {
   int elapsed =
   (int)(now - ae-last_access);
   if (elapsed  aw-cache_timeout) {
  @@ -1994,7 +1994,6 @@
   if (ae-sd  0) {
   /* Handle timeouts for open sockets */
   int elapsed = (int)(now - ae-last_access);
  -ae-last_access = now;
   jk_log(l, JK_LOG_DEBUG,
  time elapsed since last request = %u 
seconds\n,
  elapsed);
  @@ -2007,18 +2006,19 @@
   ae-sd = -1;/* just to avoid twice close 
*/
   }
   }
  +ae-last_access = now;
   *je = ae-endpoint;
   JK_TRACE_EXIT(l);
   return JK_TRUE;
   }
   }
   }
  -
  +/* Create new endpoint */
   ae = (ajp_endpoint_t *) calloc(1, sizeof(ajp_endpoint_t));
   if (ae) {
   ae-sd = -1;
   ae-reuse = JK_FALSE;
  -ae-last_access = time(NULL);
  +ae-last_access = now;
   jk_open_pool(ae-pool, ae-buf, sizeof(ae-buf));
   ae-worker = pThis-worker_private;
   ae-endpoint.endpoint_private = ae;
  
  
  
  1.27  +2 -2  
jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h
  
  Index: jk_ajp_common.h
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- jk_ajp_common.h   10 Nov 2004 16:36:48 -  1.26
  +++ jk_ajp_common.h   16 Dec 2004 09:49:42 -  1.27
  @@ -188,7 +188,7 @@
   #define AJP_HEADER_LEN(4)
   #define AJP_HEADER_SZ_LEN (2)
   #define CHUNK_BUFFER_PAD  (12)
  -#define AJP_DEF_CACHE_TIMEOUT (15)
  +#define AJP_DEF_CACHE_TIMEOUT (0)
   #define AJP_DEF_CONNECT_TIMEOUT   (0)   /* NO CONNECTION TIMEOUT = NO 
CPING/CPONG */
   #define AJP_DEF_REPLY_TIMEOUT (0)   /* NO REPLY TIMEOUT  
  */
   #define AJP_DEF_PREPOST_TIMEOUT   (0)   /* NO PREPOST TIMEOUT = NO 
CPING/CPONG*/
  
  
  

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


cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-12-15 Thread mturk
mturk   2004/12/15 12:31:17

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Backport sc_for_req_header from mod_proxy.
  It uses case insensitive matching.
  
  Revision  ChangesPath
  1.67  +83 -95
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.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- jk_ajp_common.c   13 Dec 2004 07:39:51 -  1.66
  +++ jk_ajp_common.c   15 Dec 2004 20:31:16 -  1.67
  @@ -68,10 +68,11 @@
   WWW-Authenticate
   };
   
  -static const char *long_res_header_for_sc(int sc)
  +static const char *long_res_header_for_sc(int sc) 
   {
   const char *rc = NULL;
  -if (sc = SC_RES_HEADERS_NUM  sc  0) {
  +sc = sc  0X00FF;
  +if(sc = SC_RES_HEADERS_NUM  sc  0) {
   rc = response_trans_headers[sc - 1];
   }
   
  @@ -170,105 +171,92 @@
   return rc;
   }
   
  -static int sc_for_req_header(const char *header_name, unsigned short *sc)
  +#define UNKNOWN_METHOD (-1)
  +
  +static int sc_for_req_header(const char *header_name)
   {
  -switch (header_name[0]) {
  -case 'a':
  -if ('c' == header_name[1] 
  -'c' == header_name[2] 
  -'e' == header_name[3] 
  -'p' == header_name[4]  't' == header_name[5]) {
  -if ('-' == header_name[6]) {
  -if (!strcmp(header_name + 7, charset)) {
  -*sc = SC_ACCEPT_CHARSET;
  -}
  -else if (!strcmp(header_name + 7, encoding)) {
  -*sc = SC_ACCEPT_ENCODING;
  -}
  -else if (!strcmp(header_name + 7, language)) {
  -*sc = SC_ACCEPT_LANGUAGE;
  -}
  -else {
  -return JK_FALSE;
  +char header[16];
  +size_t len = strlen(header_name);
  +const char *p = header_name;
  +int i = 0;
  +
  +/* ACCEPT-LANGUAGE is the longest headeer
  + * that is of interest.
  + */
  +if (len  4 || len  15)
  +return UNKNOWN_METHOD;
  +
  +while (*p)
  +header[i++] = toupper((unsigned char)*p++);
  +header[i] = '\0';
  +p = header[1];
  +
  +switch (header[0]) {
  +case 'A':
  +if (memcmp(p, CCEPT, 5) == 0) {
  +if (!header[6])
  +return SC_ACCEPT;
  +else if (header[6] == '-') {
  +p += 6;
  +if (memcmp(p, CHARSET, 7) == 0)
  +return SC_ACCEPT_CHARSET;
  +else if (memcmp(p,  ENCODING, 8) == 0)
  +return SC_ACCEPT_ENCODING;
  +else if (memcmp(p, LANGUAGE, 8) == 0)
  +return SC_ACCEPT_LANGUAGE;
  +else
  +return UNKNOWN_METHOD;
   }
  +else
  +return UNKNOWN_METHOD;
   }
  -else if ('\0' == header_name[6]) {
  -*sc = SC_ACCEPT;
  -}
  -else {
  -return JK_FALSE;
  -}
  -}
  -else if (!strcmp(header_name, authorization)) {
  -*sc = SC_AUTHORIZATION;
  -}
  -else {
  -return JK_FALSE;
  -}
  +else if (memcmp(p, UTHORIZATION, 12) == 0)
  +return SC_AUTHORIZATION;
  +else
  +return UNKNOWN_METHOD;
   break;
  -
  -case 'c':
  -if (!strcmp(header_name, cookie)) {
  -*sc = SC_COOKIE;
  -}
  -else if (!strcmp(header_name, connection)) {
  -*sc = SC_CONNECTION;
  -}
  -else if (!strcmp(header_name, content-type)) {
  -*sc = SC_CONTENT_TYPE;
  -}
  -else if (!strcmp(header_name, content-length)) {
  -*sc = SC_CONTENT_LENGTH;
  -}
  -else if (!strcmp(header_name, cookie2)) {
  -*sc = SC_COOKIE2;
  -}
  -else {
  -return JK_FALSE;
  -}
  +case 'C':
  +if (memcmp(p, OOKIE, 5) == 0)
  +return SC_COOKIE;
  +else if(memcmp(p, ONNECTION, 9) == 0)
  +return SC_CONNECTION;
  +else if(memcmp(p, ONTENT-TYPE, 11) == 0)
  +return SC_CONTENT_TYPE;
  +else if(memcmp(p, ONTENT-LENGTH, 13) == 0)
  +return SC_CONTENT_LENGTH;
  +else if(memcmp(p, OOKIE2, 6) == 0)
  +return SC_COOKIE2;
  +else
  +return UNKNOWN_METHOD;
   break;
  -
  -case 'h':
  -if (!strcmp(header_name, host)) {
  -*sc = 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-12-12 Thread mturk
mturk   2004/12/12 23:39:51

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix the bug initializing ajp. The worker will not initialize if cache_size
  was set to zero.
  
  Revision  ChangesPath
  1.66  +7 -6  
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.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- jk_ajp_common.c   26 Nov 2004 16:59:51 -  1.65
  +++ jk_ajp_common.c   13 Dec 2004 07:39:51 -  1.66
  @@ -1666,7 +1666,7 @@
jk_map_t *props, jk_worker_env_t *we, jk_logger_t *l, int proto)
   {
   int cache;
  -
  +int rc = JK_FALSE;
   /*
* start the connection cache
*/
  @@ -1682,7 +1682,7 @@
   jk_log(l, JK_LOG_ERROR,
  unknown protocol %d\n, proto);
   JK_TRACE_EXIT(l);
  -return JK_FALSE;
  +return rc;
   }
   
   if (pThis  pThis-worker_private) {
  @@ -1782,19 +1782,20 @@
   p-ep_cache[i] = NULL;
   }
   JK_INIT_CS((p-cs), i);
  -if (i) {
  +if (i == JK_FALSE) {
   JK_TRACE_EXIT(l);
  -return JK_TRUE;
  +return JK_FALSE;
   }
   }
   }
  +rc = JK_TRUE;
   }
   else {
   JK_LOG_NULL_PARAMS(l);
   }
   
   JK_TRACE_EXIT(l);
  -return JK_FALSE;
  +return rc;
   }
   
   int ajp_destroy(jk_worker_t **pThis, jk_logger_t *l, int proto)
  
  
  

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



Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-12-12 Thread newsletter
This is an automated message that will hopefully answer any questions you might 
have:


HOW TO UNSUBSCRIBE:
Visit www.insanepictures.com/unsubscribe.shtml and enter your email address 
into the unsubscribe box.


HOW TO SUBSCRIBE:
Visit www.insanepictures.com and enter your email address into the subscribe 
box.


HOW TO CHANGE YOUR EMAIL ADDRESS:
First unsubscribe, then subscribe with your new email address, using the 
instructions above.


HOW TO CONTACT US:
If you would like to send us a comment, ask a question, submit a picture or 
joke, or are interested in advertising, you can email us at [EMAIL PROTECTED]


Regards,
InsanePictures.com



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


cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-11-19 Thread mturk
mturk   2004/11/19 04:59:15

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add logging for retry attempts.
  
  Revision  ChangesPath
  1.64  +2 -1  
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.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- jk_ajp_common.c   12 Nov 2004 18:45:24 -  1.63
  +++ jk_ajp_common.c   19 Nov 2004 12:59:15 -  1.64
  @@ -1509,6 +1509,7 @@
   return JK_FALSE;
   }
   
  +jk_log(l, JK_LOG_DEBUG, processing with %d retries\n, s-retries);
   /* 
* JK_RETRIES could be replaced by the number of workers in
* a load-balancing configuration 
  
  
  

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



Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-11-19 Thread Kaniz Khan
When are you going to go to hell? I sincerely wish from my heart that you 
rot in hell forever for sending idiotic, foolish non-stop mails. Go to 
hell you stinky fools. 

Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-11-19 Thread Manav Gupta
You Are Getting Auto Responses.
I Hope You Do Undestand The Meaning Of Auto Response.
Sameway Go To Hell First And Wait For Me there...Forever

- Original Message -
From: Kaniz Khan [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Friday, November 19, 2004 6:35 PM
Subject: Re: cvs commit: jakarta-tomcat-connectors/jk/native/common
jk_ajp_common.c


 When are you going to go to hell? I sincerely wish from my heart that you
 rot in hell forever for sending idiotic, foolish non-stop mails. Go to
 hell you stinky fools.



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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-11-12 Thread mturk
mturk   2004/11/12 04:47:37

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Log retry instead of err.
  TODO: we should make the number of retries configurable.
  
  Revision  ChangesPath
  1.62  +2 -2  
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.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- jk_ajp_common.c   11 Nov 2004 18:26:57 -  1.61
  +++ jk_ajp_common.c   12 Nov 2004 12:47:37 -  1.62
  @@ -1563,7 +1563,7 @@
   else {
   jk_log(l, JK_LOG_INFO,
  sending request to tomcat failed in send loop. 
  -   err=%d\n, i);
  +   retry=%d\n, i);
   }
   
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-11-11 Thread mturk
mturk   2004/11/11 10:26:57

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add new trace macros and clean up some log messages.
  Needs more work on logging for recoverable operations.
  
  Revision  ChangesPath
  1.61  +190 -121  
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.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- jk_ajp_common.c   8 Nov 2004 13:37:46 -   1.60
  +++ jk_ajp_common.c   11 Nov 2004 18:26:57 -  1.61
  @@ -293,12 +293,13 @@
   unsigned char method;
   unsigned i;
   
  -jk_log(l, JK_LOG_DEBUG, Into ajp_marshal_into_msgb\n);
  +JK_TRACE_ENTER(l);
   
   if (!sc_for_req_method(s-method, method)) {
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - No such method %s\n,
  +   No such method %s\n,
  s-method);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   
  @@ -314,8 +315,8 @@
   jk_b_append_int(msg, (unsigned short)(s-num_headers))) {
   
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - 
  -   Error appending the message begining\n);
  +   failed appending the message begining\n);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   
  @@ -325,24 +326,24 @@
   if (sc_for_req_header(s-headers_names[i], sc)) {
   if (jk_b_append_int(msg, sc)) {
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - 
  -   Error appending the header name\n);
  +   failed appending the header name\n);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
   else {
   if (jk_b_append_string(msg, s-headers_names[i])) {
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - 
  -   Error appending the header name\n);
  +   failed appending the header name\n);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
   
   if (jk_b_append_string(msg, s-headers_values[i])) {
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - 
  -   Error appending the header value\n);
  +   failed appending the header value\n);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
  @@ -351,8 +352,8 @@
   if (jk_b_append_byte(msg, SC_A_SECRET) ||
   jk_b_append_string(msg, s-secret)) {
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - 
  -   Error appending secret\n);
  +   failed appending secret\n);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
  @@ -361,8 +362,8 @@
   if (jk_b_append_byte(msg, SC_A_REMOTE_USER) ||
   jk_b_append_string(msg, s-remote_user)) {
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - 
  -   Error appending the remote user\n);
  +   failed appending the remote user\n);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
  @@ -370,8 +371,8 @@
   if (jk_b_append_byte(msg, SC_A_AUTH_TYPE) ||
   jk_b_append_string(msg, s-auth_type)) {
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - 
  -   Error appending the auth type\n);
  +   failed appending the auth type\n);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
  @@ -383,8 +384,8 @@
   jk_b_append_string(msg, s-query_string)) {
   #endif
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - 
  -   Error appending the query string\n);
  +   failed appending the query string\n);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
  @@ -392,8 +393,8 @@
   if (jk_b_append_byte(msg, SC_A_JVM_ROUTE) ||
   jk_b_append_string(msg, s-jvm_route)) {
   jk_log(l, JK_LOG_ERROR,
  -   Error ajp_marshal_into_msgb - 
  -   Error appending the jvm route\n);
  +   failed appending the jvm route\n);
  +JK_TRACE_EXIT(l);
   return JK_FALSE;
   }
   }
  @@ -401,8 +402,8 @@
   if (jk_b_append_byte(msg, SC_A_SSL_CERT) ||
   jk_b_append_string(msg, s-ssl_cert)) {
   jk_log(l, 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-11-08 Thread mturk
mturk   2004/11/08 05:37:46

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Use socket timeout and recycle timeout.
  
  Revision  ChangesPath
  1.60  +21 -13
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.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- jk_ajp_common.c   8 Oct 2004 07:50:39 -   1.59
  +++ jk_ajp_common.c   8 Nov 2004 13:37:46 -   1.60
  @@ -728,7 +728,8 @@
   
   for (attempt = 0; attempt  ae-worker-connect_retry_attempts; 
attempt++) {
   ae-sd = jk_open_socket(ae-worker-worker_inet_addr, JK_TRUE,
  -ae-worker-keepalive, l);
  +ae-worker-keepalive,
  +ae-worker-socket_timeout, l);
   if (ae-sd = 0) {
   jk_log(l, JK_LOG_DEBUG,
  In jk_endpoint_t::ajp_connect_to_endpoint, 
  @@ -742,7 +743,7 @@
   return (ae-worker-logon(ae, l));
   
   /* should we send a CPING to validate connection ? */
  -if (ae-worker-connect_timeout != 0)
  +if (ae-worker-connect_timeout  0)
   return (ajp_handle_cping_cpong
   (ae, ae-worker-connect_timeout, l));
   
  @@ -1483,9 +1484,9 @@
  without recovery in send loop %d\n, i);
   return JK_FALSE;
   }
  -jk_log(l, JK_LOG_ERROR,
  -   ERROR: Receiving from tomcat failed, 
  -   recoverable operation. err=%d\n, i);
  +jk_log(l, JK_LOG_INFO,
  +   Receiving from tomcat failed, 
  +   recoverable operation attempt=%d\n, i);
   }
   }
   
  @@ -1604,7 +1605,7 @@
   ajp_worker_t *p = pThis-worker_private;
   int cache_sz = jk_get_worker_cache_size(props, p-name, cache);
   p-socket_timeout =
  -jk_get_worker_socket_timeout(props, p-name, AJP13_DEF_TIMEOUT);
  +jk_get_worker_socket_timeout(props, p-name, 
AJP_DEF_SOCKET_TIMEOUT);
   
   jk_log(l, JK_LOG_DEBUG,
  In jk_worker_t::init, setting socket timeout to %d\n,
  @@ -1617,6 +1618,13 @@
  In jk_worker_t::init, setting socket keepalive to %d\n,
  p-keepalive);
   
  +p-recycle_timeout =
  +jk_get_worker_recycle_timeout(props, p-name, AJP13_DEF_TIMEOUT);
  +
  +jk_log(l, JK_LOG_DEBUG,
  +   In jk_worker_t::init, setting connection recycle timeout to 
%d\n,
  +   p-recycle_timeout);
  +
   p-cache_timeout =
   jk_get_worker_cache_timeout(props, p-name,
   AJP_DEF_CACHE_TIMEOUT);
  @@ -1797,8 +1805,8 @@
   if (aw-cache_timeout) {
   for (; i  aw-ep_cache_sz; i++) {
   if (aw-ep_cache[i]) {
  -unsigned elapsed =
  -(unsigned)(now - ae-last_access);
  +int elapsed =
  +(int)(now - ae-last_access);
   if (elapsed  aw-cache_timeout) {
   jk_log(l, JK_LOG_DEBUG,
  In jk_endpoint_t::ajp_get_endpoint,
  @@ -1814,18 +1822,18 @@
   if (ae) {
   if (ae-sd  0) {
   /* Handle timeouts for open sockets */
  -unsigned elapsed = (unsigned)(now - ae-last_access);
  +int elapsed = (int)(now - ae-last_access);
   ae-last_access = now;
   jk_log(l, JK_LOG_DEBUG,
  In jk_endpoint_t::ajp_get_endpoint, 
  time elapsed since last request = %u 
seconds\n,
  elapsed);
  -if (aw-socket_timeout  0 
  -elapsed  aw-socket_timeout) {
  +if (aw-recycle_timeout  0 
  +elapsed  aw-recycle_timeout) {
   jk_close_socket(ae-sd);
   jk_log(l, JK_LOG_DEBUG,
  In jk_endpoint_t::ajp_get_endpoint, 
  -   reached socket timeout, closed sd = 
%d\n,
  +   reached connection recycle timeout, 
closed sd = %d\n,
  ae-sd);
   ae-sd = -1;/* just to avoid twice close 
*/

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-08-31 Thread hgomez
hgomez  2004/08/31 01:33:24

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix Bugzilla#12404 and ensure that now is correctly initialized.
  
  Patch provided by rainer.jung at kippdata.de
  
  Revision  ChangesPath
  1.58  +4 -6  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.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- jk_ajp_common.c   9 Aug 2004 22:30:53 -   1.57
  +++ jk_ajp_common.c   31 Aug 2004 08:33:24 -  1.58
  @@ -1750,9 +1750,7 @@
   if (rc) {
   unsigned i;
   time_t now;
  -if (aw-socket_timeout  0 || aw-cache_timeout) {
  -now = time(NULL);
  -}
  +now = time(NULL);
   for (i = 0 ; i  aw-ep_cache_sz ; i++) {
   if (aw-ep_cache[i]) {
   ae = aw-ep_cache[i];
  @@ -1768,7 +1766,7 @@
   if (elapsed  aw-cache_timeout) {
   jk_log(l, JK_LOG_DEBUG, 
   In jk_endpoint_t::ajp_get_endpoint, 
  - cleaning cache slot = %d elapsed %d\n,
  + cleaning cache slot = %d elapsed %u\n,
i, elapsed);
   ajp_close_endpoint(aw-ep_cache[i], l);
   aw-ep_cache[i] = NULL;
  @@ -1784,7 +1782,7 @@
   ae-last_access = now;
   jk_log(l, JK_LOG_DEBUG,
 In jk_endpoint_t::ajp_get_endpoint, 
  -  time elapsed since last request = %d seconds\n,
  +  time elapsed since last request = %u seconds\n,
  elapsed);
   if (aw-socket_timeout  0 
   elapsed  aw-socket_timeout) {
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-08-09 Thread mmanders
mmanders2004/08/09 15:30:53

  Modified:jk/native/common jk_ajp_common.c
  Log:
  The variables being referenced by the format strings were in the wrong order.
  
  Revision  ChangesPath
  1.57  +3 -3  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.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- jk_ajp_common.c   1 Mar 2004 13:51:48 -   1.56
  +++ jk_ajp_common.c   9 Aug 2004 22:30:53 -   1.57
  @@ -801,7 +801,7 @@
   jk_log(l, JK_LOG_ERROR,
  ajp_connection_tcp_get_message: 
  Error - Wrong message format 0x%04x from %s\n,
  -   jk_dump_hinfo(ae-worker-worker_inet_addr, buf), header);
  +   header, jk_dump_hinfo(ae-worker-worker_inet_addr, buf));
   }
   return JK_FALSE;
   }
  @@ -818,7 +818,7 @@
   jk_log(l, JK_LOG_ERROR,
  ajp_connection_tcp_get_message: 
  Error - Wrong message format 0x%04x from %s\n,
  -   jk_dump_hinfo(ae-worker-worker_inet_addr, buf), header);
  +   header, jk_dump_hinfo(ae-worker-worker_inet_addr, buf));
   }
   return JK_FALSE;
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-03-01 Thread hgomez
hgomez  2004/03/01 03:21:03

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add more informations on port we're using...
  
  Revision  ChangesPath
  1.53  +5 -5  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.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- jk_ajp_common.c   25 Feb 2004 03:33:06 -  1.52
  +++ jk_ajp_common.c   1 Mar 2004 11:21:03 -   1.53
  @@ -699,8 +699,8 @@
   if(ae-sd = 0) {
   jk_log(l, JK_LOG_DEBUG,
  In jk_endpoint_t::ajp_connect_to_endpoint, 
  -   connected sd = %d\n,
  -   ae-sd);
  +   connected sd = %d, port = %d\n,
  +   ae-sd, (int)ae-worker-worker_inet_addr.sin_port);
   
/* set last_access */
ae-last_access = time(NULL);
  @@ -718,8 +718,8 @@
   
   jk_log(l, JK_LOG_INFO,
  Error connecting to tomcat. Tomcat is probably not started or is 
  -   listening on the wrong port. Failed errno = %d\n,
  -   errno);
  +   listening on the wrong port (%d). Failed errno = %d\n,
  +   (int)ae-worker-worker_inet_addr.sin_port, errno);
   return JK_FALSE;
   }
   
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-03-01 Thread hgomez
hgomez  2004/03/01 05:47:23

  Modified:jk/native/common jk_ajp_common.c
  Log:
  More debug/trace infos on remote tomcats
  
  Revision  ChangesPath
  1.55  +13 -11jakarta-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.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- jk_ajp_common.c   1 Mar 2004 13:37:38 -   1.54
  +++ jk_ajp_common.c   1 Mar 2004 13:47:23 -   1.55
  @@ -795,12 +795,13 @@
   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);
  +   Error - received AJP14 reply on an AJP13 connection from 
%s\n,
  +   jk_dump_hinfo(ae-worker-worker_inet_addr, buf));
   } else {
   jk_log(l, JK_LOG_ERROR,
  ajp_connection_tcp_get_message: 
  -   Error - Wrong message format 0x%04x\n,
  -   header);
  +   Error - Wrong message format 0x%04x from %s\n,
  +   jk_dump_hinfo(ae-worker-worker_inet_addr, buf, header);
   }
   return JK_FALSE;
   }
  @@ -811,12 +812,13 @@
   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);
  +   Error - received AJP13 reply on an AJP14 connection from 
%s\n,
  +   jk_dump_hinfo(ae-worker-worker_inet_addr, buf));
   } else {
   jk_log(l, JK_LOG_ERROR,
  ajp_connection_tcp_get_message: 
  -   Error - Wrong message format 0x%04x\n,
  -   header);
  +   Error - Wrong message format 0x%04x from %s\n,
  +   jk_dump_hinfo(ae-worker-worker_inet_addr, buf), header);
   }
   return JK_FALSE;
   }
  @@ -828,8 +830,8 @@
   if(msglen  jk_b_get_size(msg)) {
   jk_log(l, JK_LOG_ERROR,
  ajp_connection_tcp_get_message: 
  -   Error - Wrong message size %d %d\n,
  -   msglen, jk_b_get_size(msg));
  +   Error - Wrong message size %d %d from %s\n,
  +   msglen, jk_b_get_size(msg), 
jk_dump_hinfo(ae-worker-worker_inet_addr, buf));
   return JK_FALSE;
   }
   
  @@ -840,8 +842,8 @@
   if(rc  0) {
   jk_log(l, JK_LOG_ERROR,
  ERROR: can't receive the response message from tomcat, 
  -   network problems or tomcat is down %d\n,
  -   rc);
  +   network problems or tomcat (%s) is down %d\n,
  +   jk_dump_hinfo(ae-worker-worker_inet_addr, buf), rc);
   return JK_FALSE;
   }
   
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-03-01 Thread hgomez
hgomez  2004/03/01 05:51:48

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Ups
  
  Revision  ChangesPath
  1.56  +2 -2  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.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- jk_ajp_common.c   1 Mar 2004 13:47:23 -   1.55
  +++ jk_ajp_common.c   1 Mar 2004 13:51:48 -   1.56
  @@ -801,7 +801,7 @@
   jk_log(l, JK_LOG_ERROR,
  ajp_connection_tcp_get_message: 
  Error - Wrong message format 0x%04x from %s\n,
  -   jk_dump_hinfo(ae-worker-worker_inet_addr, buf, header);
  +   jk_dump_hinfo(ae-worker-worker_inet_addr, buf), header);
   }
   return JK_FALSE;
   }
  
  
  

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



Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-03-01 Thread Henri Gomez
[EMAIL PROTECTED] wrote:

hgomez  2004/03/01 05:47:23

  Modified:jk/native/common jk_ajp_common.c
  Log:
  More debug/trace infos on remote tomcats
I added more infos on IP/PORT of remote tomcats in jk, since I've some
reports that there is a problem for admins to determine which tomcat
is down when they have many workers defined...
I overcome the inet_ntoa by using a jk_dump_hinfo function which should
works also in multi-threaded env.
It should works on Unixes, but I'd like to have reports from
Win32, Netware and others exotics OS users...
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-02-24 Thread truk
truk2004/02/24 19:33:06

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix bug 22604. Patch from David Rees.
  
  Revision  ChangesPath
  1.52  +2 -2  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.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- jk_ajp_common.c   24 Feb 2004 08:45:46 -  1.51
  +++ jk_ajp_common.c   25 Feb 2004 03:33:06 -  1.52
  @@ -718,7 +718,7 @@
   
   jk_log(l, JK_LOG_INFO,
  Error connecting to tomcat. Tomcat is probably not started or is 
  -   listenning on the wrong port. Failed errno = %d\n,
  +   listening on the wrong port. Failed errno = %d\n,
  errno);
   return JK_FALSE;
   }
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-02-17 Thread hgomez
hgomez  2004/02/17 02:38:25

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Oups, missing bracket
  
  Revision  ChangesPath
  1.49  +53 -53jakarta-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.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- jk_ajp_common.c   17 Feb 2004 10:36:00 -  1.48
  +++ jk_ajp_common.c   17 Feb 2004 10:38:25 -  1.49
  @@ -1282,58 +1282,58 @@
}

   if(!ajp_connection_tcp_get_message(p, op-reply, l)) {
  -/* we just can't recover, unset recover flag */
  - if(headeratclient == JK_FALSE) {
  -jk_log(l, JK_LOG_ERROR,
  -   Tomcat is down or network problems. 
  -   No response has been sent to the client (yet)\n);
  - /*
  -  * communication with tomcat has been interrupted BEFORE 
  -   * headers have been sent to the client.
  -   * DISCUSSION: As we suppose that tomcat has already started
  -   * to process the query we think it's unrecoverable (and we
  -   * should not retry or switch to another tomcat in the 
  -   * cluster). 
  -   */
  -   
  -   /*
  -* We mark it unrecoverable if recovery_opts set to 
RECOVER_ABORT_IF_TCGETREQUEST 
  -*/
  -if (p-worker-recovery_opts  RECOVER_ABORT_IF_TCGETREQUEST)
  - op-recoverable = JK_FALSE;
  -   /* 
  -* we want to display the webservers error page, therefore
  -* we return JK_FALSE 
  -*/
  -return JK_FALSE;
  -
  - } else {
  -jk_log(l, JK_LOG_ERROR,
  -   Error reading reply from tomcat. 
  -   Tomcat is down or network problems. 
  -Part of the response has already been sent to the 
client\n);
  - 
  - /* communication with tomcat has been interrupted AFTER 
  -  * headers have been sent to the client.
  -  * headers (and maybe parts of the body) have already been
  -  * sent, therefore the response is complete in a sense
  -  * that nobody should append any data, especially no 500 error 
  -  * page of the webserver! 
  -  *
  -  * BUT if you retrun JK_TRUE you have a 200 (OK) code in 
your
  -  * in your apache access.log instead of a 500 (Error). 
  -  * Therefore return FALSE/FALSE
  - * return JK_TRUE; 
  - */
  -
  - /*
  -  * We mark it unrecoverable if recovery_opts set to 
RECOVER_ABORT_IF_TCSENDHEADER 
  - */
  -if (p-worker-recovery_opts  RECOVER_ABORT_IF_TCSENDHEADER)
  - op-recoverable = JK_FALSE;
  - 
  - return JK_FALSE;
  - }
  + /* we just can't recover, unset recover flag */
  + if(headeratclient == JK_FALSE) {
  + jk_log(l, JK_LOG_ERROR,
  +Tomcat is down or network problems. 
  +No response has been sent to the client (yet)\n);
  +  /*
  +   * communication with tomcat has been interrupted BEFORE 
  +   * headers have been sent to the client.
  +   * DISCUSSION: As we suppose that tomcat has already started
  +   * to process the query we think it's unrecoverable (and we
  +   * should not retry or switch to another tomcat in the 
  +   * cluster). 
  +   */
  +   
  +   /*
  +* We mark it unrecoverable if recovery_opts set to 
RECOVER_ABORT_IF_TCGETREQUEST 
  +*/
  + if (p-worker-recovery_opts  RECOVER_ABORT_IF_TCGETREQUEST)
  + op-recoverable = JK_FALSE;
  +   /* 
  +* we want to display the webservers error page, therefore
  +* we return JK_FALSE 
  +*/
  +return JK_FALSE;
  + } else {
  + jk_log(l, JK_LOG_ERROR,
  +Error reading reply from tomcat. 
  +Tomcat is down or network problems. 
  +Part of the response 

Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-02-17 Thread David Rees
Umm, tab police?  ;-)

-Dave

[EMAIL PROTECTED] wrote, On 2/17/2004 2:38 AM:

hgomez  2004/02/17 02:38:25

  Modified:jk/native/common jk_ajp_common.c
  -  	/* communication with tomcat has been interrupted AFTER 
  -		 * headers have been sent to the client.
  -	 * headers (and maybe parts of the body) have already been
  -  		 * sent, therefore the response is complete in a sense
  -		 * that nobody should append any data, especially no 500 error 
  -		 * page of the webserver! 
  -		 *
  -  		 * BUT if you retrun JK_TRUE you have a 200 (OK) code in your
  -		 * in your apache access.log instead of a 500 (Error). 
  -			 * Therefore return FALSE/FALSE
  - * return JK_TRUE; 
  - */


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


Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-02-17 Thread David Rees
Attached is a patch which cleans it up.

-Dave

David Rees wrote, On 2/17/2004 8:28 AM:

Umm, tab police?  ;-)

-Dave

[EMAIL PROTECTED] wrote, On 2/17/2004 2:38 AM:

hgomez  2004/02/17 02:38:25

  Modified:jk/native/common jk_ajp_common.c
  -  /* communication with tomcat has been interrupted 
AFTER   - * headers have been sent to the client.
  - * headers (and maybe parts of the body) have 
already been
  -   * sent, therefore the response is complete in 
a sense
  - * that nobody should append any data, especially 
no 500 error   - * page of the webserver!   
- *
  -   * BUT if you retrun JK_TRUE you have a 200 (OK) 
code in your
  - * in your apache access.log instead of a 500 
(Error).   - * Therefore return FALSE/FALSE
  - * return JK_TRUE;   - */


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

--- jk_ajp_common.c.orig2004-02-17 08:29:48.741514459 -0800
+++ jk_ajp_common.c 2004-02-17 08:33:47.518132894 -0800
@@ -658,28 +658,28 @@
inttimeout,
jk_logger_t   *l)
 {
-   fd_set  rset; 
-   fd_set  eset; 
-   struct  timeval tv;
-   int rc;
-   
-   FD_ZERO(rset);
-   FD_ZERO(eset);
-   FD_SET(ae-sd, rset);
-   FD_SET(ae-sd, eset);
+fd_set  rset; 
+fd_set  eset; 
+struct  timeval tv;
+int rc;
+
+FD_ZERO(rset);
+FD_ZERO(eset);
+FD_SET(ae-sd, rset);
+FD_SET(ae-sd, eset);
 
-   tv.tv_sec  = timeout / 1000;
-   tv.tv_usec = (timeout % 1000) * 1000;
+tv.tv_sec  = timeout / 1000;
+tv.tv_usec = (timeout % 1000) * 1000;
 
-   rc = select(ae-sd + 1, rset, NULL, eset, tv);
+rc = select(ae-sd + 1, rset, NULL, eset, tv);
   
 if ((rc  1) || (FD_ISSET(ae-sd, eset)))
-   {
-   jk_log(l, JK_LOG_ERROR, Error ajp13:is_input_event: error during 
select [%d]\n, rc);
-   return JK_FALSE;
-   }
-   
-   return ((FD_ISSET(ae-sd, rset)) ? JK_TRUE : JK_FALSE) ;
+{
+jk_log(l, JK_LOG_ERROR, Error ajp13:is_input_event: error during select 
[%d]\n, rc);
+return JK_FALSE;
+}
+
+return ((FD_ISSET(ae-sd, rset)) ? JK_TRUE : JK_FALSE) ;
 }
 
  
@@ -687,46 +687,46 @@
  * Handle the CPING/CPONG initial query
  */
 int ajp_handle_cping_cpong(ajp_endpoint_t *ae,
-  int  timeout,
+   inttimeout,
jk_logger_t*l)
 {
-   int cmd;
-   jk_msg_buf_t * msg;
+intcmd;
+jk_msg_buf_t * msg;
+
+msg = jk_b_new(ae-pool);
+jk_b_set_buffer_size(msg, 16);/* 16 is way too large but I'm lazy :-) */
+jk_b_reset(msg);
+jk_b_append_byte(msg, AJP13_CPING_REQUEST); 
 
-   msg = jk_b_new(ae-pool);
-   jk_b_set_buffer_size(msg, 16);  /* 16 is way too large but I'm lazy :-) */
-   jk_b_reset(msg);
-   jk_b_append_byte(msg, AJP13_CPING_REQUEST); 
-
-   /* Send CPing query */  
-   if (ajp_connection_tcp_send_message(ae, msg, l) != JK_TRUE)
-   {
-   jk_log(l, JK_LOG_ERROR, Error ajp13:cping: can't send cping query\n);
-   return JK_FALSE;
-   }
-   
-   /* wait for Pong reply for timeout milliseconds
-*/
-   if (ajp_is_input_event(ae, timeout, l) == JK_FALSE)
-   {
-   jk_log(l, JK_LOG_ERROR, Error ajp13:cping: timeout in reply pong\n);
-   return JK_FALSE;
-   }
-   
-   /* Read and check for Pong reply 
-*/
-   if (ajp_connection_tcp_get_message(ae, msg, l) != JK_TRUE)
-   {
-   jk_log(l, JK_LOG_ERROR, Error ajp13:cping: awaited reply cpong, not 
received\n);
-   return JK_FALSE;
-   }
-   
-   if ((cmd = jk_b_get_byte(msg)) != AJP13_CPONG_REPLY) {
-   jk_log(l, JK_LOG_ERROR, Error ajp13:cping: awaited reply cpong, 
received %d instead\n, cmd);
-   return JK_FALSE;
-   }
+/* Send CPing query */
+if (ajp_connection_tcp_send_message(ae, msg, l) != JK_TRUE)
+{
+jk_log(l, JK_LOG_ERROR, Error ajp13:cping: can't send cping query\n);
+return JK_FALSE;
+}
+
+/* wait for Pong reply for timeout milliseconds
+ */
+if (ajp_is_input_event(ae, timeout, l) == JK_FALSE)
+{
+jk_log(l, JK_LOG_ERROR, Error ajp13:cping: timeout in reply pong\n);
+return JK_FALSE;
+}
+
+/* Read and check for Pong reply 
+ */
+if (ajp_connection_tcp_get_message(ae, msg, l) != JK_TRUE)
+{
+jk_log(l, 

Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-02-17 Thread Henri Gomez
David Rees wrote:

Attached is a patch which cleans it up.

Applied and commited thanks

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


cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-02-17 Thread hgomez
hgomez  2004/02/17 09:36:19

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Avoid problems with Tab Police (Damn't Eclipse)

  
  Revision  ChangesPath
  1.50  +186 -186  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.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- jk_ajp_common.c   17 Feb 2004 10:38:25 -  1.49
  +++ jk_ajp_common.c   17 Feb 2004 17:36:19 -  1.50
  @@ -658,28 +658,28 @@
  inttimeout,
  jk_logger_t   *l)
   {
  - fd_set  rset; 
  - fd_set  eset; 
  - struct  timeval tv;
  - int rc;
  - 
  - FD_ZERO(rset);
  - FD_ZERO(eset);
  - FD_SET(ae-sd, rset);
  - FD_SET(ae-sd, eset);
  +fd_set  rset; 
  +fd_set  eset; 
  +struct  timeval tv;
  +int rc;
  +
  +FD_ZERO(rset);
  +FD_ZERO(eset);
  +FD_SET(ae-sd, rset);
  +FD_SET(ae-sd, eset);
   
  - tv.tv_sec  = timeout / 1000;
  - tv.tv_usec = (timeout % 1000) * 1000;
  +tv.tv_sec  = timeout / 1000;
  +tv.tv_usec = (timeout % 1000) * 1000;
   
  - rc = select(ae-sd + 1, rset, NULL, eset, tv);
  +rc = select(ae-sd + 1, rset, NULL, eset, tv);
 
   if ((rc  1) || (FD_ISSET(ae-sd, eset)))
  - {
  - jk_log(l, JK_LOG_ERROR, Error ajp13:is_input_event: error during 
select [%d]\n, rc);
  - return JK_FALSE;
  - }
  - 
  - return ((FD_ISSET(ae-sd, rset)) ? JK_TRUE : JK_FALSE) ;
  +{
  +jk_log(l, JK_LOG_ERROR, Error ajp13:is_input_event: error during select 
[%d]\n, rc);
  +return JK_FALSE;
  +}
  +
  +return ((FD_ISSET(ae-sd, rset)) ? JK_TRUE : JK_FALSE) ;
   }
   

  @@ -687,46 +687,46 @@
* Handle the CPING/CPONG initial query
*/
   int ajp_handle_cping_cpong(ajp_endpoint_t *ae,
  -int  timeout,
  +   inttimeout,
  jk_logger_t*l)
   {
  - int cmd;
  - jk_msg_buf_t * msg;
  +intcmd;
  +jk_msg_buf_t * msg;
   
  - msg = jk_b_new(ae-pool);
  - jk_b_set_buffer_size(msg, 16);  /* 16 is way too large but I'm lazy :-) */
  - jk_b_reset(msg);
  - jk_b_append_byte(msg, AJP13_CPING_REQUEST); 
  -
  - /* Send CPing query */  
  - if (ajp_connection_tcp_send_message(ae, msg, l) != JK_TRUE)
  - {
  - jk_log(l, JK_LOG_ERROR, Error ajp13:cping: can't send cping query\n);
  - return JK_FALSE;
  - }
  - 
  - /* wait for Pong reply for timeout milliseconds
  -  */
  - if (ajp_is_input_event(ae, timeout, l) == JK_FALSE)
  - {
  - jk_log(l, JK_LOG_ERROR, Error ajp13:cping: timeout in reply pong\n);
  - return JK_FALSE;
  - }
  - 
  - /* Read and check for Pong reply 
  -  */
  - if (ajp_connection_tcp_get_message(ae, msg, l) != JK_TRUE)
  - {
  - jk_log(l, JK_LOG_ERROR, Error ajp13:cping: awaited reply cpong, not 
received\n);
  - return JK_FALSE;
  - }
  - 
  - if ((cmd = jk_b_get_byte(msg)) != AJP13_CPONG_REPLY) {
  - jk_log(l, JK_LOG_ERROR, Error ajp13:cping: awaited reply cpong, 
received %d instead\n, cmd);
  - return JK_FALSE;
  - }
  +msg = jk_b_new(ae-pool);
  +jk_b_set_buffer_size(msg, 16);/* 16 is way too large but I'm lazy :-) */
  +jk_b_reset(msg);
  +jk_b_append_byte(msg, AJP13_CPING_REQUEST); 
   
  - return JK_TRUE;
  +/* Send CPing query */
  +if (ajp_connection_tcp_send_message(ae, msg, l) != JK_TRUE)
  +{
  +jk_log(l, JK_LOG_ERROR, Error ajp13:cping: can't send cping query\n);
  +return JK_FALSE;
  +}
  +
  +/* wait for Pong reply for timeout milliseconds
  + */
  +if (ajp_is_input_event(ae, timeout, l) == JK_FALSE)
  +{
  +jk_log(l, JK_LOG_ERROR, Error ajp13:cping: timeout in reply pong\n);
  +return JK_FALSE;
  +}
  +
  +/* Read and check for Pong reply 
  + */
  +if (ajp_connection_tcp_get_message(ae, msg, l) != JK_TRUE)
  +{
  +jk_log(l, JK_LOG_ERROR, Error ajp13:cping: awaited reply cpong, not 
received\n);
  +return JK_FALSE;
  +}
  +
  +if ((cmd = jk_b_get_byte(msg)) != AJP13_CPONG_REPLY) {
  +jk_log(l, JK_LOG_ERROR, Error ajp13:cping: awaited reply cpong, received 
%d instead\n, cmd);
  +return JK_FALSE;
  +}
  +
  +return JK_TRUE;
   }
   
   int ajp_connect_to_endpoint(ajp_endpoint_t *ae,
  @@ -749,10 +749,10 @@
   if (ae-worker-logon != NULL)

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_global.h jk_lb_worker.c jk_msg_buff.c jk_msg_buff.h jk_service.h

2004-02-11 Thread hgomez
hgomez  2004/02/11 01:49:49

  Modified:jk/native/common jk_ajp_common.c jk_global.h jk_lb_worker.c
jk_msg_buff.c jk_msg_buff.h jk_service.h
  Log:
  Fix the POST recovery in LB mode.
  
  Revision  ChangesPath
  1.47  +22 -2 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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- jk_ajp_common.c   6 Feb 2004 08:37:46 -   1.46
  +++ jk_ajp_common.c   11 Feb 2004 09:49:49 -  1.47
  @@ -1091,7 +1091,20 @@
   }
   else
jk_log(l, JK_LOG_DEBUG, Resent the request body (%d)\n, postlen);
  - 
  +}
  +else if (s-reco_status == RECO_FILLED)
  +{
  + /* Recovery in LB MODE */
  + postlen = jk_b_get_len(s-reco_buf);
  +
  + if (postlen  AJP_HEADER_LEN) {
  + if(!ajp_connection_tcp_send_message(ae, s-reco_buf, l)) {
  + jk_log(l, JK_LOG_ERROR, Error resending request body (lb 
mode) (%d)\n, postlen);
  + return JK_FALSE;
  + }
  + }
  + else
  + jk_log(l, JK_LOG_DEBUG, Resent the request body (lb mode) (%d)\n, 
postlen);
   }
   else {
   /* We never sent any POST data and we check if we have to send at
  @@ -1117,6 +1130,13 @@
   op-recoverable = JK_FALSE;
   return JK_CLIENT_ERROR;
   }
  +
  +/* If a RECOVERY buffer is available in LB mode, fill it */
  +if (s-reco_status == RECO_INITED) {
  + jk_b_copy(op-post, s-reco_buf);
  + s-reco_status = RECO_FILLED;
  +}
  +
   s-content_read = len;
   if (!ajp_connection_tcp_send_message(ae, op-post, l)) {
   jk_log(l, JK_LOG_ERROR, Error sending request body\n);
  
  
  
  1.27  +9 -1  jakarta-tomcat-connectors/jk/native/common/jk_global.h
  
  Index: jk_global.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_global.h,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- jk_global.h   5 Jan 2004 22:41:53 -   1.26
  +++ jk_global.h   11 Feb 2004 09:49:49 -  1.27
  @@ -163,6 +163,14 @@
   #endif
   
   /*
  + * RECO STATUS
  + */
  +
  +#define RECO_NONE0x00
  +#define RECO_INITED  0x01
  +#define RECO_FILLED  0x02
  +
  +/*
* JK options
*/
   
  
  
  
  1.16  +6 -2  jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c
  
  Index: jk_lb_worker.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- jk_lb_worker.c6 Feb 2004 08:37:59 -   1.15
  +++ jk_lb_worker.c11 Feb 2004 09:49:49 -  1.16
  @@ -323,7 +323,11 @@
   /* you can not recover on another load balancer */
   *is_recoverable_error = JK_FALSE;
   
  -
  +/* set the recovery post, for LB mode */
  +s-reco_buf = jk_b_new(s-pool);
  +jk_b_set_buffer_size(s-reco_buf, DEF_BUFFER_SZ);
  +jk_b_reset(s-reco_buf);
  +s-reco_status = RECO_INITED;   
 
   while(1) {
   worker_record_t *rec = get_most_suitable_worker(p-worker, s, 
attempt++);
   int rc;
  
  
  
  1.15  +17 -1 jakarta-tomcat-connectors/jk/native/common/jk_msg_buff.c
  
  Index: jk_msg_buff.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_msg_buff.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- jk_msg_buff.c 5 Nov 2003 09:15:39 -   1.14
  +++ jk_msg_buff.c 11 Feb 2004 09:49:49 -  1.15
  @@ -476,3 +476,19 @@
   #endif
   }
   
  +
  +int jk_b_copy(jk_msg_buf_t *smsg,
  +  jk_msg_buf_t *dmsg)
  +{
  + if (smsg == NULL || dmsg == NULL)
  + return (-1);
  +
  + if (dmsg-maxlen  smsg-len)
  + return (-2);
  +
  + memcpy(dmsg-buf, smsg-buf, smsg-len);
  + dmsg-len = smsg-len;
  +
  + return (smsg-len);
  +}
  +
  
  
  
  1.8   +6 -1  jakarta-tomcat-connectors/jk/native/common/jk_msg_buff.h
  
  Index: jk_msg_buff.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_msg_buff.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-02-06 Thread hgomez
hgomez  2004/02/06 00:37:46

  Modified:jk/native/common jk_ajp_common.c
  Log:
  More info to track the potential problem in POST recovery
  
  Revision  ChangesPath
  1.46  +16 -9 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.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- jk_ajp_common.c   25 Jan 2004 23:51:41 -  1.45
  +++ jk_ajp_common.c   6 Feb 2004 08:37:46 -   1.46
  @@ -1007,6 +1007,7 @@
   ajp_operation_t *op)
   {
int err = 0;
  + int postlen;

   /* Up to now, we can recover */
   op-recoverable = JK_TRUE;
  @@ -1074,18 +1075,23 @@
  ae-left_bytes_to_send, jk_b_get_len(op-reply) - AJP_HEADER_LEN);
   
   /*
  - * POST recovery job is done here.
  - * It's not very fine to have posted data in reply but that's the only easy
  - * way to do that for now. Sharing the reply is really a bad solution but
  - * it will works for POST DATA less than 8k.
  + * POST recovery job is done here and will work when data to 
  + * POST are less than 8k, since it's the maximum size of op-post buffer.
* We send here the first part of data which was sent previously to the
* remote Tomcat
*/
  -if (jk_b_get_len(op-post)  AJP_HEADER_LEN) {
  + 
  +/* Did we have something to resend (ie the op-post has been feeded previously */
  +
  +postlen = jk_b_get_len(op-post);
  +if (postlen  AJP_HEADER_LEN) {
   if(!ajp_connection_tcp_send_message(ae, op-post, l)) {
  -jk_log(l, JK_LOG_ERROR, Error resending request body\n);
  +jk_log(l, JK_LOG_ERROR, Error resending request body (%d)\n, postlen);
   return JK_FALSE;
   }
  +else
  + jk_log(l, JK_LOG_DEBUG, Resent the request body (%d)\n, postlen);
  + 
   }
   else {
   /* We never sent any POST data and we check if we have to send at
  @@ -1096,7 +1102,7 @@
/* || s-is_chunked - this can't be done here. The original protocol
  sends the first chunk of post data ( based on Content-Length ),
  and that's what the java side expects.
  -Sending this data for chunked would break other ajp13 serers.
  +Sending this data for chunked would break other ajp13 servers.
   
   Note that chunking will continue to work - using the normal read.
*/
  @@ -1185,6 +1191,7 @@
   jk_log(l, JK_LOG_INFO,
  ERROR reading POST data from client. 
  Connection aborted or network problems\n);
  +   
   return JK_CLIENT_ERROR;   
   }
   break;
  @@ -1439,7 +1446,7 @@
  p-worker-name, errno);
   
   } else {
  -jk_log(l, JK_LOG_ERROR, In jk_endpoint_t::service, NULL parameters\n);
  +jk_log(l, JK_LOG_ERROR, ajp: end of service with error\n);
   }
   
   return JK_FALSE;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-01-25 Thread billbarker
billbarker2004/01/25 15:51:41

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Correct cut-and-paste bug.
  
  Fix for Bug #26398
  
  Submitted By: Rainer Jung [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.45  +2 -2  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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- jk_ajp_common.c   6 Jan 2004 21:44:20 -   1.44
  +++ jk_ajp_common.c   25 Jan 2004 23:51:41 -  1.45
  @@ -1565,7 +1565,7 @@
   p-reply_timeout);
   
   p-prepost_timeout =
  -jk_get_worker_reply_timeout(props, p-name, AJP_DEF_PREPOST_TIMEOUT);
  +jk_get_worker_prepost_timeout(props, p-name, AJP_DEF_PREPOST_TIMEOUT);
   
   jk_log(l, JK_LOG_DEBUG,
   In jk_worker_t::init, setting prepost timeout to %d\n,
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-01-06 Thread mmanders
mmanders2004/01/06 13:44:20

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fixed logic when attempting to reuse connections in ajp_send_request.  If the send 
is successful, we needed to get out of the while loop.  If the ping/pong or the 
request failed, try and reuse without getting out of the loop.
  
  Revision  ChangesPath
  1.44  +6 -2  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.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- jk_ajp_common.c   5 Jan 2004 22:42:03 -   1.43
  +++ jk_ajp_common.c   6 Jan 2004 21:44:20 -   1.44
  @@ -1025,14 +1025,18 @@
err++;
}   
   
  +/* If we got an error or can't send data, then try to get a pooled */
  +/* connection and try again.  If we are succesful, break out of this */
  +/* loop. */
   if (err || ajp_connection_tcp_send_message(ae, op-request, l) == JK_FALSE) 
{
jk_log(l, JK_LOG_INFO,
   Error sending request try another pooled connection\n);
jk_close_socket(ae-sd);
ae-sd = -1;
ajp_reuse_connection(ae, l);
  - break;
}
  +else
  +break;
}

   /*
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2004-01-05 Thread mmanders
mmanders2004/01/05 14:42:03

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Updated to build properly for NetWare with recent socket additions.
  
  Revision  ChangesPath
  1.43  +4 -1  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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- jk_ajp_common.c   5 Nov 2003 09:15:39 -   1.42
  +++ jk_ajp_common.c   5 Jan 2004 22:42:03 -   1.43
  @@ -72,6 +72,9 @@
   #ifdef AS400
   #include util_ebcdic.h
   #endif
  +#if defined(NETWARE)  defined(__NOVELL_LIBC__)
  +#include novsock2.h
  +#endif
   
   
   const char *response_trans_headers[] = {
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_ajp_common.h jk_ajp13.h

2003-10-16 Thread hgomez
hgomez  2003/10/16 00:37:43

  Modified:jk/native/common jk_ajp_common.c jk_ajp_common.h jk_ajp13.h
  Log:
  My latest patches to jk/ajp broke the AJP14 logon phase since I was 
  using the PING message which ask container to take control for
  PING/PONG control.
  Created CPING/CPONG message instead ...
  
  
  
  Revision  ChangesPath
  1.41  +19 -19jakarta-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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- jk_ajp_common.c   4 Oct 2003 09:20:59 -   1.40
  +++ jk_ajp_common.c   16 Oct 2003 07:37:42 -  1.41
  @@ -661,7 +661,7 @@
int rc;

FD_ZERO(rset);
  - FD_ZERO(eset);
  + FD_ZERO(eset);
FD_SET(ae-sd, rset);
FD_SET(ae-sd, eset);
   
  @@ -681,11 +681,11 @@
   

   /*
  - * Handle the PING/PONG initial query
  + * Handle the CPING/CPONG initial query
*/
  -int ajp_handle_ping_pong(ajp_endpoint_t *ae,
  -  inttimeout,
  - jk_logger_t*l)
  +int ajp_handle_cping_cpong(ajp_endpoint_t *ae,
  +int  timeout,
  +   jk_logger_t*l)
   {
int cmd;
jk_msg_buf_t * msg;
  @@ -693,12 +693,12 @@
msg = jk_b_new(ae-pool);
jk_b_set_buffer_size(msg, 16);  /* 16 is way too large but I'm lazy :-) */
jk_b_reset(msg);
  - jk_b_append_byte(msg, AJP13_PING_REQUEST); 
  + jk_b_append_byte(msg, AJP13_CPING_REQUEST); 
   
  - /* Send Ping query */   
  + /* Send CPing query */  
if (ajp_connection_tcp_send_message(ae, msg, l) != JK_TRUE)
{
  - jk_log(l, JK_LOG_ERROR, Error ajp13:ping: can't send ping query\n);
  + jk_log(l, JK_LOG_ERROR, Error ajp13:cping: can't send cping query\n);
return JK_FALSE;
}

  @@ -706,7 +706,7 @@
 */
if (ajp_is_input_event(ae, timeout, l) == JK_FALSE)
{
  - jk_log(l, JK_LOG_ERROR, Error ajp13:ping: timeout in reply pong\n);
  + jk_log(l, JK_LOG_ERROR, Error ajp13:cping: timeout in reply pong\n);
return JK_FALSE;
}

  @@ -714,12 +714,12 @@
 */
if (ajp_connection_tcp_get_message(ae, msg, l) != JK_TRUE)
{
  - jk_log(l, JK_LOG_ERROR, Error ajp13:ping: awaited reply pong, not 
received\n);
  + jk_log(l, JK_LOG_ERROR, Error ajp13:cping: awaited reply cpong, not 
received\n);
return JK_FALSE;
}

  - if ((cmd = jk_b_get_byte(msg)) != AJP13_PONG_REPLY) {
  - jk_log(l, JK_LOG_ERROR, Error ajp13:ping: awaited reply pong, 
received %d instead\n, cmd);
  + if ((cmd = jk_b_get_byte(msg)) != AJP13_CPONG_REPLY) {
  + jk_log(l, JK_LOG_ERROR, Error ajp13:cping: awaited reply cpong, 
received %d instead\n, cmd);
return JK_FALSE;
}
   
  @@ -746,9 +746,9 @@
   if (ae-worker-logon != NULL)
   return (ae-worker-logon(ae, l));
   
  - /* should we send a PING to validate connection ? */
  + /* should we send a CPING to validate connection ? */
if (ae-worker-connect_timeout != 0)
  - return (ajp_handle_ping_pong(ae, 
ae-worker-connect_timeout, l));
  + return (ajp_handle_cping_cpong(ae, 
ae-worker-connect_timeout, l));

   return JK_TRUE;
   }
  @@ -1015,10 +1015,10 @@
   {
err = 0;

  - /* handle ping/pong before request if timeout is set */
  + /* handle cping/cpong before request if timeout is set */
if (ae-worker-prepost_timeout != 0)
{
  - if (ajp_handle_ping_pong(ae, ae-worker-prepost_timeout, l) 
== JK_FALSE)
  + if (ajp_handle_cping_cpong(ae, ae-worker-prepost_timeout, l) 
== JK_FALSE)
err++;
}   
   
  @@ -1037,7 +1037,7 @@
*/
   if (ae-sd  0) {
   
  - /* no need to handle ping/pong here since it should be at connection time */
  + /* no need to handle cping/cpong here since it should be at connection time */
   
   if (ajp_connect_to_endpoint(ae, l) == JK_TRUE) {
   /*
  @@ -1521,7 +1521,7 @@
   
   if (pThis  pThis-worker_private) {
   ajp_worker_t *p = pThis-worker_private;
  -int cache_sz = jk_get_worker_cache_size(props, p-name, cache);
  +int cache_sz = 

Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2003-10-06 Thread Henri Gomez
[EMAIL PROTECTED] a crit :
mturk   2003/10/04 02:20:59

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Normal C compiler doesn't allow to declare variables
  like C++ does.
  
  Revision  ChangesPath
  1.40  +15 -21jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
Thanks Mladen ;)



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


cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2003-10-04 Thread mturk
mturk   2003/10/04 02:20:59

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Normal C compiler doesn't allow to declare variables
  like C++ does.
  
  Revision  ChangesPath
  1.40  +15 -21jakarta-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.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- jk_ajp_common.c   25 Sep 2003 15:22:08 -  1.39
  +++ jk_ajp_common.c   4 Oct 2003 09:20:59 -   1.40
  @@ -661,6 +661,7 @@
int rc;

FD_ZERO(rset);
  + FD_ZERO(eset);
FD_SET(ae-sd, rset);
FD_SET(ae-sd, eset);
   
  @@ -1520,56 +1521,49 @@
   
   if (pThis  pThis-worker_private) {
   ajp_worker_t *p = pThis-worker_private;
  -int cache_sz = jk_get_worker_cache_size(props, p-name, cache);
  -int socket_timeout =
  +int cache_sz = jk_get_worker_cache_size(props, p-name, cache);
  +p-socket_timeout =
  jk_get_worker_socket_timeout(props, p-name, AJP13_DEF_TIMEOUT);
   
   jk_log(l, JK_LOG_DEBUG,
  In jk_worker_t::init, setting socket timeout to %d\n,
  -   socket_timeout);
  +   p-socket_timeout);
   
  -int socket_keepalive =
  +p-keepalive =
   jk_get_worker_socket_keepalive(props, p-name, JK_FALSE);
   
   jk_log(l, JK_LOG_DEBUG,
  In jk_worker_t::init, setting socket keepalive to %d\n,
  -   socket_keepalive);
  +   p-keepalive);
   
  -int cache_timeout =
  +p-cache_timeout =
   jk_get_worker_cache_timeout(props, p-name, AJP_DEF_CACHE_TIMEOUT);
   
   jk_log(l, JK_LOG_DEBUG,
  In jk_worker_t::init, setting cache timeout to %d\n,
  -   cache_timeout);
  +   p-cache_timeout);
   
  -int connect_timeout =
  +p-connect_timeout =
   jk_get_worker_connect_timeout(props, p-name, AJP_DEF_CONNECT_TIMEOUT);
   
jk_log(l, JK_LOG_DEBUG,
   In jk_worker_t::init, setting connect timeout to %d\n,
  - connect_timeout);
  + p-connect_timeout);
   
  -int reply_timeout =
  +p-reply_timeout =
   jk_get_worker_reply_timeout(props, p-name, AJP_DEF_REPLY_TIMEOUT);
   
   jk_log(l, JK_LOG_DEBUG,
   In jk_worker_t::init, setting reply timeout to %d\n,
  -reply_timeout);
  +p-reply_timeout);
   
  -int prepost_timeout =
  +p-prepost_timeout =
   jk_get_worker_reply_timeout(props, p-name, AJP_DEF_PREPOST_TIMEOUT);
   
   jk_log(l, JK_LOG_DEBUG,
   In jk_worker_t::init, setting prepost timeout to %d\n,
  -prepost_timeout);
  +p-prepost_timeout);
   
  -p-socket_timeout = socket_timeout;
  -p-keepalive = socket_keepalive;
  -p-cache_timeout = cache_timeout;
  -p-connect_timeout = connect_timeout;
  -p-reply_timeout = reply_timeout;
  -p-prepost_timeout = prepost_timeout;
  -
   /* 
*  Need to initialize secret here since we could return from inside
*  of the following loop
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2003-07-15 Thread glenn
glenn   2003/07/15 05:15:18

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add worker name to tomcat connection failure error message
  
  Revision  ChangesPath
  1.37  +3 -3  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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- jk_ajp_common.c   4 Apr 2003 13:27:43 -   1.36
  +++ jk_ajp_common.c   15 Jul 2003 12:15:17 -  1.37
  @@ -1317,8 +1317,8 @@
   /* Log the error only once per failed request. */
   jk_log(l, JK_LOG_ERROR,
  Error connecting to tomcat. Tomcat is probably not started 
  -   or is listening on the wrong port. Failed errno = %d\n,
  -   errno);
  +   or is listening on the wrong port. worker=%s failed errno = %d\n,
  +   p-worker-name, errno);
   
   } else {
   jk_log(l, JK_LOG_ERROR, In jk_endpoint_t::service, NULL parameters\n);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2003-04-04 Thread hgomez
hgomez  2003/04/04 05:27:43

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Fix problem reported by bugzilla 18571...
  
  Revision  ChangesPath
  1.36  +2 -2  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.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- jk_ajp_common.c   14 Mar 2003 13:36:35 -  1.35
  +++ jk_ajp_common.c   4 Apr 2003 13:27:43 -   1.36
  @@ -1572,7 +1572,7 @@
   unsigned elapsed = (unsigned)(now-ae-last_access);
   if (elapsed  aw-cache_timeout) {
   jk_log(l, JK_LOG_DEBUG, 
  -In jk_endpoint_t::ajp_get_endpoint, \
  +In jk_endpoint_t::ajp_get_endpoint, 
cleaning cache slot = %d elapsed %d\n,
i, elapsed);
   ajp_close_endpoint(aw-ep_cache[i], l);
  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_ajp_common.h

2003-03-14 Thread glenn
glenn   2003/03/14 05:36:35

  Modified:jk/native CHANGES.txt
   jk/native/apache-2.0 mod_jk.c
   jk/native/common jk_ajp_common.c jk_ajp_common.h
  Log:
  Traced through the code to clean up error handling for when a client
  aborts a request.
  
  * The retry loop would continue to retry processing the request even
if the client aborted.  Fixed this.
  
  * If the client aborts set the aborted flag in the conn_rec
  
  * If the handler is invoked and the conn_rec aborted flag is set
return an HTTP_INTERNAL_SERVER_ERROR instead of processing a
request for an aborted client.
  
  * Setting the conn_rec aborted flag and checking it prevents mod_jk
from passing on a request to Tomcat for processing when the
client has aborted the connection. An HTML page could use SSI to
invoke multiple servlet's or JSP pages during a single request.
There is no need to continue processing these if the client has
aborted the connection.
  
  There was a bug in get_content_length() which would cause a SSI of
  a page which gets procesed by Tomcat to fail if the original client
  request was a POST.
  
  Cleaned up and reformatted code to 80 columns in source code files
  I worked on.
  
  Revision  ChangesPath
  1.11  +8 -2  jakarta-tomcat-connectors/jk/native/CHANGES.txt
  
  Index: CHANGES.txt
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/CHANGES.txt,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CHANGES.txt   28 Feb 2003 21:55:21 -  1.10
  +++ CHANGES.txt   14 Mar 2003 13:36:35 -  1.11
  @@ -11,7 +11,13 @@
 let Apache handle processing the error returned by Tomcat.
   * Added the load balancer sticky_session property. If set to 0
 requests with servlet SESSION ID's can be routed to any Tomcat
  -  worker. Default is 1, sessions are sticky.
  +  worker. Default is 1, sessions are sticky. [glenn]
  +* Cleaned up detection and reporting of aborted client connections.
  +  This cleanup also makes sure that mod_jk does not pass any requests
  +  on to Tomcat if the remote client aborted its connection. [glenn]
  +* Fixed a bug in Apache 2.0 which caused a POST request forwarded to
  +  Tomcat to fail if it generated SSI directives which were post
  +  processed by mod_include. [glenn]
   
   Changes with JK 1.2.2:
   * tomcat_trend.pl updated script to support changed logging of 
  
  
  
  1.67  +105 -105  jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
  
  Index: mod_jk.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- mod_jk.c  28 Feb 2003 17:58:39 -  1.66
  +++ mod_jk.c  14 Mar 2003 13:36:35 -  1.67
  @@ -103,14 +103,16 @@
   #define __arpa_inet_h__
   #define __sys_timeval_h__
   #endif
  +
  +#include jk_ajp13.h
   #include jk_global.h
  -#include jk_util.h
  +#include jk_logger.h
   #include jk_map.h
   #include jk_pool.h
   #include jk_service.h
  -#include jk_worker.h
   #include jk_uri_worker_map.h
  -#include jk_logger.h
  +#include jk_util.h
  +#include jk_worker.h
   
   #define JK_WORKER_ID(jakarta.worker)
   #define JK_HANDLER  (jakarta-servlet)
  @@ -233,59 +235,57 @@
  const char * const *header_values,
  unsigned num_of_headers)
   {
  -if(s  s-ws_private) {
  -unsigned h;
  -apache_private_data_t *p = s-ws_private;
  -request_rec *r = p-r;
  -
  -if(!reason) {
  -reason = ;
  -}
  -r-status = status;
  -r-status_line = apr_psprintf(r-pool, %d %s, status, reason);
  +unsigned h;
  +apache_private_data_t *p = s-ws_private;
  +request_rec *r = p-r;
  +
  +if(!reason) {
  +reason = ;
  +}
  +r-status = status;
  +r-status_line = apr_psprintf(r-pool, %d %s, status, reason);
   
  -for(h = 0 ; h  num_of_headers ; h++) {
  -if(!strcasecmp(header_names[h], Content-type)) {
  -char *tmp = apr_pstrdup(r-pool, header_values[h]);
  -ap_content_type_tolower(tmp);
  -/* It should be done like this in Apache 2.0 */
  -/* This way, Apache 2.0 will be able to set the output filter */
  -/* and it make jk useable with deflate using AddOutputFilterByType 
DEFLATE text/html */
  -ap_set_content_type(r, tmp);
  -} else if(!strcasecmp(header_names[h], Location)) {
  +for(h = 0 ; h  num_of_headers ; h++) {
  +if(!strcasecmp(header_names[h], Content-type)) {
  +char *tmp = 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2003-02-17 Thread costin
costin  2003/02/17 08:24:31

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Added more info to the log - the return code. It may help debug problems.
  
  Revision  ChangesPath
  1.34  +17 -16jakarta-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.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- jk_ajp_common.c   21 Nov 2002 17:53:48 -  1.33
  +++ jk_ajp_common.c   17 Feb 2003 16:24:31 -  1.34
  @@ -678,7 +678,7 @@
   rc = jk_tcp_socket_recvfull(ae-sd, head, AJP_HEADER_LEN);
   
   if(rc  0) {
  -jk_log(l, JK_LOG_ERROR, ERROR: can't receive the response message from 
tomcat, network problems or tomcat is down.\n);
  +jk_log(l, JK_LOG_ERROR, ERROR: can't receive the response message from 
tomcat, network problems or tomcat is down. err=%d\n, rc);
   return JK_FALSE;
   }
   
  @@ -721,7 +721,7 @@
   
   rc = jk_tcp_socket_recvfull(ae-sd, jk_b_get_buff(msg), msglen);
   if(rc  0) {
  -jk_log(l, JK_LOG_ERROR, ERROR: can't receive the response message from 
tomcat, network problems or tomcat is down\n);
  +jk_log(l, JK_LOG_ERROR, ERROR: can't receive the response message from 
tomcat, network problems or tomcat is down %d\n, rc);
   return JK_FALSE;
   }
   
  @@ -975,26 +975,27 @@
   
   case JK_AJP13_GET_BODY_CHUNK:
   {
  -int len = (int)jk_b_get_int(msg);
  +int len = (int)jk_b_get_int(msg);
   
  +if(len  0) {
  +len = 0;
  +}
   if(len  AJP13_MAX_SEND_BODY_SZ) {
   len = AJP13_MAX_SEND_BODY_SZ;
   }
  -if(len  ae-left_bytes_to_send) {
  +if((unsigned int)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, pmsg, len, l)) = 0) {
  -r-content_read += len;
  -return JK_AJP13_HAS_RESPONSE;
  -}  
   
  -jk_log(l, JK_LOG_ERROR, ERROR reading POST data from client. Connection 
aborted or network problems\n);
  -return JK_INTERNAL_ERROR;   
  +/* the right place to add file storage for upload */
  +if ((len = ajp_read_into_msg_buff(ae, r, pmsg, len, l)) = 0) {
  +r-content_read += len;
  +return JK_AJP13_HAS_RESPONSE;
  +}  
  +
  +jk_log(l, JK_LOG_ERROR, ERROR reading POST data from client. 
  +Connection aborted or network problems\n);
  +return JK_INTERNAL_ERROR;   
   }
   break;
   
  
  
  

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




Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.c

2002-11-27 Thread Costin Manolache
Glenn Nielsen wrote:

 Costin,
 
 Why were the log levels changed from LOG_ERROR to LOG_INFO, a connection
 failure to tomct is a real fatal error when handling a request. Shouldn't
 it be at the JK_LOG_ERROR level?

It'll be logged at ERROR level - 

   +jk_log(l, JK_LOG_ERROR, Error connecting to tomcat. Tomcat is
   probably not started or is listenning on the wrong port. Failed errno =
   %d\n, errno); +

( instead of the Can't find servlet handler :-)

I just limited the number of messages that are logged at ERROR level
for each failed connection, you should see a single error message.
If you want more verbosity - you'll get it as info.


Costin



 
 Regards,
 
 Glenn
 
 [EMAIL PROTECTED] wrote:
 costin  2002/10/30 14:12:20
 
   Modified:jk/native/common jk_ajp_common.c jk_connect.c
   Log:
   More trimming for error messages.
   
   Now only one line ( and hopefully more informative ) is displayed if
   we can't send the request to tomcat.
   
   Revision  ChangesPath
   1.32  +11 -5
   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.31 retrieving revision 1.32
   diff -u -r1.31 -r1.32
   --- jk_ajp_common.c30 Oct 2002 21:17:34 -  1.31
   +++ jk_ajp_common.c30 Oct 2002 22:12:20 -  1.32
   @@ -623,7 +623,9 @@
}
}

   -jk_log(l, JK_LOG_ERROR, ERROR connecting to tomcat. Tomcat is
   probably not started. Failed errno = %d\n, errno);
   +jk_log(l, JK_LOG_INFO,
   +   Error connecting to tomcat. Tomcat is probably not started
   or is listenning on the wrong port. Failed errno = %d\n,
   +   errno);
return JK_FALSE;
}

   @@ -869,7 +871,7 @@
return JK_FALSE;
}
} else {
   -jk_log(l, JK_LOG_ERROR, Error connecting to the Tomcat
   process.\n);
   +jk_log(l, JK_LOG_INFO, Error connecting to the Tomcat
   process.\n);
return JK_FALSE;
}
}
   @@ -1175,15 +1177,19 @@
return JK_FALSE;
}

   -jk_log(l, JK_LOG_ERROR, ERRORO: Receiving from tomcat
   failed, recoverable operation. err=%d\n, i);
   +jk_log(l, JK_LOG_ERROR, ERROR: Receiving from tomcat
   failed, recoverable operation. err=%d\n, i);
}
else
   -jk_log(l, JK_LOG_ERROR, ERROR: sending request to
   tomcat failed in send loop. err=%d\n, i);
   +jk_log(l, JK_LOG_INFO, sending request to tomcat
   failed in send loop. err=%d\n, i);

jk_close_socket(p-sd);
p-sd = -1;
ajp_reuse_connection(p, l);
}
   +
   +/* Log the error only once per failed request. */
   +jk_log(l, JK_LOG_ERROR, Error connecting to tomcat. Tomcat is
   probably not started or is listenning on the wrong port. Failed errno =
   %d\n, errno); +
} else {
jk_log(l, JK_LOG_ERROR, In jk_endpoint_t::service, NULL
parameters\n);
}
   
   
   
   1.6   +2 -2 
   jakarta-tomcat-connectors/jk/native/common/jk_connect.c
   
   Index: jk_connect.c
   ===
   RCS file:
   /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v
   retrieving revision 1.5 retrieving revision 1.6
   diff -u -r1.5 -r1.6
   --- jk_connect.c   4 Sep 2002 11:31:33 -   1.5
   +++ jk_connect.c   30 Oct 2002 22:12:20 -  1.6
   @@ -174,7 +174,7 @@
jk_log(l, JK_LOG_DEBUG, jk_open_socket, return, sd =
%d\n, sock); return sock;
}
   -jk_log(l, JK_LOG_ERROR, jk_open_socket, connect() failed
   errno = %d\n, errno);
   +jk_log(l, JK_LOG_INFO, jk_open_socket, connect() failed errno
   = %d\n, errno);
jk_close_socket(sock);
} else {
#ifdef WIN32
   
   
   
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For additional
 commands, e-mail: mailto:[EMAIL PROTECTED]




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




Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2002-11-22 Thread Henri Gomez
[EMAIL PROTECTED] wrote:

costin  2002/11/21 09:53:48

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Do not send the initial chunk for chunked encoding ( only for
  regular POST ).
  Ajp13 servers ( tomcat x.y, etc ) expect this initial chunk
  only if a content-length is specified.
  
  ( this is just an initial fix - I still need to test various
  cases )
  
  Revision  ChangesPath
  1.33  +10 -3 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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- jk_ajp_common.c	30 Oct 2002 22:12:20 -	1.32
  +++ jk_ajp_common.c	21 Nov 2002 17:53:48 -	1.33
  @@ -808,7 +808,7 @@
   }
   
   if (!r-is_chunked) {
  -ae-left_bytes_to_send -= len;
  +	ae-left_bytes_to_send -= len;
   }
   
   if (len  0) {
  @@ -905,7 +905,14 @@
* for resend if the remote Tomcat is down, a fact we will learn only
* doing a read (not yet) 
*/
  -if (s-is_chunked || ae-left_bytes_to_send  0) {
  +	/* || s-is_chunked - this can't be done here. The original protocol sends the first
  +	   chunk of post data ( based on Content-Length ), and that's what the java side expects.
  +	   Sending this data for chunked would break other ajp13 serers.
  +
  +	   Note that chunking will continue to work - using the normal read.
  +	*/
  +
  +if (ae-left_bytes_to_send  0) {
   int len = ae-left_bytes_to_send;
   if (len  AJP13_MAX_SEND_BODY_SZ) 
   len = AJP13_MAX_SEND_BODY_SZ;

Costin was faster than me ;)




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




cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2002-11-21 Thread costin
costin  2002/11/21 09:53:48

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Do not send the initial chunk for chunked encoding ( only for
  regular POST ).
  Ajp13 servers ( tomcat x.y, etc ) expect this initial chunk
  only if a content-length is specified.
  
  ( this is just an initial fix - I still need to test various
  cases )
  
  Revision  ChangesPath
  1.33  +10 -3 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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- jk_ajp_common.c   30 Oct 2002 22:12:20 -  1.32
  +++ jk_ajp_common.c   21 Nov 2002 17:53:48 -  1.33
  @@ -808,7 +808,7 @@
   }
   
   if (!r-is_chunked) {
  -ae-left_bytes_to_send -= len;
  + ae-left_bytes_to_send -= len;
   }
   
   if (len  0) {
  @@ -905,7 +905,14 @@
* for resend if the remote Tomcat is down, a fact we will learn only
* doing a read (not yet) 
*/
  -if (s-is_chunked || ae-left_bytes_to_send  0) {
  + /* || s-is_chunked - this can't be done here. The original protocol sends the 
first
  +chunk of post data ( based on Content-Length ), and that's what the java 
side expects.
  +Sending this data for chunked would break other ajp13 serers.
  +
  +Note that chunking will continue to work - using the normal read.
  + */
  +
  +if (ae-left_bytes_to_send  0) {
   int len = ae-left_bytes_to_send;
   if (len  AJP13_MAX_SEND_BODY_SZ) 
   len = AJP13_MAX_SEND_BODY_SZ;
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_lb_worker.c

2002-10-30 Thread costin
costin  2002/10/30 13:17:34

  Modified:jk/native/common jk_ajp_common.c jk_lb_worker.c
  Log:
  Change some of the important messages to a more readable format.
  
  Revision  ChangesPath
  1.31  +17 -17jakarta-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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- jk_ajp_common.c   20 Sep 2002 11:28:16 -  1.30
  +++ jk_ajp_common.c   30 Oct 2002 21:17:34 -  1.31
   -623,7 +623,7 
   }
   }
   
  -jk_log(l, JK_LOG_ERROR, In jk_endpoint_t::ajp_connect_to_endpoint, failed 
errno = %d\n, errno);
  +jk_log(l, JK_LOG_ERROR, ERROR connecting to tomcat. Tomcat is probably not 
started. Failed errno = %d\n, errno);
   return JK_FALSE;
   }
   
   -676,7 +676,7 
   rc = jk_tcp_socket_recvfull(ae-sd, head, AJP_HEADER_LEN);
   
   if(rc  0) {
  -jk_log(l, JK_LOG_ERROR, ajp_connection_tcp_get_message: Error - 
jk_tcp_socket_recvfull failed\n);
  +jk_log(l, JK_LOG_ERROR, ERROR: can't receive the response message from 
tomcat, network problems or tomcat is down.\n);
   return JK_FALSE;
   }
   
   -719,7 +719,7 
   
   rc = jk_tcp_socket_recvfull(ae-sd, jk_b_get_buff(msg), msglen);
   if(rc  0) {
  -jk_log(l, JK_LOG_ERROR, ajp_connection_tcp_get_message: Error - 
jk_tcp_socket_recvfull failed\n);
  +jk_log(l, JK_LOG_ERROR, ERROR: can't receive the response message from 
tomcat, network problems or tomcat is down\n);
   return JK_FALSE;
   }
   
   -801,7 +801,7 
   }
   
   if ((len = ajp_read_fully_from_server(r, read_buf, len))  0) {
  -jk_log(l, JK_LOG_ERROR, ajp_read_into_msg_buff: Error - 
ajp_read_fully_from_server failed\n);
  +jk_log(l, JK_LOG_ERROR, ERROR: receiving data from server failed, the 
client aborted the connection or network errors.\n);
   return -1;
   }
   
   -849,7 +849,7 
* First try to reuse open connections...
   */
   while ((ae-sd  0)  ! ajp_connection_tcp_send_message(ae, op-request, l)) {
  -jk_log(l, JK_LOG_ERROR, Error sending request try another pooled 
connection\n);
  +jk_log(l, JK_LOG_INFO, Error sending request try another pooled 
connection\n);
   jk_close_socket(ae-sd);
   ae-sd = -1;
   ajp_reuse_connection(ae, l);
   -865,7 +865,7 
* have is probably unrecoverable
*/
   if (!ajp_connection_tcp_send_message(ae, op-request, l)) {
  -jk_log(l, JK_LOG_ERROR, Error sending request on a fresh 
connection\n);
  +jk_log(l, JK_LOG_INFO, Error sending request on a fresh connection\n);
   return JK_FALSE;
   }
   } else {
   -958,7 +958,7 
   {
   unsigned len = (unsigned)jk_b_get_int(msg);
   if(!r-write(r, jk_b_get_buff(msg) + jk_b_get_pos(msg), len)) {
  -jk_log(l, JK_LOG_ERROR, Error ajp_process_callback - write 
failed\n);
  +jk_log(l, JK_LOG_ERROR, ERROR sending data to client. 
Connection aborted or network problems\n);
   return JK_CLIENT_ERROR;
   }
   }
   -984,7 +984,7 
   return JK_AJP13_HAS_RESPONSE;
   }  
   
  -jk_log(l, JK_LOG_ERROR, Error ajp_process_callback - 
ajp_read_into_msg_buff failed\n);
  +jk_log(l, JK_LOG_ERROR, ERROR reading POST data from client. Connection 
aborted or network problems\n);
   return JK_INTERNAL_ERROR;   
   }
   break;
   -1038,7 +1038,7 
   int rc = 0;
   
   if(!ajp_connection_tcp_get_message(p, op-reply, l)) {
  -jk_log(l, JK_LOG_ERROR, Error reading reply\n);
  +jk_log(l, JK_LOG_ERROR, Error reading reply from tomcat. Tomcat is 
down or network problems.\n);
   /* we just can't recover, unset recover flag */
   return JK_FALSE;
   }
   -1061,7 +1061,7 
   op-recoverable = JK_FALSE; 
   rc = ajp_connection_tcp_send_message(p, op-post, l);
   if (rc  0) {
  -jk_log(l, JK_LOG_ERROR, Error sending request data %d\n, rc);
  +jk_log(l, JK_LOG_ERROR, Error sending request data %d. Tomcat is 
down or network problems.\n, rc);
   return JK_FALSE;
   }
   } else if(JK_FATAL_ERROR == rc) {
   -1154,7 +1154,7 
*/
   if (! op-recoverable) {
   *is_recoverable_error = JK_FALSE;
  -jk_log(l, JK_LOG_ERROR, In jk_endpoint_t::service, 
ajp_send_request failed without recovery in send loop %d\n, i);
  +

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_connect.c

2002-10-30 Thread costin
costin  2002/10/30 14:12:20

  Modified:jk/native/common jk_ajp_common.c jk_connect.c
  Log:
  More trimming for error messages.
  
  Now only one line ( and hopefully more informative ) is displayed if
  we can't send the request to tomcat.
  
  Revision  ChangesPath
  1.32  +11 -5 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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- jk_ajp_common.c   30 Oct 2002 21:17:34 -  1.31
  +++ jk_ajp_common.c   30 Oct 2002 22:12:20 -  1.32
   -623,7 +623,9 
   }
   }
   
  -jk_log(l, JK_LOG_ERROR, ERROR connecting to tomcat. Tomcat is probably not 
started. Failed errno = %d\n, errno);
  +jk_log(l, JK_LOG_INFO,
  +   Error connecting to tomcat. Tomcat is probably not started or is 
listenning on the wrong port. Failed errno = %d\n,
  +   errno);
   return JK_FALSE;
   }
   
   -869,7 +871,7 
   return JK_FALSE;
   }
   } else {
  -jk_log(l, JK_LOG_ERROR, Error connecting to the Tomcat process.\n);
  +jk_log(l, JK_LOG_INFO, Error connecting to the Tomcat process.\n);
   return JK_FALSE;
   }
   }
   -1175,15 +1177,19 
   return JK_FALSE;
   }
   
  -jk_log(l, JK_LOG_ERROR, ERRORO: Receiving from tomcat failed, 
recoverable operation. err=%d\n, i);
  +jk_log(l, JK_LOG_ERROR, ERROR: Receiving from tomcat failed, 
recoverable operation. err=%d\n, i);
   }
   else
  -jk_log(l, JK_LOG_ERROR, ERROR: sending request to tomcat failed in 
send loop. err=%d\n, i);
  +jk_log(l, JK_LOG_INFO, sending request to tomcat failed in send 
loop. err=%d\n, i);
   
   jk_close_socket(p-sd);
   p-sd = -1;
   ajp_reuse_connection(p, l);
   }
  +
  +/* Log the error only once per failed request. */
  +jk_log(l, JK_LOG_ERROR, Error connecting to tomcat. Tomcat is probably not 
started or is listenning on the wrong port. Failed errno = %d\n, errno);
  +
   } else {
   jk_log(l, JK_LOG_ERROR, In jk_endpoint_t::service, NULL parameters\n);
   }
  
  
  
  1.6   +2 -2  jakarta-tomcat-connectors/jk/native/common/jk_connect.c
  
  Index: jk_connect.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jk_connect.c  4 Sep 2002 11:31:33 -   1.5
  +++ jk_connect.c  30 Oct 2002 22:12:20 -  1.6
   -174,7 +174,7 
   jk_log(l, JK_LOG_DEBUG, jk_open_socket, return, sd = %d\n, sock);
   return sock;
   }   
  -jk_log(l, JK_LOG_ERROR, jk_open_socket, connect() failed errno = %d\n, 
errno);
  +jk_log(l, JK_LOG_INFO, jk_open_socket, connect() failed errno = %d\n, 
errno);
   jk_close_socket(sock);
   } else {
   #ifdef WIN32
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2002-07-02 Thread costin

costin  2002/07/02 09:51:08

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add more info to the message.
  
  Revision  ChangesPath
  1.27  +3 -2  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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- jk_ajp_common.c   25 Jun 2002 07:08:03 -  1.26
  +++ jk_ajp_common.c   2 Jul 2002 16:51:08 -   1.27
  @@ -684,7 +684,8 @@
   msglen += (head[3]  0xFF);
   
   if(msglen  jk_b_get_size(msg)) {
  -jk_log(l, JK_LOG_ERROR, ajp_connection_tcp_get_message: Error - Wrong 
message size\n);
  +jk_log(l, JK_LOG_ERROR, ajp_connection_tcp_get_message: Error - Wrong 
message size %d %d\n,
  +   msglen, jk_b_get_size(msg));
   return JK_FALSE;
   }
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2002-06-25 Thread mturk

mturk   2002/06/25 00:08:03

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Introduced socket and cache timeout.
  By Jan Singer, Henri Gomez and Mladen Turk.
  
  Revision  ChangesPath
  1.26  +376 -334  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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- jk_ajp_common.c   10 May 2002 23:58:40 -  1.25
  +++ jk_ajp_common.c   25 Jun 2002 07:08:03 -  1.26
  @@ -115,23 +115,23 @@
   } else if(0 == strcmp(method, TRACE)) {
   *sc = SC_M_TRACE;
   } else if(0 == strcmp(method, PROPFIND)) {
  - *sc = SC_M_PROPFIND;
  +*sc = SC_M_PROPFIND;
   } else if(0 == strcmp(method, PROPPATCH)) {
  - *sc = SC_M_PROPPATCH;
  +*sc = SC_M_PROPPATCH;
   } else if(0 == strcmp(method, MKCOL)) {
  - *sc = SC_M_MKCOL;
  +*sc = SC_M_MKCOL;
   } else if(0 == strcmp(method, COPY)) {
  - *sc = SC_M_COPY;
  +*sc = SC_M_COPY;
   } else if(0 == strcmp(method, MOVE)) {
  - *sc = SC_M_MOVE;
  +*sc = SC_M_MOVE;
   } else if(0 == strcmp(method, LOCK)) {
  - *sc = SC_M_LOCK;
  +*sc = SC_M_LOCK;
   } else if(0 == strcmp(method, UNLOCK)) {
  - *sc = SC_M_UNLOCK;
  +*sc = SC_M_UNLOCK;
   } else if(0 == strcmp(method, ACL)) {
  - *sc = SC_M_ACL;
  +*sc = SC_M_ACL;
   } else if(0 == strcmp(method, REPORT)) {
  - *sc = SC_M_REPORT;
  +*sc = SC_M_REPORT;
   } else if(0 == strcmp(method, VERSION-CONTROL)) {
   *sc = SC_M_VERSION_CONTROL;
   } else if(0 == strcmp(method, CHECKIN)) {
  @@ -263,7 +263,7 @@
   ?ssl_cert  (byte)(string)
   ?ssl_cipher(byte)(string)
   ?ssl_session   (byte)(string)
  -?ssl_key_size  (byte)(int)   via JkOptions +ForwardKeySize
  +?ssl_key_size  (byte)(int)  via JkOptions +ForwardKeySize
   request_terminator (byte)
   ?body  content_length*(var binary)
   
  @@ -442,10 +442,10 @@
   
   static int ajp_unmarshal_response(jk_msg_buf_t   *msg,
 jk_res_data_t  *d,
  -   ajp_endpoint_t *ae,
  +  ajp_endpoint_t *ae,
 jk_logger_t*l)
   {
  - jk_pool_t * p = ae-pool;
  +jk_pool_t * p = ae-pool;
   
   d-status = jk_b_get_int(msg);
   
  @@ -533,16 +533,16 @@
   void ajp_close_endpoint(ajp_endpoint_t *ae,
   jk_logger_t*l)
   {
  - jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_close_endpoint\n);
  +jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_close_endpoint\n);
   
   ajp_reset_endpoint(ae);
   jk_close_pool((ae-pool));
   
   if (ae-sd  0) { 
   jk_close_socket(ae-sd);
  - jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_close_endpoint, closed 
sd = %d\n, ae-sd);
  - ae-sd = -1; /* just to avoid twice close */
  - }
  +jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_close_endpoint, closed sd = 
%d\n, ae-sd);
  +ae-sd = -1; /* just to avoid twice close */
  +}
   
   free(ae);
   }
  @@ -584,20 +584,22 @@
   unsigned attempt;
   
   for(attempt = 0 ; attempt  ae-worker-connect_retry_attempts ; attempt++) {
  -ae-sd = jk_open_socket(ae-worker-worker_inet_addr, JK_TRUE, l);
  +ae-sd = jk_open_socket(ae-worker-worker_inet_addr, JK_TRUE, 
ae-worker-keepalive, l);
   if(ae-sd = 0) {
   jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_connect_to_endpoint, 
connected sd = %d\n, ae-sd);
   
  - /* Check if we must execute a logon after the physical connect 
*/
  - if (ae-worker-logon != NULL)
  - return (ae-worker-logon(ae, l));
  + /* set last_access */
  + ae-last_access = time(NULL);
  +/* Check if we must execute a logon after the physical connect */
  +if (ae-worker-logon != NULL)
  +return (ae-worker-logon(ae, l));
   
  - return JK_TRUE;
  +return JK_TRUE;
   }
   }
   
   jk_log(l, JK_LOG_ERROR, In jk_endpoint_t::ajp_connect_to_endpoint, failed 
errno = %d\n, errno);
  - return JK_FALSE;
  +return JK_FALSE;
   }
   
   /*
  @@ -608,18 +610,18 @@
   jk_msg_buf_t   *msg,
   jk_logger_t*l)
   {
  - if (ae-proto == AJP13_PROTO) {
  - jk_b_end(msg, AJP13_WS_HEADER);
  - jk_dump_buff(l, JK_LOG_DEBUG, sending to ajp13, msg);
  - }
  - else if (ae-proto == AJP14_PROTO) {
  - jk_b_end(msg, AJP14_WS_HEADER);
  - 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2002-05-10 Thread costin

costin  02/05/10 16:58:40

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Add a debug message if the connection is not reused.
  
  Revision  ChangesPath
  1.25  +14 -11jakarta-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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- jk_ajp_common.c   13 Feb 2002 01:07:18 -  1.24
  +++ jk_ajp_common.c   10 May 2002 23:58:40 -  1.25
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.24 $   *
  + * Version: $Revision: 1.25 $   *
***/
   
   
  @@ -455,8 +455,9 @@
   }
   
   d-msg = (char *)jk_b_get_string(msg);
  -if (d-msg)
  +if (d-msg) {
   jk_xlate_from_ascii(d-msg, strlen(d-msg));
  +}
   
   jk_log(l, JK_LOG_DEBUG, ajp_unmarshal_response: status = %d\n, d-status);
   
  @@ -756,7 +757,7 @@
   static int ajp_read_into_msg_buff(ajp_endpoint_t  *ae,
 jk_ws_service_t *r,
 jk_msg_buf_t*msg,
  -  unsigned len,
  +  int len,
 jk_logger_t *l)
   {
   unsigned char *read_buf = jk_b_get_buff(msg);
  @@ -875,7 +876,7 @@
 * doing a read (not yet) 
 */
if (s-is_chunked || ae-left_bytes_to_send  0) {
  - unsigned len = ae-left_bytes_to_send;
  + int len = ae-left_bytes_to_send;
if (len  AJP13_MAX_SEND_BODY_SZ) 
len = AJP13_MAX_SEND_BODY_SZ;
if ((len = ajp_read_into_msg_buff(ae, s, op-post, len, l))  
0) {
  @@ -937,7 +938,7 @@
   
   case JK_AJP13_GET_BODY_CHUNK:
   {
  - unsigned len = (unsigned)jk_b_get_int(msg);
  + int len = (int)jk_b_get_int(msg);
   
   if(len  AJP13_MAX_SEND_BODY_SZ) {
   len = AJP13_MAX_SEND_BODY_SZ;
  @@ -963,13 +964,16 @@
   case JK_AJP13_END_RESPONSE:
   {
   ae-reuse = (int)jk_b_get_byte(msg);
  -
  -if((ae-reuse  0X01) != ae-reuse) {
  +
  +if( ! ae-reuse ) {
   /*
* Strange protocol error.
*/
  +jk_log(l, JK_LOG_DEBUG, Reuse: %d\n, ae-reuse );
   ae-reuse = JK_FALSE;
   }
  +/* Reuse in all cases */
  +ae-reuse = JK_TRUE;
   }
   return JK_AJP13_END_RESPONSE;
break;
  @@ -1304,8 +1308,6 @@
   int JK_METHOD ajp_done(jk_endpoint_t **e,
  jk_logger_t*l)
   {
  -jk_log(l, JK_LOG_DEBUG, Into jk_endpoint_t::done\n);
  -
   if (e  *e  (*e)-endpoint_private) {
   ajp_endpoint_t *p = (*e)-endpoint_private;
   int reuse_ep = p-reuse;
  @@ -1328,12 +1330,13 @@
   }
   JK_LEAVE_CS(w-cs, rc);
   if(i  w-ep_cache_sz) {
  -return JK_TRUE;
  +jk_log(l, JK_LOG_DEBUG, Into jk_endpoint_t::done, 
recycling connection\n);
  +return JK_TRUE;
   }
   }
   }
   }
  -
  +jk_log(l, JK_LOG_DEBUG, Into jk_endpoint_t::done, closing connection 
%d\n, reuse_ep);
   ajp_close_endpoint(p, l);
   *e = NULL;
   
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2002-02-12 Thread mmanders

mmanders02/02/12 17:07:18

  Modified:jk/native/common jk_ajp_common.c
  Log:
  Initialize secret before checking cache since we might return from inside of the 
cache checking loop.
  
  Revision  ChangesPath
  1.24  +9 -2  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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- jk_ajp_common.c   6 Feb 2002 19:11:23 -   1.23
  +++ jk_ajp_common.c   13 Feb 2002 01:07:18 -  1.24
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.23 $   *
  + * Version: $Revision: 1.24 $   *
***/
   
   
  @@ -1235,6 +1235,14 @@
   if (pThis  pThis-worker_private) {
   ajp_worker_t *p = pThis-worker_private;
   int cache_sz = jk_get_worker_cache_size(props, p-name, cache);
  +
  +/* 
  + *  Need to initialize secret here since we could return from inside
  + *  of the following loop
  + */
  +   
  +p-secret = jk_get_worker_secret(props, p-name );
  +
   if (cache_sz  0) {
   p-ep_cache = (ajp_endpoint_t **)malloc(sizeof(ajp_endpoint_t *) * 
cache_sz);
   if(p-ep_cache) {
  @@ -1249,7 +1257,6 @@
   }
   }
   }
  -p-secret = jk_get_worker_secret(props, p-name );
   } else {
   jk_log(l, JK_LOG_ERROR, In jk_worker_t::init, NULL parameters\n);
   }
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_ajp_common.h jk_service.h jk_util.c jk_util.h

2002-02-06 Thread costin

costin  02/02/06 11:11:23

  Modified:jk/native/common jk_ajp_common.c jk_ajp_common.h
jk_service.h jk_util.c jk_util.h
  Log:
  Implementation of the 'secret' attribute in the request, used to
  pass a key used to authenticate the sender.
  
  This shouldn't affect in any way the current code - as long as the
  secret attribute is not set on the worker, the code will behave
  exactly as before and work with any tomcat from 3.2 to 4.1.
  
  If the attribute is set, the attribute will be sent - the
  receiving side should know how to deal with it, that means
  it should use a recent version of jk.
  
  On the java side, the new versions of jk will allow setting the
  key - that will require any web server to send the password
  in order to allow forwarding the request. The check will happen
  once per tcp connection.
  
  Revision  ChangesPath
  1.23  +13 -3 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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- jk_ajp_common.c   17 Dec 2001 15:29:38 -  1.22
  +++ jk_ajp_common.c   6 Feb 2002 19:11:23 -   1.23
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.22 $   *
  + * Version: $Revision: 1.23 $   *
***/
   
   
  @@ -272,7 +272,7 @@
   static int ajp_marshal_into_msgb(jk_msg_buf_t*msg,
jk_ws_service_t *s,
jk_logger_t *l,
  -  ajp_endpoint_t  *ae)
  + ajp_endpoint_t  *ae)
   {
   unsigned char method;
   unsigned i;
  @@ -320,6 +320,15 @@
   }
   }
   
  +if (s-secret) {
  +if (jk_b_append_byte(msg, SC_A_SECRET) ||
  +jk_b_append_string(msg, s-secret)) {
  +jk_log(l, JK_LOG_ERROR,
  +   Error ajp_marshal_into_msgb - Error appending secret\n);
  +return JK_FALSE;
  +}
  +}
  +
   if (s-remote_user) {
   if (jk_b_append_byte(msg, SC_A_REMOTE_USER) ||
   jk_b_append_string(msg, s-remote_user)) {
  @@ -384,7 +393,6 @@
   }
   }
   
  -
   if (s-num_attributes  0) {
   for (i = 0 ; i  s-num_attributes ; i++) {
   if (jk_b_append_byte(msg, SC_A_REQ_ATTRIBUTE)   ||
  @@ -1087,6 +1095,7 @@
p-reuse = JK_FALSE;
*is_recoverable_error = JK_TRUE;
   
  +s-secret = p-worker-secret;
/* 
 * We get here initial request (in reqmsg)
 */
  @@ -1240,6 +1249,7 @@
   }
   }
   }
  +p-secret = jk_get_worker_secret(props, p-name );
   } else {
   jk_log(l, JK_LOG_ERROR, In jk_worker_t::init, NULL parameters\n);
   }
  
  
  
  1.14  +8 -4  jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h
  
  Index: jk_ajp_common.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- jk_ajp_common.h   4 Dec 2001 19:44:23 -   1.13
  +++ jk_ajp_common.h   6 Feb 2002 19:11:23 -   1.14
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocol ajp13/ajp14.  *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.13 $   *
  + * Version: $Revision: 1.14 $   *
***/
   
   #ifndef JK_AJP_COMMON_H
  @@ -88,6 +88,7 @@
   #define SC_A_SSL_SESSION(unsigned char)9
   #define SC_A_REQ_ATTRIBUTE  (unsigned char)10
   #define SC_A_SSL_KEY_SIZE   (unsigned char)11/* only in if 
JkOptions +ForwardKeySize */
  +#define SC_A_SECRET (unsigned char)12
   #define SC_A_ARE_DONE   (unsigned char)0xFF
   
   /*
  @@ -253,9 +254,12 @@
   unsigned ep_cache_sz;
   ajp_endpoint_t **ep_cache;
   
  - int proto; /* PROTOCOL USED AJP13/AJP14 */
  -
  - jk_login_service_t *login;
  +int 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2001-12-17 Thread seguin

seguin  01/12/17 07:29:38

  Modified:jk/native/common jk_ajp_common.c
  Log:
  actually send post data beyond the first ~8K to the servlet container.
  
  if a client request contains post data, the first chunk of it is sent to the
  container directly after the forward request is sent.  if not all of the data
  fits in the first chunk, the container will get subsequent chunks by
  sending the connector a GET_BODY_CHUNK message.  this checkin fixes the
  reponse to the GET_BODY_CHUNK message so that the connector will sent the
  container more post data.
  
  i believe this also fixes bug 4223.
  PR: 4223
  
  Revision  ChangesPath
  1.22  +2 -2  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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- jk_ajp_common.c   2001/12/04 19:44:23 1.21
  +++ jk_ajp_common.c   2001/12/17 15:29:38 1.22
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.21 $   *
  + * Version: $Revision: 1.22 $   *
***/
   
   
  @@ -942,7 +942,7 @@
}
   
/* the right place to add file storage for upload */
  - if ((len = ajp_read_into_msg_buff(ae, r, msg, len, l)) = 0) {
  + if ((len = ajp_read_into_msg_buff(ae, r, pmsg, len, l)) = 0) {
r-content_read += len;
return JK_AJP13_HAS_RESPONSE;
}  
  
  
  

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




cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2001-11-16 Thread costin

costin  01/11/16 22:08:20

  Modified:jk/native/common jk_ajp_common.c
  Log:
  The big commit - plugin in the new socket code.
  
  All is #ifdef-ed by now - the old code is compiled by default, unmodified
  ( except some ifs that I reversed to be able to read and minor indentations).
  
  Probably this will remain this way until we are comfortable with the new
  abstraction - then we can remove the old code and the ifdefs. So far I can run it 
without
  problems.
  
  One big issue is the code that recycles the connection - I'm very comfused, it
  seems that besides recycling the endpoint we have some code that is doing
  some tricks with the sockets. From the comments it seems to be dealing with
  lb - but the lb worker has it's own mechanism to get another endpoint
  if one fails.
  
  I've also got a core on high load ( but very hard to reproduce ) and it happens
  in the reuse_connection - I added a check, but not sure why the worker would be null
  in the endpoint. What's more important is finding if we need this extra attempt to 
reuse
  ( or recover from endpoint errors ), closing the socket and reopening again could
  be a better solution ( if tomcat was restarted, all sockets will be invalid, so
  reuse_connection couldn't help in any way ).
  
  Revision  ChangesPath
  1.19  +328 -210  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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- jk_ajp_common.c   2001/11/06 00:15:07 1.18
  +++ jk_ajp_common.c   2001/11/17 06:08:20 1.19
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.18 $   *
  + * Version: $Revision: 1.19 $   *
***/
   
   
  @@ -69,6 +69,8 @@
   #include jk_ajp14.h
   #include jk_ajp_common.h
   #include jk_connect.h
  +#include jk_channel.h
  +#include jk_env.h
   
   
   const char *response_trans_headers[] = {
  @@ -524,30 +526,38 @@
   void ajp_close_endpoint(ajp_endpoint_t *ae,
   jk_logger_t*l)
   {
  - jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_close_endpoint\n);
  +jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_close_endpoint\n);
   
   ajp_reset_endpoint(ae);
   jk_close_pool((ae-pool));
   
  +#ifdef CHANNEL
  +{
  + jk_channel_t *channel=ae-worker-worker.channel;
  + int err=channel-close( channel, ae-endpoint );
  +}
  +#else
   if (ae-sd  0) { 
  -jk_close_socket(ae-sd);
  - jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_close_endpoint, closed 
sd = %d\n, ae-sd);
  - ae-sd = -1; /* just to avoid twice close */
  - }
  + jk_close_socket(ae-sd);
  + jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_close_endpoint, closed sd = 
%d\n, ae-sd);
  + ae-sd = -1; /* just to avoid twice close */
  +}
  +#endif
   
   free(ae);
   }
  -
   
  +#ifndef CHANNEL
   /*
* Try to reuse a previous connection
*/
  -
   static void ajp_reuse_connection(ajp_endpoint_t *ae,
jk_logger_t*l)
   {
   ajp_worker_t *aw = ae-worker;
  -
  +
  +if (aw==NULL ) 
  +return;
   if (aw-ep_cache_sz) {
   int rc;
   JK_ENTER_CS(aw-cs, rc);
  @@ -567,6 +577,7 @@
   }
   }
   }
  +#endif
   
   
   int ajp_connect_to_endpoint(ajp_endpoint_t *ae,
  @@ -575,20 +586,26 @@
   unsigned attempt;
   
   for(attempt = 0 ; attempt  ae-worker-connect_retry_attempts ; attempt++) {
  +#ifdef CHANNEL
  + jk_channel_t *channel=ae-worker-worker.channel;
  +int err=channel-open( channel, ae-endpoint );
  + jk_log(l, JK_LOG_DEBUG, ajp_connect_to_endpoint: connected %lx\n, 
ae-endpoint );
  + if( err == JK_TRUE ) {
  +#else
   ae-sd = jk_open_socket(ae-worker-worker_inet_addr, JK_TRUE, l);
   if(ae-sd = 0) {
   jk_log(l, JK_LOG_DEBUG, In jk_endpoint_t::ajp_connect_to_endpoint, 
connected sd = %d\n, ae-sd);
  -
  - /* Check if we must execute a logon after the physical connect 
*/
  - if (ae-worker-logon != NULL)
  - return (ae-worker-logon(ae, l));
  -
  - return JK_TRUE;
  +#endif
  + /* Check if we must execute a logon after the physical connect */
  + if (ae-worker-logon != NULL)
  + return (ae-worker-logon(ae, l));
  + 
  + return JK_TRUE;
  

RE: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_global.h jk_md5.c

2001-11-02 Thread GOMEZ Henri

Excellent works !

Now AS/400 users will be able to play with the jakarta-tomcat-connectors
mod_jk :)

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



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 31, 2001 3:03 PM
To: [EMAIL PROTECTED]
Subject: cvs commit: jakarta-tomcat-connectors/jk/native/common
jk_ajp_common.c jk_global.h jk_md5.c


jfclere 01/10/31 06:03:23

  Modified:jk/native/apache-1.3 mod_jk.c
   jk/native/common jk_ajp_common.c jk_global.h jk_md5.c
  Log:
  Add support for BS2000 and finish EBCDIC support.
  
  Revision  ChangesPath
  1.20  +3 -3  
jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c
  
  Index: mod_jk.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_jk.c 2001/10/05 21:52:08 1.19
  +++ mod_jk.c 2001/10/31 14:03:22 1.20
  @@ -61,14 +61,14 @@
* Author:  Gal Shachor [EMAIL PROTECTED]
   *
*  Dan Milstein [EMAIL PROTECTED] 
   *
*  Henri Gomez [EMAIL PROTECTED]
   *
  - * Version: $Revision: 1.19 $   
*
  + * Version: $Revision: 1.20 $   
*

***
/
   
   /*
* mod_jk: keeps all servlet/jakarta related ramblings together.
*/
   
  -#include ap_config.h
  +/* #include ap_config.h */
   #include httpd.h
   #include http_config.h
   #include http_request.h
  @@ -79,7 +79,7 @@
   #include util_script.h
   #include util_date.h
   #include http_conf_globals.h
  - 
  +
   /*
* Jakarta (jk_) include files
*/
  
  
  
  1.17  +9 -1  
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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- jk_ajp_common.c  2001/10/13 17:36:36 1.16
  +++ jk_ajp_common.c  2001/10/31 14:03:22 1.17
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols 
ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]
   *
* Author:  Henri Gomez [EMAIL PROTECTED]
   *
  - * Version: $Revision: 1.16 $   
*
  + * Version: $Revision: 1.17 $   
*

***
/
   
   
  @@ -447,6 +447,8 @@
   }
   
   d-msg = (char *)jk_b_get_string(msg);
  +if (d-msg)
  +jk_xlate_from_ascii(d-msg, strlen(d-msg));
   
   jk_log(l, JK_LOG_DEBUG, ajp_unmarshal_response: status 
= %d\n, d-status);
   
  @@ -479,6 +481,9 @@
   jk_log(l, JK_LOG_ERROR, Error 
ajp_unmarshal_response - Null header name\n);
   return JK_FALSE;
   }
  +jk_xlate_from_ascii(d-header_names[i],
  + strlen(d-header_names[i]));
  +
   }
   
   d-header_values[i] = (char *)jk_b_get_string(msg);
  @@ -486,6 +491,9 @@
   jk_log(l, JK_LOG_ERROR, Error 
ajp_unmarshal_response - Null header value\n);
   return JK_FALSE;
   }
  +
  +jk_xlate_from_ascii(d-header_values[i],
  + strlen(d-header_values[i]));
   
   jk_log(l, JK_LOG_DEBUG, 
ajp_unmarshal_response: Header[%d] [%s] = [%s]\n, 
  i,
  
  
  
  1.12  +4 -2  
jakarta-tomcat-connectors/jk/native/common/jk_global.h
  
  Index: jk_global.h
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_global.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_global.h  2001/10/26 14:02:18 1.11
  +++ jk_global.h  2001/10/31 14:03:22 1.12
  @@ -59,7 +59,7 @@
* Description: Global definitions and include files that 
should exist *
*  anywhere
   *
* Author:  Gal Shachor [EMAIL PROTECTED]
   *
  - * Version: $Revision: 1.11 $   
*
  + * Version: $Revision: 1.12

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_global.h jk_md5.c

2001-10-31 Thread jfclere

jfclere 01/10/31 06:03:23

  Modified:jk/native/apache-1.3 mod_jk.c
   jk/native/common jk_ajp_common.c jk_global.h jk_md5.c
  Log:
  Add support for BS2000 and finish EBCDIC support.
  
  Revision  ChangesPath
  1.20  +3 -3  jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c
  
  Index: mod_jk.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_jk.c  2001/10/05 21:52:08 1.19
  +++ mod_jk.c  2001/10/31 14:03:22 1.20
  @@ -61,14 +61,14 @@
* Author:  Gal Shachor [EMAIL PROTECTED]   *
*  Dan Milstein [EMAIL PROTECTED]*
*  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.19 $   *
  + * Version: $Revision: 1.20 $   *
***/
   
   /*
* mod_jk: keeps all servlet/jakarta related ramblings together.
*/
   
  -#include ap_config.h
  +/* #include ap_config.h */
   #include httpd.h
   #include http_config.h
   #include http_request.h
  @@ -79,7 +79,7 @@
   #include util_script.h
   #include util_date.h
   #include http_conf_globals.h
  - 
  +
   /*
* Jakarta (jk_) include files
*/
  
  
  
  1.17  +9 -1  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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- jk_ajp_common.c   2001/10/13 17:36:36 1.16
  +++ jk_ajp_common.c   2001/10/31 14:03:22 1.17
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.16 $   *
  + * Version: $Revision: 1.17 $   *
***/
   
   
  @@ -447,6 +447,8 @@
   }
   
   d-msg = (char *)jk_b_get_string(msg);
  +if (d-msg)
  +jk_xlate_from_ascii(d-msg, strlen(d-msg));
   
   jk_log(l, JK_LOG_DEBUG, ajp_unmarshal_response: status = %d\n, d-status);
   
  @@ -479,6 +481,9 @@
   jk_log(l, JK_LOG_ERROR, Error ajp_unmarshal_response - 
Null header name\n);
   return JK_FALSE;
   }
  +jk_xlate_from_ascii(d-header_names[i],
  + strlen(d-header_names[i]));
  +
   }
   
   d-header_values[i] = (char *)jk_b_get_string(msg);
  @@ -486,6 +491,9 @@
   jk_log(l, JK_LOG_ERROR, Error ajp_unmarshal_response - Null 
header value\n);
   return JK_FALSE;
   }
  +
  +jk_xlate_from_ascii(d-header_values[i],
  + strlen(d-header_values[i]));
   
   jk_log(l, JK_LOG_DEBUG, ajp_unmarshal_response: Header[%d] [%s] = 
[%s]\n, 
  i,
  
  
  
  1.12  +4 -2  jakarta-tomcat-connectors/jk/native/common/jk_global.h
  
  Index: jk_global.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_global.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_global.h   2001/10/26 14:02:18 1.11
  +++ jk_global.h   2001/10/31 14:03:22 1.12
  @@ -59,7 +59,7 @@
* Description: Global definitions and include files that should exist *
*  anywhere   *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.11 $   *
  + * Version: $Revision: 1.12 $   *
***/
   
   #ifndef JK_GLOBAL_H
  @@ -91,7 +91,9 @@
   #include netinet/tcp.h
   #include arpa/inet.h
   #include sys/un.h
  -#include sys/socketvar.h
  +#ifndef _OSD_POSIX
  +#include sys/socketvar.h
  +#endif
   #ifndef HPUX11
   #include sys/select.h
   #endif
  
  
  
  1.6   +2 -2  jakarta-tomcat-connectors/jk/native/common/jk_md5.c
  
  Index: jk_md5.c
  

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_ajp_common.h

2001-10-01 Thread keith

keith   01/10/01 13:50:39

  Modified:jk/doc   AJPv13.html
   jk/java/org/apache/ajp Ajp13.java RequestHandler.java
   jk/native/common jk_ajp_common.c jk_ajp_common.h
  Log:
  DeltaV is now an IESG Proposed Standard.
  Add the four new versioning methods.
  
  Revision  ChangesPath
  1.4   +5 -1  jakarta-tomcat-connectors/jk/doc/AJPv13.html
  
  Index: AJPv13.html
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/doc/AJPv13.html,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AJPv13.html   2001/08/27 15:33:04 1.3
  +++ AJPv13.html   2001/10/01 20:50:39 1.4
  @@ -357,8 +357,12 @@
   MOVE12
   LOCK13
   UNLOCK  14
  -ACL 15
  +ACL 15
   REPORT  16
  +VERSION-CONTROL 17
  +CHECKIN 18
  +CHECKOUT19
  +UNCHECKOUT  20
 /PRE
 P
 /DD
  
  
  
  1.16  +5 -1  jakarta-tomcat-connectors/jk/java/org/apache/ajp/Ajp13.java
  
  Index: Ajp13.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/ajp/Ajp13.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Ajp13.java2001/09/27 10:28:12 1.15
  +++ Ajp13.java2001/10/01 20:50:39 1.16
  @@ -168,7 +168,11 @@
   LOCK,
   UNLOCK,
   ACL,
  -REPORT
  +REPORT,
  +VERSION-CONTROL,
  +CHECKIN,
  +CHECKOUT,
  +UNCHECKOUT
   };
   
   // id's for common request headers
  
  
  
  1.3   +6 -2  
jakarta-tomcat-connectors/jk/java/org/apache/ajp/RequestHandler.java
  
  Index: RequestHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/ajp/RequestHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RequestHandler.java   2001/08/27 15:33:04 1.2
  +++ RequestHandler.java   2001/10/01 20:50:39 1.3
  @@ -148,8 +148,12 @@
   MOVE,
   LOCK,
   UNLOCK,
  -ACL,
  -REPORT
  +ACL,
  +REPORT,
  +VERSION-CONTROL,
  +CHECKIN,
  +CHECKOUT,
  +UNCHECKOUT
   };
   
   // id's for common request headers
  
  
  
  1.13  +11 -3 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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_ajp_common.c   2001/09/14 22:30:04 1.12
  +++ jk_ajp_common.c   2001/10/01 20:50:39 1.13
  @@ -130,8 +130,16 @@
*sc = SC_M_UNLOCK;
   } else if(0 == strcmp(method, ACL)) {
*sc = SC_M_ACL;
  -} else if(0 == strcmp(method, REPORT)) {
  - *sc = SC_M_REPORT;
  +} else if(0 == strcmp(method, REPORT)) {
  + *sc = SC_M_REPORT;
  +} else if(0 == strcmp(method, VERSION-CONTROL)) {
  +*sc = SC_M_VERSION_CONTROL;
  +} else if(0 == strcmp(method, CHECKIN)) {
  +*sc = SC_M_CHECKIN;
  +} else if(0 == strcmp(method, CHECKOUT)) {
  +*sc = SC_M_CHECKOUT;
  +} else if(0 == strcmp(method, UNCHECKOUT)) {
  +*sc = SC_M_UNCHECKOUT;
   } else {
   rc = JK_FALSE;
   }
  
  
  
  1.10  +12 -4 jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h
  
  Index: jk_ajp_common.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jk_ajp_common.h   2001/09/14 22:34:11 1.9
  +++ jk_ajp_common.h   2001/10/01 20:50:39 1.10
  @@ -93,7 +93,7 @@
   /*
* Request methods, coded as numbers instead of strings.
* The list of methods was taken from Section 5.1.1 of RFC 2616,
  - * RFC 2518, and the ACL IETF draft.
  + * RFC 2518, the ACL IETF draft, and the DeltaV IESG Proposed Standard.
*  Method= OPTIONS
*| GET
*| HEAD   
  @@ -108,8 +108,12 @@
*| MOVE
*| LOCK
*| UNLOCK
  - *| ACL
  + *| ACL
*| REPORT
  + *| VERSION-CONTROL
  + *| CHECKIN
  + *| CHECKOUT
  + *| UNCHECKOUT
* 
*/
   #define SC_M_OPTIONS(unsigned char)1
  @@ -126,8 +130,12 @@
   #define SC_M_MOVE   (unsigned char)12
   #define SC_M_LOCK 

cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2001-09-14 Thread jfclere

jfclere 01/09/14 04:15:00

  Modified:jk/java/org/apache/ajp Ajp13.java
   jk/native/common jk_ajp_common.c
  Log:
  Arrange the KEY_SIZE_ATTR. (Note it is for TC4.0).
  
  Revision  ChangesPath
  1.12  +5 -2  jakarta-tomcat-connectors/jk/java/org/apache/ajp/Ajp13.java
  
  Index: Ajp13.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/ajp/Ajp13.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Ajp13.java2001/09/13 14:29:51 1.11
  +++ Ajp13.java2001/09/14 11:15:00 1.12
  @@ -131,6 +131,7 @@
   public static final byte SC_A_SSL_CERT  = 7;
   public static final byte SC_A_SSL_CIPHER= 8;
   public static final byte SC_A_SSL_SESSION   = 9;
  +public static final byte SC_A_SSL_KEYSIZE   = 11;
   
   // Used for attributes which are not in the list above
   public static final byte SC_A_REQ_ATTRIBUTE = 10; 
  @@ -403,8 +404,6 @@
isSSL = true;
req.setAttribute(javax.servlet.request.X509Certificate,
 msg.getString());
  -req.setAttribute(javax.servlet.request.key_size,
  - new Integer (msg.getLen()));
   break;

case SC_A_SSL_CIPHER   :
  @@ -424,6 +423,10 @@
 msg.getString());
   break;
   
  + case SC_A_SSL_KEYSIZE :
  +req.setAttribute(javax.servlet.request.key_size,
  + new Integer (msg.getInt()));
  +break;
default:
if (decodeMoreHeaders(req, attributeCode, msg) != 500)
break;
  
  
  
  1.11  +3 -2  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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jk_ajp_common.c   2001/09/10 21:51:57 1.10
  +++ jk_ajp_common.c   2001/09/14 11:15:00 1.11
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.10 $   *
  + * Version: $Revision: 1.11 $   *
***/
   
   
  @@ -364,8 +364,9 @@
   /*
* ssl_key_size is required by Servlet 2.3 API
* added support only in ajp14 mode
  + * JFC removed: ae-proto == AJP14_PROTO
*/
  -if ((ae-proto == AJP14_PROTO)  (s-ssl_key_size != -1)) {
  +if (s-ssl_key_size != -1) {
   if (jk_b_append_byte(msg, SC_A_SSL_KEY_SIZE) ||
   jk_b_append_int(msg, (unsigned short) s-ssl_key_size)) {
   jk_log(l, JK_LOG_ERROR, Error ajp_marshal_into_msgb - Error appending 
the SSL key size\n);
  
  
  



RE: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c

2001-09-14 Thread GOMEZ Henri

Warning,

Read my previous mail about adding new features to AJP13 
which are unknown to current Tomcat 3.2/3.3 

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



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 14, 2001 1:15 PM
To: [EMAIL PROTECTED]
Subject: cvs commit: jakarta-tomcat-connectors/jk/native/common
jk_ajp_common.c


jfclere 01/09/14 04:15:00

  Modified:jk/java/org/apache/ajp Ajp13.java
   jk/native/common jk_ajp_common.c
  Log:
  Arrange the KEY_SIZE_ATTR. (Note it is for TC4.0).
  
  Revision  ChangesPath
  1.12  +5 -2  
jakarta-tomcat-connectors/jk/java/org/apache/ajp/Ajp13.java
  
  Index: Ajp13.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/ajp/Ajp13.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Ajp13.java   2001/09/13 14:29:51 1.11
  +++ Ajp13.java   2001/09/14 11:15:00 1.12
  @@ -131,6 +131,7 @@
   public static final byte SC_A_SSL_CERT  = 7;
   public static final byte SC_A_SSL_CIPHER= 8;
   public static final byte SC_A_SSL_SESSION   = 9;
  +public static final byte SC_A_SSL_KEYSIZE   = 11;
   
   // Used for attributes which are not in the list above
   public static final byte SC_A_REQ_ATTRIBUTE = 10; 
  @@ -403,8 +404,6 @@
   isSSL = true;
   
req.setAttribute(javax.servlet.request.X509Certificate,
msg.getString());
  -req.setAttribute(javax.servlet.request.key_size,
  - new Integer (msg.getLen()));
   break;
   
   case SC_A_SSL_CIPHER   :
  @@ -424,6 +423,10 @@
msg.getString());
   break;
   
  +case SC_A_SSL_KEYSIZE :
  +req.setAttribute(javax.servlet.request.key_size,
  + new Integer (msg.getInt()));
  +break;
   default:
   if (decodeMoreHeaders(req, attributeCode, msg) != 500)
   break;
  
  
  
  1.11  +3 -2  
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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jk_ajp_common.c  2001/09/10 21:51:57 1.10
  +++ jk_ajp_common.c  2001/09/14 11:15:00 1.11
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols 
ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]
   *
* Author:  Henri Gomez [EMAIL PROTECTED]
   *
  - * Version: $Revision: 1.10 $   
*
  + * Version: $Revision: 1.11 $   
*

***
/
   
   
  @@ -364,8 +364,9 @@
   /*
* ssl_key_size is required by Servlet 2.3 API
* added support only in ajp14 mode
  + * JFC removed: ae-proto == AJP14_PROTO
*/
  -if ((ae-proto == AJP14_PROTO)  (s-ssl_key_size != -1)) {
  +if (s-ssl_key_size != -1) {
   if (jk_b_append_byte(msg, SC_A_SSL_KEY_SIZE) ||
   jk_b_append_int(msg, (unsigned short) 
s-ssl_key_size)) {
   jk_log(l, JK_LOG_ERROR, Error 
ajp_marshal_into_msgb - Error appending the SSL key size\n);
  
  
  




cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c jk_ajp_common.h

2001-09-14 Thread hgomez

hgomez  01/09/14 15:30:05

  Modified:jk/native/common jk_ajp_common.c jk_ajp_common.h
  Log:
  Update information on when SSL_KEY_SIZE is
  sent to Tomcat Server via the use of
  JkOptions +ForwardKeySize
  
  Revision  ChangesPath
  1.12  +2 -2  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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_ajp_common.c   2001/09/14 11:15:00 1.11
  +++ jk_ajp_common.c   2001/09/14 22:30:04 1.12
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocols ajp13/ajp14. *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.11 $   *
  + * Version: $Revision: 1.12 $   *
***/
   
   
  @@ -253,7 +253,7 @@
   ?ssl_cert  (byte)(string)
   ?ssl_cipher(byte)(string)
   ?ssl_session   (byte)(string)
  -?ssl_key_size  (byte)(int)   only AJP14
  +?ssl_key_size  (byte)(int)   via JkOptions +ForwardKeySize
   request_terminator (byte)
   ?body  content_length*(var binary)
   
  
  
  
  1.8   +2 -2  jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h
  
  Index: jk_ajp_common.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_ajp_common.h   2001/09/10 21:51:57 1.7
  +++ jk_ajp_common.h   2001/09/14 22:30:04 1.8
  @@ -59,7 +59,7 @@
* Description: common stuff for bi-directional protocol ajp13/ajp14.  *
* Author:  Gal Shachor [EMAIL PROTECTED]   *
* Author:  Henri Gomez [EMAIL PROTECTED]   *
  - * Version: $Revision: 1.7 $   *
  + * Version: $Revision: 1.8 $   *
***/
   
   #ifndef JK_AJP_COMMON_H
  @@ -87,7 +87,7 @@
   #define SC_A_SSL_CIPHER (unsigned char)8
   #define SC_A_SSL_SESSION(unsigned char)9
   #define SC_A_REQ_ATTRIBUTE  (unsigned char)10
  -#define SC_A_SSL_KEY_SIZE   (unsigned char)11/* only in AJP14 
protocol */
  +#define SC_A_SSL_KEY_SIZE   (unsigned char)11/* /* only in if 
JkOptions +ForwardKeySize */
   #define SC_A_ARE_DONE   (unsigned char)0xFF
   
   /*
  
  
  



  1   2   >