cvs commit: jakarta-tomcat-connectors/jni/native/os/unix uxpipe.c

2005-07-02 Thread mturk
mturk   2005/07/02 01:24:21

  Modified:jni/native/os/unix uxpipe.c
  Log:
  type is now member of net structure.
  
  Revision  ChangesPath
  1.4   +8 -10 jakarta-tomcat-connectors/jni/native/os/unix/uxpipe.c
  
  Index: uxpipe.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/os/unix/uxpipe.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- uxpipe.c  2 Jul 2005 07:19:10 -   1.3
  +++ uxpipe.c  2 Jul 2005 08:24:21 -   1.4
  @@ -170,9 +170,9 @@
   {
   tcn_socket_t *s = (tcn_socket_t *)data;
   
  -if (s-cleanup) {
  -(*s-cleanup)(s-opaque);
  -s-cleanup = NULL;
  +if (s-net-cleanup) {
  +(*s-net-cleanup)(s-opaque);
  +s-net-cleanup = NULL;
   }
   #ifdef TCN_DO_STATISTICS
   apr_atomic_inc32(uxp_cleared);
  @@ -246,7 +246,7 @@
   UNREFERENCED_STDARGS;
   UNREFERENCED(sa);
   TCN_ASSERT(sock != 0);
  -if (s-type == TCN_SOCKET_UNIX) {
  +if (s-net-type == TCN_SOCKET_UNIX) {
   int rc;
   tcn_uxp_conn_t *c = (tcn_uxp_conn_t *)s-opaque;
   c-mode = TCN_UXP_SERVER;
  @@ -267,7 +267,7 @@
   UNREFERENCED_STDARGS;
   
   TCN_ASSERT(sock != 0);
  -if (s-type == TCN_SOCKET_UNIX) {
  +if (s-net-type == TCN_SOCKET_UNIX) {
   tcn_uxp_conn_t *c = (tcn_uxp_conn_t *)s-opaque;
   c-mode = TCN_UXP_SERVER;
   return apr_socket_listen(c-sock, (apr_int32_t)backlog);
  @@ -287,7 +287,7 @@
   TCN_ASSERT(sock != 0);
   
   TCN_THROW_IF_ERR(apr_pool_create(p, s-pool), p);
  -if (s-type == TCN_SOCKET_UNIX) {
  +if (s-net-type == TCN_SOCKET_UNIX) {
   apr_socklen_t len;
   tcn_uxp_conn_t *c = (tcn_uxp_conn_t *)s-opaque;
   con = (tcn_uxp_conn_t *)apr_pcalloc(p, sizeof(tcn_uxp_conn_t));
  @@ -330,15 +330,13 @@
jlong sa)
   {
   tcn_socket_t *s = J2P(sock, tcn_socket_t *);
  -apr_pool_t   *p = NULL;
  -tcn_socket_t *a = NULL;
   tcn_uxp_conn_t *con = NULL;
   int rc;
   
   UNREFERENCED(o);
   UNREFERENCED(sa);
   TCN_ASSERT(sock != 0);
  -if (s-type != TCN_SOCKET_UNIX)
  +if (s-net-type != TCN_SOCKET_UNIX)
   return APR_ENOTSOCK;
   con = (tcn_uxp_conn_t *)s-opaque;
   if (con-mode != TCN_UXP_UNKNOWN)
  
  
  

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



Re: cvs commit: jakarta-tomcat-connectors/jni/native/os/unix uxpipe.c

2005-07-02 Thread Natasha Hasmani
Thank-you for your e-mail.

Please note that i will be away from the office starting Wednesday June
29th, returning Thursday July 7th, with no access to email.  In my absence,
kindly contact Cheri Dueck at [EMAIL PROTECTED]

Kind Regards,

Natasha Hasmani
Senior Event Manager 



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



cvs commit: jakarta-tomcat-connectors/jni/native/os/unix uxpipe.c

2005-06-30 Thread mturk
mturk   2005/06/30 08:19:15

  Added:   jni/native/os/unix uxpipe.c
  Log:
  Add AF_UNIX network interface implementation.
  
  Revision  ChangesPath
  1.1  jakarta-tomcat-connectors/jni/native/os/unix/uxpipe.c
  
  Index: uxpipe.c
  ===
  /* Copyright 2000-2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the License);
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an AS IS BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  /** UNIX AF_LOCAL network wrapper
   *
   * @author Mladen Turk
   * @version $Revision: 1.1 $, $Date: 2005/06/30 15:19:15 $
   */
  
  
  #include tcn.h
  #include apr_thread_mutex.h
  #include apr_poll.h
  
  /* ### should be tossed in favor of APR */
  #include sys/stat.h
  #include sys/un.h /* for sockaddr_un */
  
  #ifdef TCN_DO_STATISTICS
  #include apr_atomic.h
  
  static volatile apr_uint32_t uxp_created  = 0;
  static volatile apr_uint32_t uxp_closed   = 0;
  static volatile apr_uint32_t uxp_cleared  = 0;
  static volatile apr_uint32_t uxp_accepted = 0;
  
  void uxp_network_dump_statistics()
  {
  fprintf(stderr, NT Network Statistics ..\n);
  fprintf(stderr, Sockets created : %d\n, uxp_created);
  fprintf(stderr, Sockets accepted: %d\n, uxp_accepted);
  fprintf(stderr, Sockets closed  : %d\n, uxp_closed);
  fprintf(stderr, Sockets cleared : %d\n, uxp_cleared);
  }
  
  #endif
  
  #define DEFNAME /var/run/tomcatnativesock
  #define DEFNAME_FMT /var/run/tomcatnativesock%08x%08x
  #define DEFSIZE 8192
  #define DEFTIMEOUT  6
  
  #define TCN_UXP_UNKNOWN 0
  #define TCN_UXP_CLIENT  1
  #define TCN_UXP_ACCEPTED2
  #define TCN_UXP_SERVER  3
  
  #define TCN_UNIX_MAXPATH1024
  typedef struct {
  apr_pool_t  *pool;
  apr_socket_t*sock;   /* APR socket */
  int sd;
  struct sockaddr_un  uxaddr;
  int timeout;
  int mode; /* Client or server mode */
  charname[TCN_UNIX_MAXPATH+1];
  } tcn_uxp_conn_t;
  
  static apr_status_t APR_THREAD_FUNC
  uxp_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t)
  {
  tcn_uxp_conn_t *con = (tcn_uxp_conn_t *)sock;
  if (t  0)
  con-timeout = -1;
  else
  con-timeout = (int)(apr_time_as_msec(t));
  return APR_SUCCESS;
  }
  
  static apr_status_t APR_THREAD_FUNC
  uxp_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t)
  {
  tcn_uxp_conn_t *con = (tcn_uxp_conn_t*)sock;
  if (con-timeout  0)
  *t = -1;
  else
  *t = con-timeout * 1000;
  return APR_SUCCESS;
  }
  
  static APR_INLINE apr_status_t APR_THREAD_FUNC
  uxp_socket_opt_set(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on)
  {
  tcn_uxp_conn_t *con = (tcn_uxp_conn_t *)sock;
  return apr_socket_opt_set(con-sock, opt, on);
  }
  
  static APR_INLINE apr_status_t APR_THREAD_FUNC
  uxp_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on)
  {
  tcn_uxp_conn_t *con = (tcn_uxp_conn_t *)sock;
  return apr_socket_opt_get(con-sock, opt, on);
  }
  
  static apr_status_t uxp_cleanup(void *data)
  {
  tcn_uxp_conn_t *con = (tcn_uxp_conn_t *)data;
  
  if (con) {
  if (con-sock) {
  apr_socket_close(con-sock);
  con-sock = NULL;
  }
  if (con-mode == TCN_UXP_SERVER) {
  unlink(con-name);
  con-mode = TCN_UXP_UNKNOWN;
  }
  }
  
  #ifdef TCN_DO_STATISTICS
  apr_atomic_inc32(uxp_cleared);
  #endif
  return APR_SUCCESS;
  }
  
  static apr_status_t APR_THREAD_FUNC
  uxp_socket_shutdown(apr_socket_t *sock, apr_shutdown_how_e how)
  {
  tcn_uxp_conn_t *con = (tcn_uxp_conn_t *)sock;
  return apr_socket_shutdown(con-sock, how);
  }
  
  static apr_status_t APR_THREAD_FUNC
  uxp_socket_close(apr_socket_t *sock)
  {
  #ifdef TCN_DO_STATISTICS
  apr_atomic_inc32(uxp_closed);
  #endif
  return uxp_cleanup(sock);
  }
  
  static apr_status_t APR_THREAD_FUNC
  uxp_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
  {
  tcn_uxp_conn_t *con = (tcn_uxp_conn_t *)sock;
  return apr_socket_recv(con-sock, buf, len);
  }
  
  
  static apr_status_t APR_THREAD_FUNC
  uxp_socket_send(apr_socket_t *sock, const char *buf,
  apr_size_t *len)
  {
  tcn_uxp_conn_t *con = (tcn_uxp_conn_t *)sock;
  return 

cvs commit: jakarta-tomcat-connectors/jni/native/os/unix uxpipe.c

2005-06-30 Thread mturk
mturk   2005/06/30 08:22:33

  Modified:jni/native/os/unix uxpipe.c
  Log:
  Fix typo. This is not NTPIPE :)
  
  Revision  ChangesPath
  1.2   +3 -3  jakarta-tomcat-connectors/jni/native/os/unix/uxpipe.c
  
  Index: uxpipe.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/os/unix/uxpipe.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- uxpipe.c  30 Jun 2005 15:19:15 -  1.1
  +++ uxpipe.c  30 Jun 2005 15:22:32 -  1.2
  @@ -306,7 +306,7 @@
   #endif
   a = (tcn_socket_t *)apr_pcalloc(p, sizeof(tcn_socket_t));
   a-pool = p;
  -a-type = TCN_SOCKET_NTPIPE;
  +a-type = TCN_SOCKET_UNIX;
   a-cleanup  = uxp_cleanup;
   a-recv = uxp_socket_recv;
   a-send = uxp_socket_send;
  @@ -347,7 +347,6 @@
   con = (tcn_uxp_conn_t *)s-opaque;
   if (con-mode != TCN_UXP_UNKNOWN)
   return APR_EINVAL;
  -con-mode = TCN_UXP_CLIENT;
   do {
   rc = connect(con-sd, (const struct sockaddr *)(con-uxaddr),
sizeof(con-uxaddr));
  @@ -355,6 +354,7 @@
   
   if (rc == -1  errno != EISCONN)
   return errno;
  +con-mode = TCN_UXP_CLIENT;
   
   return APR_SUCCESS;
   }
  
  
  

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