cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_channel_apr_socket.c jk_channel_socket.c jk_worker_ajp13.c

2003-10-16 Thread hgomez
hgomez  2003/10/16 01:41:06

  Modified:jk/native2/common jk_channel_apr_socket.c
jk_channel_socket.c jk_worker_ajp13.c
  Log:
  Now it compile
  
  Revision  ChangesPath
  1.33  +2 -3  
jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c
  
  Index: jk_channel_apr_socket.c
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- jk_channel_apr_socket.c   16 Oct 2003 07:51:48 -  1.32
  +++ jk_channel_apr_socket.c   16 Oct 2003 08:41:06 -  1.33
  @@ -91,7 +91,6 @@
   short port;
   int keepalive;
   int timeout;
  -int 
   };
   
   typedef struct jk_channel_apr_private jk_channel_apr_private_t;
  @@ -146,8 +145,8 @@
   char *name )
   {
   jk_channel_t *ch=(jk_channel_t *)bean-object;
  -jk_channel_socket_private_t *socketInfo=
  -(jk_channel_socket_private_t *)(ch-_privatePtr);
  +jk_channel_apr_private_t *socketInfo=
  +(jk_channel_apr_private_t *)(ch-_privatePtr);
   
   if( strcmp( name, name )==0 ) {
   return  bean-name;
  
  
  
  1.58  +2 -2  jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c
  
  Index: jk_channel_socket.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- jk_channel_socket.c   16 Oct 2003 07:51:48 -  1.57
  +++ jk_channel_socket.c   16 Oct 2003 08:41:06 -  1.58
  @@ -244,7 +244,7 @@
   static int JK_METHOD jk2_channel_socket_hasinput(jk_env_t *env,
jk_channel_t *ch,
jk_endpoint_t *endpoint,
  -
  int timeout)
  + int timeout)
   {
fd_set  rset; 
fd_set  eset; 
  @@ -259,7 +259,7 @@
tv.tv_sec  = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
   
  - rc = select(ae-sd + 1, rset, NULL, eset, tv);
  + rc = select(endpoint-sd + 1, rset, NULL, eset, tv);
 
   if ((rc  1) || (FD_ISSET(endpoint-sd, eset)))
{
  
  
  
  1.51  +4 -5  jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- jk_worker_ajp13.c 16 Oct 2003 07:51:48 -  1.50
  +++ jk_worker_ajp13.c 16 Oct 2003 08:41:06 -  1.51
  @@ -124,7 +124,7 @@
   } else if (strcmp( name, graceful )==0 ) {
   return jk2_env_itoa( env, worker-graceful );
   } else if (strcmp( name, connectTimeout )==0 ) {
  -return jk2_env_itoa( env, worket-connect_timeout);
  +return jk2_env_itoa( env, worker-connect_timeout);
   } else if (strcmp( name, replyTimeout )==0 ) {
   return jk2_env_itoa( env, worker-reply_timeout);
   } else if (strcmp( name, prepostTimeout )==0 ) {
  @@ -277,9 +277,9 @@
*/
   static int jk2_check_alive(jk_env_t *env, jk_endpoint_t *ae, int timeout) {
   
  +int err;
   jk_channel_t *channel=ae-worker-channel;
   jk_msg_t * msg=ae-reply;
  -;
   
jk2_serialize_cping( env, msg, ae );
err = ae-worker-channel-send( env, ae-worker-channel, ae, msg );
  @@ -312,7 +312,6 @@
return JK_ERR;
}

  - 
return JK_OK;
   }
   
  @@ -353,7 +352,7 @@
   /** XXX use a 'connected' field */
   if( ae-sd == -1 ) ae-sd=0;
   
  - if (ae-worker-connect_timeout != 0 )
  + if (ae-worker-connect_timeout != 0 ) {
if (jk2_check_alive(env, ae, ae-worker-connect_timeout) != JK_OK)
return JK_ERR;
}
  @@ -582,7 +581,7 @@
   s-content_read=0;
   
if (w-prepost_timeout != 0) {
  - if (jk2_check_alive(env, ae, ae-worker-prepost_timeout) != JK_OK)
  + if (jk2_check_alive(env, e, e-worker-prepost_timeout) != JK_OK)
return JK_ERR;
}

  
  
  

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



cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_channel_apr_socket.c jk_channel_socket.c

2002-01-25 Thread costin

costin  02/01/25 23:05:19

  Modified:jk/native2/common jk_channel_socket.c
  Added:   jk/native2/common jk_channel_apr_socket.c
  Log:
  Update the channels.
  
  I moved the apr_socket in the same dir - apr is not a special case, it'll be the
  default. If jni is here, apr should be too - I would rather move the 'old'
  socket in a special dir ( or just remove it later ).
  
  Revision  ChangesPath
  1.12  +58 -6 jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c
  
  Index: jk_channel_socket.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_channel_socket.c   17 Dec 2001 07:17:08 -  1.11
  +++ jk_channel_socket.c   26 Jan 2002 07:05:19 -  1.12
  @@ -165,7 +165,7 @@
   host = jk_map_getStrProp( env, props,
 worker, worker_name, host, host);
   tmp = jk_map_getStrProp( env, props,
  -  worker, worker_name, port, NULL );
  +  worker, worker_name, port, 8007 );
   if( tmp != NULL )
   port=jk_map_str2int( env, tmp);
   
  @@ -344,14 +344,20 @@
*/
   static int JK_METHOD jk_channel_socket_send(jk_env_t *env, jk_channel_t *_this,
   jk_endpoint_t *endpoint,
  -char *b, int len) 
  +jk_msg_t *msg) 
   {
  +char *b;
  +int len;
   int sd;
   int  sent=0;
  -
   jk_channel_socket_data_t *chD=endpoint-channelData;
  +
   if( chD==NULL ) 
return JK_FALSE;
  +
  +msg-end( env, msg );
  +len=msg-len;
  +b=msg-buf;
   sd=chD-sock;
   
   while(sent  len) {
  @@ -378,9 +384,10 @@
*0: length of the received data.
* Was: tcp_socket_recvfull
*/
  -static int JK_METHOD jk_channel_socket_recv( jk_env_t *env, jk_channel_t *_this,
  - jk_endpoint_t *endpoint,
  - char *b, int len ) 
  +static int JK_METHOD jk_channel_socket_readN( jk_env_t *env,
  +  jk_channel_t *_this,
  +  jk_endpoint_t *endpoint,
  +  char *b, int len )
   {
   jk_channel_socket_data_t *chD=endpoint-channelData;
   int sd;
  @@ -417,6 +424,49 @@
   }
   
   
  +/** receive len bytes.
  + * @param sd  opened socket.
  + * @param b   buffer to store the data.
  + * @param len length to receive.
  + * @return-1: receive failed or connection closed.
  + *0: length of the received data.
  + * Was: tcp_socket_recvfull
  + */
  +static int JK_METHOD jk_channel_socket_recv( jk_env_t *env, jk_channel_t *_this,
  + jk_endpoint_t *endpoint,
  + jk_msg_t *msg )
  +{
  +int hlen=msg-headerLength;
  +int blen;
  +int rc;
  +
  +
  +jk_channel_socket_readN( env, _this, endpoint, msg-buf, hlen );
  +
  +blen=msg-checkHeader( env, msg, endpoint );
  +if( blen  0 ) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +  channelSocket.receive(): Bad header\n );
  +return JK_FALSE;
  +}
  +
  +rc= jk_channel_socket_readN( env, _this, endpoint, msg-buf + hlen, blen);
  +
  +if(rc  0) {
  +env-l-jkLog(env, env-l, JK_LOG_ERROR,
  +   channelSocket.receive(): Error receiving message body %d %d\n,
  +  rc, errno);
  +return JK_FALSE;
  +}
  +
  +env-l-jkLog(env, env-l, JK_LOG_INFO,
  +  channelSocket.receive(): Received len=%d type=%d\n,
  +  blen, (int)msg-buf[hlen]);
  +return JK_TRUE;
  +
  +}
  +
  +
   
   int JK_METHOD jk_channel_socket_factory(jk_env_t *env,
   jk_pool_t *pool, 
  @@ -452,6 +502,8 @@
   
   _this-name=file;
   
  +_this-is_stream=JK_TRUE;
  +
   *result= _this;
   
   return JK_TRUE;
  
  
  
  1.1  
jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c
  
  Index: jk_channel_apr_socket.c
  ===
  /* = *
   *   *
   * The Apache Software License,  Version 1.1 *
   *   *
   *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
   *   All rights reserved.