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

2004-03-17 Thread hgomez
hgomez  2004/03/17 08:52:03

  Modified:jk/native2/common jk_channel_un.c
  Log:
  Remove unused vars (thanks gcc -wall)
  
  Revision  ChangesPath
  1.20  +0 -1  jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c
  
  Index: jk_channel_un.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- jk_channel_un.c   5 Mar 2004 23:35:51 -   1.19
  +++ jk_channel_un.c   17 Mar 2004 16:52:03 -  1.20
  @@ -224,7 +224,6 @@
   jk_channel_t *ch,
   jk_endpoint_t *endpoint)
   {
  -int err;
   jk_channel_un_private_t *socketInfo=
   (jk_channel_un_private_t *)(ch->_privatePtr);
   int unixsock;
  
  
  

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



Re: cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_channel_un.c

2004-03-05 Thread ax
This account does not exist



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



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

2004-03-05 Thread truk
truk2004/03/05 15:35:52

  Modified:jk/native2/common jk_channel_un.c
  Log:
  Calculate length for bind() in a portable way that works for
  sockaddr_un structs with and without sun_len.
  
  Revision  ChangesPath
  1.19  +7 -2  jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c
  
  Index: jk_channel_un.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- jk_channel_un.c   24 Feb 2004 08:44:40 -  1.18
  +++ jk_channel_un.c   5 Mar 2004 23:35:51 -   1.19
  @@ -58,6 +58,12 @@
   int listenSocket;
   } jk_channel_un_private_t;
   
  +#ifndef SUN_LEN
  +/* actual length of an initialized sockaddr_un */
  +#define SUN_LEN(su) \
  +(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
  +#endif
  +
   static int JK_METHOD jk2_channel_un_close(jk_env_t *env, jk_channel_t *ch,
 jk_endpoint_t *endpoint);
   
  @@ -162,8 +168,7 @@
   
   rc=bind(socketInfo->listenSocket,
   (struct sockaddr *)& socketInfo->unix_addr,
  -strlen( socketInfo->unix_addr.sun_path ) +
  -sizeof( socketInfo->unix_addr.sun_family) );
  +SUN_LEN(&(socketInfo->unix_addr)) );
   
   umask(omask); /* can't fail, so can't clobber errno */
   
  
  
  

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



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

