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

2005-02-22 Thread Charlie Zhang

(B
(B 
(BCharlie Zhang 
(BProject Manager 
(BInfosys Technologies Shanghai Company Ltd.
(B[EMAIL PROTECTED]
(B50271588 * 3120 / 13601627903
(B
(B-Original Message-
(BFrom: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
(BSent: 2005$BG/(J2$B7n(J22$BF|(J 18:28
(BTo: [EMAIL PROTECTED]
(BSubject: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c
(B
(Bmturk   2005/02/22 02:27:38
(B
(B  Modified:jk/native/common jk_ajp_common.c
(B  Log:
(B  Revert the latest patch. No help on close_wait.
(B  
(B  Revision  ChangesPath
(B  1.93  +1 -4  
(Bjakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
(B  
(B  Index: jk_ajp_common.c
(B  ===
(B  RCS file: 
(B/home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
(B  retrieving revision 1.92
(B  retrieving revision 1.93
(B  diff -u -r1.92 -r1.93
(B  --- jk_ajp_common.c   22 Feb 2005 09:58:38 -  1.92
(B  +++ jk_ajp_common.c   22 Feb 2005 10:27:37 -  1.93
(B  @@ -1527,9 +1527,6 @@
(B   
(B   /* no more data to be sent, fine we have finish here */
(B   if (JK_AJP13_END_RESPONSE == rc) {
(B  -/* XXX: Set all readed */
(B  -s-content_read = s-content_length;
(B  -s-no_more_chunks = 1;
(B   JK_TRACE_EXIT(l);
(B   return JK_TRUE;
(B   }
(B  
(B  
(B  
(B
(B-
(BTo unsubscribe, e-mail: [EMAIL PROTECTED]
(BFor additional commands, e-mail: [EMAIL PROTECTED]
(B
(B
(B-
(BTo unsubscribe, e-mail: [EMAIL PROTECTED]
(BFor 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]


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]


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]


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]



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]


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]


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]


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]




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 $   

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);
  
  
  




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

2001-09-11 Thread GOMEZ Henri

Hi Keith,

Nice to see that works (you were the faster here :)

What about change in mod_jk.c for Apache 1.3 and 2.0 in J-T-C.

I've worked on that and could commit if necessary.
Just to avoid duplicate commit :)

-
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: Monday, September 10, 2001 8:33 PM
To: [EMAIL PROTECTED]
Subject: cvs commit: jakarta-tomcat-connectors/jk/native/common
jk_ajp_common.c jk_service.h jk_util.c


keith   01/09/10 11:32:36

  Modified:jk/java/org/apache/ajp Ajp13.java
   jk/native/apache-1.3 mod_jk.c
   jk/native/common jk_ajp_common.c jk_service.h jk_util.c
  Log:
  Port chunked encoding input support from jakarta-tomcat ajp13.
  
  Revision  ChangesPath
  1.10  +19 -5 
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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Ajp13.java   2001/08/27 15:33:04 1.9
  +++ Ajp13.java   2001/09/10 18:32:36 1.10
  @@ -209,7 +209,9 @@
   byte []bodyBuff = new byte[MAX_READ_SIZE];
   
   int blen;  // Length of current chunk of body data in buffer
  -int pos;   // Current read position within that buffer
  +int pos;   // Current read position within that buffer
  +
  +boolean end_of_stream;  // true if we've received an 
empty packet
   
   public Ajp13() {
   super();
  @@ -231,7 +233,8 @@
   
   // This is a touch cargo-cultish, but I think wise.
   blen = 0; 
  -pos = 0;
  +pos = 0;
  +end_of_stream = false;
   }
   
   /**
  @@ -437,7 +440,7 @@
   
   // Check to see if there should be a body packet coming along
   // immediately after
  -if(req.getContentLength()  0) {
  +if(req.getContentLength() != 0) {
   
   /* Read present data */
   int err = receive(inBuf);
  @@ -522,7 +525,7 @@
   return len;
   }
   
  -// Not enough data (blen  pos + len)
  +// Not enough data (blen  pos + len) or chunked encoded
   int toCopy = len;
   while(toCopy  0) {
   int bytesRemaining = blen - pos;
  @@ -559,7 +562,10 @@
   }
   
   // If the server returns an empty packet, assume that 
that end of
  -// the stream has been reached (yuck -- fix protocol??).
  +// the stream has been reached (yuck -- fix protocol??).
  +if (end_of_stream) {
  +return false;
  +}
   
   // Why not use outBuf??
   inBuf.reset();
  @@ -572,6 +578,14 @@
   throw new IOException();
   }
   
  +// No data received.
  +if( inBuf.getLen() == 0 ) {
  +pos=0;
  +blen=0;
  +end_of_stream = true;
  +return false;
  +}
  +
   blen = inBuf.peekInt();
   pos = 0;
   inBuf.getBytes(bodyBuff);
  
  
  
  1.14  +23 -10
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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- mod_jk.c 2001/09/04 13:04:03 1.13
  +++ mod_jk.c 2001/09/10 18:32:36 1.14
  @@ -275,15 +275,18 @@
   if(s  s-ws_private  b  actually_read) {
   apache_private_data_t *p = s-ws_private;
   if(!p-read_body_started) {
  -if(!ap_setup_client_block(p-r, 
REQUEST_CHUNKED_DECHUNK)) {
  -if(ap_should_client_block(p-r)) { 
  -p-read_body_started = JK_TRUE; 
  -}
  +   if(ap_should_client_block(p-r)) { 
  +p-read_body_started = JK_TRUE; 
   }
   }
   
  -if(p-read_body_started) {
  -*actually_read = ap_get_client_block(p-r, b, len);
  +if(p-read_body_started) {
  +long rv;
  +if ((rv = ap_get_client_block(p-r, b, len))  0) {
  +*actually_read = 0;
  +} else {
  +*actually_read = (unsigned) rv;
  +}
   return JK_TRUE;
   }
   }
  @@ -457,7 +460,9 @@
   s-server_software = (char *)ap_get_server_version();
   
   s-method   = (char *)r-method;
  -s-content_length = get_content_length(r);
  +s-content_length = get_content_length(r);
  +s-is_chunked   = r-read_chunked;
  +s-no_more_chunks = 0;
   s-query_string = r-args;