2003-03-04 Thread costin
costin  2003/03/04 15:56:37

  Modified:jk/native2/common jk_channel_un.c
  Log:
  Added few visible attributes to channel_un
  
  I still get some ocasional errors - can't reproduce it consistently, but
  it happened twice in the last 3 days.
  
  Revision  ChangesPath
  1.16  +27 -1 jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c
  
  Index: jk_channel_un.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- jk_channel_un.c   4 Feb 2003 07:39:59 -   1.15
  +++ jk_channel_un.c   4 Mar 2003 23:56:37 -   1.16
  @@ -103,8 +103,10 @@
 jk_endpoint_t *endpoint);
   
   static char *jk2_channel_un_multiValueInfo[]={"group",  NULL };
  -static char *jk2_channel_un_setAttributeInfo[]={"file", "route", "lb_factor",
  +static char *jk2_channel_un_setAttributeInfo[]={"file", "soLinger", "listen", 
   "level", NULL };
  +static char *jk2_channel_un_getAttributeInfo[]={"file", "soLinger", 
  +"listen", NULL };
   
   static int JK_METHOD jk2_channel_un_setAttribute(jk_env_t *env,
   jk_bean_t *mbean, 
  @@ -128,6 +130,24 @@
   return JK_OK;
   }
   
  +static void * JK_METHOD jk2_channel_un_getAttribute(jk_env_t *env,
  + jk_bean_t *mbean, 
  + char *name)
  +{
  +jk_channel_t *ch=(jk_channel_t *)mbean->object;
  +jk_channel_un_private_t *socketInfo=
  +(jk_channel_un_private_t *)(ch->_privatePtr);
  +
  +if( strcmp( "file", name ) == 0 ) {
  +return socketInfo->file;
  +} else if( strcmp( "soLinger", name ) == 0 ) {
  +return jk2_env_itoa( env, socketInfo->l_linger );
  +} else if( strcmp( "listen", name ) == 0 ) {
  +return jk2_env_itoa( env, socketInfo->backlog );
  +} 
  +return NULL;
  +}
  +
   /** resolve the host IP ( jk_resolve ) and initialize the channel.
*/
   static int JK_METHOD jk2_channel_un_init(jk_env_t *env,
  @@ -139,6 +159,8 @@
   int rc=JK_OK;
   int omask;
   
  +env->l->jkLog(env, env->l, JK_LOG_INFO,
  +  "channelUn.init(): init \n" );
   if( socketInfo->file==NULL ) {
   char *localName=ch->mbean->localName;
   jk_config_t *cfg=ch->workerEnv->config;
  @@ -153,6 +175,8 @@
   if (localName[0]=='/') {
   ch->mbean->setAttribute( env, ch->mbean, "file", localName );
   } 
  +env->l->jkLog(env, env->l, JK_LOG_INFO,
  +  "channelUn.init(): extracted file from name %s\n", 
socketInfo->file  );
   }
   
   if (socketInfo->file!=NULL && socketInfo->file[0]=='/') {
  @@ -470,8 +494,10 @@
   ch->serverSide=JK_FALSE;
   
   result->setAttribute= jk2_channel_un_setAttribute; 
  +result->getAttribute= jk2_channel_un_getAttribute; 
   result->multiValueInfo=jk2_channel_un_multiValueInfo;
   result->setAttributeInfo=jk2_channel_un_setAttributeInfo;
  +result->getAttributeInfo=jk2_channel_un_getAttributeInfo;
   result->invoke=jk2_channel_invoke;
   
   ch->mbean=result;
  
  
  

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



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

2002-07-08 Thread mturk

mturk   2002/07/08 06:41:13

  Modified:jk/native2/common jk_channel_un.c
  Log:
  no message
  
  Revision  ChangesPath
  1.13  +5 -5  jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c
  
  Index: jk_channel_un.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_channel_un.c   10 Jun 2002 21:55:06 -  1.12
  +++ jk_channel_un.c   8 Jul 2002 13:41:13 -   1.13
  @@ -160,7 +160,7 @@
   strcpy(socketInfo->unix_addr.sun_path,  socketInfo->file );
   
   if( ch->mbean->debug > 0 )
  -env->l->jkLog(env, env->l, JK_LOG_INFO,
  +env->l->jkLog(env, env->l, JK_LOG_DEBUG,
 "channelUn.init(): create AF_UNIX  %s\n", 
socketInfo->file );
   } else {
   env->l->jkLog(env, env->l, JK_LOG_ERROR, "channelUn.init(): "
  @@ -263,7 +263,7 @@
   }
   
   if( ch->mbean->debug > 0 ) 
  -env->l->jkLog(env, env->l, JK_LOG_INFO,
  +env->l->jkLog(env, env->l, JK_LOG_DEBUG,
 "channelUn.open(): create unix socket %s %d\n", 
socketInfo->file, unixsock );
   
   if (connect(unixsock,(struct sockaddr *)&(socketInfo->unix_addr),
  @@ -277,7 +277,7 @@
   }
   
   if( ch->mbean->debug > 0 ) 
  -env->l->jkLog(env, env->l, JK_LOG_INFO,
  +env->l->jkLog(env, env->l, JK_LOG_DEBUG,
 "channelUn.open(): connect unix socket %d %s\n", unixsock, 
socketInfo->file );
   /* store the channel information */
   endpoint->sd=unixsock;
  @@ -334,7 +334,7 @@
   this_time = write(unixsock, (char *)b + sent , len - sent);
   
   if( ch->mbean->debug > 0 ) 
  -env->l->jkLog(env, env->l, JK_LOG_INFO,
  +env->l->jkLog(env, env->l, JK_LOG_DEBUG,
 "channel.apr:send() write() %d %d %s\n", this_time, errno,
 strerror( errno));
   if(0 == this_time) {
  @@ -436,7 +436,7 @@
   }
   
   if( ch->mbean->debug > 0 ) 
  -env->l->jkLog(env, env->l, JK_LOG_INFO,
  +env->l->jkLog(env, env->l, JK_LOG_DEBUG,
 "channelUn.receive(): Received len=%d type=%d\n",
 blen, (int)msg->buf[hlen]);
   return JK_OK;
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




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

2002-05-11 Thread nacho

nacho   02/05/11 18:09:46

  Modified:jk/native2/common jk_channel_un.c
  Log:
  * Fixed the build on non HAVE_UNIXSOCKETS OSes
  
  Revision  ChangesPath
  1.4   +1 -1  jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c
  
  Index: jk_channel_un.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_channel_un.c   11 May 2002 00:03:53 -  1.3
  +++ jk_channel_un.c   12 May 2002 01:09:46 -  1.4
  @@ -397,7 +397,7 @@
   {
   env->l->jkLog( env, env->l, JK_LOG_ERROR,
  "channelUn.factory(): Support for unix sockets is disabled, "
  -   "you need to set HAVE_UNIXSOCKETS at compile time\n",
  +   "you need to set HAVE_UNIXSOCKETS at compile time\n");
   return JK_FALSE;
   }
   #endif
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




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

2002-05-10 Thread costin

costin  02/05/10 17:03:53

  Modified:jk/native2/common jk_channel_un.c
  Log:
  Update the messages.
  
  Check if the socket is open, more checks.
  
  Revision  ChangesPath
  1.3   +30 -12jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c
  
  Index: jk_channel_un.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_channel_un.c   9 May 2002 23:47:31 -   1.2
  +++ jk_channel_un.c   11 May 2002 00:03:53 -  1.3
  @@ -170,26 +170,26 @@
   unixsock = socket(AF_UNIX, SOCK_STREAM, 0);
   if (unixsock<0) {
   env->l->jkLog(env, env->l, JK_LOG_ERROR,
  -  "channelApr.open(): can't create socket %d %s\n",
  +  "channelUn.open(): can't create socket %d %s\n",
 errno, strerror( errno ) );
   return JK_ERR;
   }
   
   if( _this->mbean->debug > 0 ) 
   env->l->jkLog(env, env->l, JK_LOG_INFO,
  -  "channelApr.open(): create unix socket %s %d\n", 
socketInfo->file, unixsock );
  +  "channelUn.open(): create unix socket %s %d\n", 
socketInfo->file, unixsock );
   
   if (connect(unixsock,(struct sockaddr *)&(socketInfo->unix_addr),
   sizeof(struct sockaddr_un))<0) {
   close(unixsock);
   env->l->jkLog(env, env->l, JK_LOG_ERROR,
  -  "channelApr.connect() connect failed %d %s\n",
  +  "channelUn.connect() connect failed %d %s\n",
 errno, strerror( errno ) );
   return JK_ERR;
   }
   if( _this->mbean->debug > 0 ) 
   env->l->jkLog(env, env->l, JK_LOG_INFO,
  -  "channelApr.open(): connect unix socket %d %s\n", unixsock, 
socketInfo->file );
  +  "channelUn.open(): connect unix socket %d %s\n", unixsock, 
socketInfo->file );
   /* store the channel information */
   
   endpoint->sd=unixsock;
  @@ -202,6 +202,7 @@
jk_endpoint_t *endpoint)
   {
   close( endpoint->sd );
  +endpoint->sd=-1;
   }
   
   
  @@ -231,6 +232,11 @@
   b=msg->buf;
   
   unixsock=endpoint->sd;
  +if( unixsock < 0 ) {
  +env->l->jkLog(env, env->l, JK_LOG_INFO,
  +  "channel.apr:send() not connected %d\n", unixsock );
  +return JK_ERR;
  +}
   
   while(sent < len) {
   /* this_time = send(unixsock, (char *)b + sent , len - sent,  0); */
  @@ -263,7 +269,7 @@
   /** receive len bytes.
* @param sd  opened socket.
* @param b   buffer to store the data.
  - * @param len length to receive.
  + * @param len length to receive
* @return-1: receive failed or connection closed.
*>0: length of the received data.
* Was: tcp_socket_recvfull
  @@ -278,16 +284,22 @@
   
   sd=endpoint->sd;
   
  +if( sd < 0 ) {
  +env->l->jkLog(env, env->l, JK_LOG_INFO,
  +  "channel.apr:readN() not connected %d\n", sd );
  +return -3;
  +}
  +
   rdlen = 0;
   
   while(rdlen < len) {
   int this_time = recv(sd, (char *)b + rdlen, 
len - rdlen, 0);
  -if(-1 == this_time) {
  +if( this_time < 0 ) {
   if(EAGAIN == errno) {
   continue;
   } 
  -return -1;
  +return -2;
   }
   if(0 == this_time) {
   return -1; 
  @@ -312,15 +324,21 @@
   {
   int hlen=msg->headerLength;
   int blen;
  -int rc;
  +int rc=JK_OK;
   
   
  -jk2_channel_un_readN( env, _this, endpoint, msg->buf, hlen );
  +blen=jk2_channel_un_readN( env, _this, endpoint, msg->buf, hlen );
  +if( blen <= 0 ) {
  +env->l->jkLog(env, env->l, JK_LOG_ERROR,
  +  "channelUn.receive(): error receiving %d %d %s %p %d\n",
  +  blen, errno, strerror( errno ), endpoint, endpoint->sd);
  +return JK_ERR;
  +}
   
   blen=msg->checkHeader( env, msg, endpoint );
   if( blen < 0 ) {
   env->l->jkLog(env, env->l, JK_LOG_ERROR,
  -  "channelApr.receive(): Bad header\n" );
  +  "channelUn.receive(): Bad header\n" );
   return JK_ERR;
   }
   
  @@ -328,14 +346,14 @@
   
   if(rc < 0) {
   env->l->jkLog(env, env->l, JK_LOG_ERROR,
  -   "channelApr.receive(): Error receiving message body %d %d\n",
  +   "channelUn.receive(): Error receiving message body %d %d\n",
 rc, errno);
   return JK_ERR;
   }
   
   if( _this->mbean->debug > 0 ) 
   env->l->jkLog(env, env->l, JK_LOG_INFO,