cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h sockaddr.c

2000-01-21 Thread stoddard
stoddard00/01/20 17:25:43

  Modified:src  acinclude.m4
   src/include ap_ac_config.h httpd.h
   src/lib/apr/lib apr_snprintf.c
   src/lib/apr/network_io/unix networkio.h sockaddr.c
  Log:
  Back out most of the last commit. Keep APR macros seperate from Apache
  macros.
  
  Revision  ChangesPath
  1.19  +1 -1  apache-2.0/src/acinclude.m4
  
  Index: acinclude.m4
  ===
  RCS file: /export/home/cvs/apache-2.0/src/acinclude.m4,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- acinclude.m4  2000/01/20 22:14:05 1.18
  +++ acinclude.m4  2000/01/21 01:25:20 1.19
  @@ -157,7 +157,7 @@
   #ifdef HAVE_SYS_SOCKET_H
   #include 
   #endif
  -#if APR_HAVE_NETINET_IN_H
  +#ifdef HAVE_NETINET_IN_H
   #include 
   #endif
   #ifdef HAVE_ARPA_INET_H
  
  
  
  1.7   +1 -1  apache-2.0/src/include/ap_ac_config.h
  
  Index: ap_ac_config.h
  ===
  RCS file: /export/home/cvs/apache-2.0/src/include/ap_ac_config.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ap_ac_config.h2000/01/20 22:14:12 1.6
  +++ ap_ac_config.h2000/01/21 01:25:24 1.7
  @@ -105,7 +105,7 @@
   #include 
   #endif
   
  -#if APR_HAVE_NETINET_IN_H
  +#ifdef HAVE_NETINET_IN_H
   #include 
   #endif
   
  
  
  
  1.22  +1 -1  apache-2.0/src/include/httpd.h
  
  Index: httpd.h
  ===
  RCS file: /export/home/cvs/apache-2.0/src/include/httpd.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- httpd.h   2000/01/20 22:14:15 1.21
  +++ httpd.h   2000/01/21 01:25:25 1.22
  @@ -81,7 +81,7 @@
   #include "ap.h"
   #include "ap_mmn.h"
   
  -#if APR_HAVE_NETINET_IN_H
  +#ifdef HAVE_NETINET_IN_H
   #include 
   #endif
   
  
  
  
  1.9   +1 -1  apache-2.0/src/lib/apr/lib/apr_snprintf.c
  
  Index: apr_snprintf.c
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/lib/apr_snprintf.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- apr_snprintf.c2000/01/20 22:14:23 1.8
  +++ apr_snprintf.c2000/01/21 01:25:30 1.9
  @@ -70,7 +70,7 @@
   #ifdef HAVE_CTYPE_H
   #include 
   #endif
  -#if APR_HAVE_NETINET_IN_H
  +#ifdef HAVE_NETINET_IN_H
   #include 
   #endif
   #ifdef HAVE_SYS_SOCKET_H
  
  
  
  1.15  +1 -1  apache-2.0/src/lib/apr/network_io/unix/networkio.h
  
  Index: networkio.h
  ===
  RCS file: 
/export/home/cvs/apache-2.0/src/lib/apr/network_io/unix/networkio.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- networkio.h   2000/01/20 22:14:30 1.14
  +++ networkio.h   2000/01/21 01:25:34 1.15
  @@ -86,7 +86,7 @@
   #if HAVE_NETINET_TCP_H
   #include 
   #endif
  -#if APR_HAVE_NETINET_IN_H
  +#if HAVE_NETINET_IN_H
   #include 
   #endif
   #if HAVE_ARPA_INET_H
  
  
  
  1.4   +1 -1  apache-2.0/src/lib/apr/network_io/unix/sockaddr.c
  
  Index: sockaddr.c
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockaddr.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sockaddr.c2000/01/20 22:14:33 1.3
  +++ sockaddr.c2000/01/21 01:25:36 1.4
  @@ -203,7 +203,7 @@
   
   
   
  -#if APR_HAVE_NETINET_IN_H
  +#if HAVE_NETINET_IN_H
   /* ***APRDOC
* ap_status_t ap_get_local_name(struct sockaddr_in **name, const 
ap_socket_t *socket)
*Return the local socket name as a BSD style struct sockaddr_in.
  
  
  


Re: cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h sockaddr.c

2000-01-20 Thread rbb

>   Convert HAVE_NETINET... to the APR mac

Please undo this change.  APR is not providing configuration macros for
Apache.  That is up to Apache to do.  The APR_HAVE_NETINET_H macro is
defined so that the APR PUBLIC header file can use it.  This macro should
also not be used by APR internal files.  It should only be used by header
files that APR provides for other programs, such as apr_network_io.h

Ryan



cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h sockaddr.c

2000-01-20 Thread stoddard
stoddard00/01/20 14:14:39

  Modified:src  acinclude.m4
   src/include ap_ac_config.h httpd.h
   src/lib/apr/lib apr_snprintf.c
   src/lib/apr/network_io/unix networkio.h sockaddr.c
  Log:
  Convert HAVE_NETINET... to the APR mac
  
  Revision  ChangesPath
  1.18  +1 -1  apache-2.0/src/acinclude.m4
  
  Index: acinclude.m4
  ===
  RCS file: /export/home/cvs/apache-2.0/src/acinclude.m4,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- acinclude.m4  2000/01/16 20:00:46 1.17
  +++ acinclude.m4  2000/01/20 22:14:05 1.18
  @@ -157,7 +157,7 @@
   #ifdef HAVE_SYS_SOCKET_H
   #include 
   #endif
  -#ifdef HAVE_NETINET_IN_H
  +#if APR_HAVE_NETINET_IN_H
   #include 
   #endif
   #ifdef HAVE_ARPA_INET_H
  
  
  
  1.6   +1 -1  apache-2.0/src/include/ap_ac_config.h
  
  Index: ap_ac_config.h
  ===
  RCS file: /export/home/cvs/apache-2.0/src/include/ap_ac_config.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ap_ac_config.h2000/01/19 01:14:26 1.5
  +++ ap_ac_config.h2000/01/20 22:14:12 1.6
  @@ -105,7 +105,7 @@
   #include 
   #endif
   
  -#ifdef HAVE_NETINET_IN_H
  +#if APR_HAVE_NETINET_IN_H
   #include 
   #endif
   
  
  
  
  1.21  +2 -0  apache-2.0/src/include/httpd.h
  
  Index: httpd.h
  ===
  RCS file: /export/home/cvs/apache-2.0/src/include/httpd.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- httpd.h   2000/01/19 02:41:49 1.20
  +++ httpd.h   2000/01/20 22:14:15 1.21
  @@ -81,7 +81,9 @@
   #include "ap.h"
   #include "ap_mmn.h"
   
  +#if APR_HAVE_NETINET_IN_H
   #include 
  +#endif
   
   #ifdef CORE_PRIVATE
   
  
  
  
  1.8   +1 -1  apache-2.0/src/lib/apr/lib/apr_snprintf.c
  
  Index: apr_snprintf.c
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/lib/apr_snprintf.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- apr_snprintf.c1999/12/14 15:28:22 1.7
  +++ apr_snprintf.c2000/01/20 22:14:23 1.8
  @@ -70,7 +70,7 @@
   #ifdef HAVE_CTYPE_H
   #include 
   #endif
  -#ifdef HAVE_NETINET_IN_H
  +#if APR_HAVE_NETINET_IN_H
   #include 
   #endif
   #ifdef HAVE_SYS_SOCKET_H
  
  
  
  1.14  +1 -1  apache-2.0/src/lib/apr/network_io/unix/networkio.h
  
  Index: networkio.h
  ===
  RCS file: 
/export/home/cvs/apache-2.0/src/lib/apr/network_io/unix/networkio.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- networkio.h   1999/12/29 23:56:24 1.13
  +++ networkio.h   2000/01/20 22:14:30 1.14
  @@ -86,7 +86,7 @@
   #if HAVE_NETINET_TCP_H
   #include 
   #endif
  -#if HAVE_NETINET_IN_H
  +#if APR_HAVE_NETINET_IN_H
   #include 
   #endif
   #if HAVE_ARPA_INET_H
  
  
  
  1.3   +1 -1  apache-2.0/src/lib/apr/network_io/unix/sockaddr.c
  
  Index: sockaddr.c
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockaddr.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sockaddr.c1999/12/03 15:18:34 1.2
  +++ sockaddr.c2000/01/20 22:14:33 1.3
  @@ -203,7 +203,7 @@
   
   
   
  -#if HAVE_NETINET_IN_H
  +#if APR_HAVE_NETINET_IN_H
   /* ***APRDOC
* ap_status_t ap_get_local_name(struct sockaddr_in **name, const 
ap_socket_t *socket)
*Return the local socket name as a BSD style struct sockaddr_in.
  
  
  


cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h

1999-12-29 Thread sascha
sascha  99/12/29 15:56:25

  Modified:src/lib/apr/network_io/unix networkio.h
  Log:
  Use correct data type for socket address length.
  
  Revision  ChangesPath
  1.13  +1 -1  apache-2.0/src/lib/apr/network_io/unix/networkio.h
  
  Index: networkio.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/networkio.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -u -r1.12 -r1.13
  --- networkio.h   1999/12/14 18:11:08 1.12
  +++ networkio.h   1999/12/29 23:56:24 1.13
  @@ -111,7 +111,7 @@
   int socketdes;
   struct sockaddr_in *local_addr;
   struct sockaddr_in *remote_addr;
  -size_t addr_len;
  +socklen_t addr_len;
   int timeout; 
   #ifndef HAVE_POLL
   int connected;
  
  
  


cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h

1999-12-14 Thread rbb
rbb 99/12/14 10:11:09

  Modified:src/lib/apr configure.in
   src/lib/apr/network_io/unix networkio.h
  Log:
  Fix some warnings when compiling with -Wall
  
  Revision  ChangesPath
  1.35  +1 -0  apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- configure.in  1999/12/06 18:58:18 1.34
  +++ configure.in  1999/12/14 18:11:06 1.35
  @@ -256,6 +256,7 @@
   AC_CHECK_HEADERS(sys/param.h)
   AC_CHECK_HEADERS(sys/resource.h)
   AC_CHECK_HEADERS(sys/select.h)
  +AC_CHECK_HEADERS(sys/sendfile.h)
   AC_CHECK_HEADERS(sys/signal.h)
   AC_CHECK_HEADERS(sys/socket.h)
   AC_CHECK_HEADERS(sys/stat.h)
  
  
  
  1.12  +3 -0  apache-2.0/src/lib/apr/network_io/unix/networkio.h
  
  Index: networkio.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/networkio.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- networkio.h   1999/12/04 21:48:34 1.11
  +++ networkio.h   1999/12/14 18:11:08 1.12
  @@ -101,6 +101,9 @@
   #if HAVE_FCNTL_H
   #include 
   #endif
  +#if HAVE_SYS_SENDFILE_H
  +#include 
  +#endif
   /* End System Headers */
   
   struct socket_t {
  
  
  


cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h sendrecv.c

1999-12-04 Thread rbb
rbb 99/12/04 13:48:35

  Modified:src/lib/apr acconfig.h configure.in
   src/lib/apr/include apr.h.in apr_network_io.h
   src/lib/apr/network_io/unix networkio.h sendrecv.c
  Log:
  Add Sendfile to APR.  This is not well tested, and a test case is needed.
  I did some minor cleanup work, mainly to integrate sendfile into the APR
  autoconf stuff.
  Submitted by: John Zedlewski
  Reviewed by:Ryan Bloom
  
  Revision  ChangesPath
  1.15  +1 -0  apache-2.0/src/lib/apr/acconfig.h
  
  Index: acconfig.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/acconfig.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- acconfig.h1999/12/01 18:38:55 1.14
  +++ acconfig.h1999/12/04 21:48:30 1.15
  @@ -46,6 +46,7 @@
   
   #undef SIZEOF_SSIZE_T
   #undef APR_HAS_THREADS
  +#undef APR_HAS_SENDFILE
   
   @BOTTOM@
   
  
  
  
  1.31  +3 -0  apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- configure.in  1999/12/01 20:35:16 1.30
  +++ configure.in  1999/12/04 21:48:31 1.31
  @@ -215,6 +215,7 @@
   
   AC_CHECK_HEADERS(arpa/inet.h)
   AC_CHECK_HEADERS(netinet/in.h, netinet_inh="1", netinet_inh="0")
  +AC_CHECK_HEADERS(netinet/tcp.h)
   
   AC_CHECK_HEADERS(sys/file.h)
   AC_CHECK_HEADERS(sys/ioctl.h)
  @@ -261,8 +262,10 @@
   AC_CHECK_FUNCS(pthread_sigmask)
   AC_CHECK_FUNCS(strcasecmp stricmp poll setsid)
   AC_CHECK_FUNCS(sigaction writev)
  +AC_CHECK_FUNCS(sendfile, [ sendfile="#define APR_HAS_SENDFILE 1" ], [ 
sendfile="APR_HAS_SENDFILE 0" ]) 
   AC_CHECK_FUNCS(getpass)
   AC_CHECK_FUNC(_getch)
  +AC_SUBST(sendfile)
   
   AC_CHECK_FUNCS(gmtime_r localtime_r)
   
  
  
  
  1.4   +1 -0  apache-2.0/src/lib/apr/include/apr.h.in
  
  Index: apr.h.in
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.h.in,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr.h.in  1999/12/01 20:35:20 1.3
  +++ apr.h.in  1999/12/04 21:48:33 1.4
  @@ -18,6 +18,7 @@
   
   /*  APR Feature Macros */
   @threads@
  [EMAIL PROTECTED]@
   @mmap@
   
   /* Typedefs that APR needs. */
  
  
  
  1.18  +16 -0 apache-2.0/src/lib/apr/include/apr_network_io.h
  
  Index: apr_network_io.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_network_io.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- apr_network_io.h  1999/12/01 20:35:37 1.17
  +++ apr_network_io.h  1999/12/04 21:48:33 1.18
  @@ -61,6 +61,7 @@
   #endif
   
   #include "apr_general.h"
  +#include "apr_file_io.h"
   #include "apr_errno.h"
   #if APR_HAVE_NETINET_IN_H
   #include 
  @@ -103,7 +104,18 @@
   
   typedef struct socket_t ap_socket_t;
   typedef struct pollfd_tap_pollfd_t;
  +typedef struct hdtr_tap_hdtr_t;
   
  +#ifdef APR_HAS_SENDFILE
  +/* A structure to encapsulate headers and trailers for ap_sendfile */
  +struct hdtr_t {
  +struct iovec* headers;
  +int numheaders;
  +struct iovec* trailers;
  +int numtrailers;
  +};
  +#endif
  +
   /* function definitions */
   
   ap_status_t ap_create_tcp_socket(ap_socket_t **, ap_context_t *);
  @@ -123,6 +135,10 @@
   
   ap_status_t ap_send(ap_socket_t *, const char *, ap_ssize_t *);
   ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, ap_int32_t 
nvec, ap_int32_t *nbytes);
  +#ifdef HAVE_SENDFILE
  +ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, 
ap_off_t *offset, 
  + ap_size_t *len, ap_int32_t flags);
  +#endif
   ap_status_t ap_recv(ap_socket_t *, char *, ap_ssize_t *);
   
   ap_status_t ap_setsocketopt(ap_socket_t *, ap_int32_t, ap_int32_t);
  
  
  
  1.11  +6 -0  apache-2.0/src/lib/apr/network_io/unix/networkio.h
  
  Index: networkio.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/networkio.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- networkio.h   1999/12/03 15:18:33 1.10
  +++ networkio.h   1999/12/04 21:48:34 1.11
  @@ -62,6 +62,12 @@
   #include "apr_lib.h"
   
   /* System headers the network I/O library needs */
  +#if HAVE_SYS_TYPES_H
  +#include 
  +#endif
  +#if HAVE_SYS_UIO_H
  +#include 
  +#endif
   #if HAVE_POLL_H
   #include 
   #endif
  
  
  
  1.8   +380 -0apache-2.0/src/lib/apr/network_io/unix/sendrecv.c
  
  Index: sendrecv.c
  ===

cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h poll.c

1999-12-01 Thread rbb
rbb 99/12/01 10:39:45

  Modified:src/lib/apr acconfig.h configure.in
   src/lib/apr/file_io/unix fileio.h readwrite.c
   src/lib/apr/include apr.h.in apr_errno.h apr_file_io.h
apr_fnmatch.h apr_general.h apr_lib.h apr_md5.h
apr_network_io.h apr_pools.h apr_portable.h
apr_thread_proc.h
   src/lib/apr/lib apr_cpystrn.c apr_getpass.c apr_pools.c
apr_signal.c apr_snprintf.c
   src/lib/apr/locks/unix locks.c
   src/lib/apr/network_io/unix networkio.h poll.c
  Log:
  The next step in removing the APR HAVE_*_H leak.  This removes all of those
  checks from the public include files, and removes all unnecessary #include
  of system headers from public APR headers.  The final step will add back in
  the checks once I can protect the namespace.
  
  Revision  ChangesPath
  1.14  +0 -3  apache-2.0/src/lib/apr/acconfig.h
  
  Index: acconfig.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/acconfig.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- acconfig.h1999/11/17 18:09:55 1.13
  +++ acconfig.h1999/12/01 18:38:55 1.14
  @@ -48,9 +48,6 @@
   #undef APR_HAS_THREADS
   
   @BOTTOM@
  -#define API_EXPORT(type) type
  -#define API_EXPORT_NONSTD(type) type
  -#define API_VAR_IMPORT extern
   
   /* Make sure we have ssize_t defined to be somethine */
   #undef ssize_t
  
  
  
  1.29  +38 -5 apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- configure.in  1999/11/30 18:45:50 1.28
  +++ configure.in  1999/12/01 18:39:02 1.29
  @@ -79,6 +79,26 @@
   AC_SUBST(int_value)
   AC_SUBST(long_value)
   
  +if test "$ac_cv_type_off_t" = "yes"; then
  +off_t_value="off_t"
  +else
  +off_t_value="ap_int32_t"
  +fi
  +if test "$ac_cv_type_size_t" = "yes"; then
  +size_t_value="size_t"
  +else
  +size_t_value="ap_int32_t"
  +fi
  +if test "$ac_cv_type_ssize_t" = "yes"; then
  +ssize_t_value="ssize_t"
  +else
  +ssize_t_value="ap_int32_t"
  +fi
  +
  +AC_SUBST(off_t_value)
  +AC_SUBST(size_t_value)
  +AC_SUBST(ssize_t_value)
  +
   AC_CHECK_SIZEOF_EXTENDED([#include ], ssize_t, 8)
   
   # Use /bin/sh if it exists, otherwise go looking for sh in the path
  @@ -216,6 +236,14 @@
   AC_FUNC_MMAP
   AC_FUNC_SETPGRP
   
  +if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then 
  +mmap="#define APR_HAS_MMAP 1"
  +AC_SUBST(mmap)
  +else
  +mmap="#define APR_HAS_MMAP 0"
  +AC_SUBST(mmap)
  +fi
  +
   AC_MSG_CHECKING(looking for union semun in sys/sem.h)
   AC_TRY_COMPILE([
   #include 
  @@ -243,13 +271,16 @@
   [  --enable-threads  Enable threading support in APR.],
   [
 if test "$enableval" = "no"; then 
  -AC_DEFINE(APR_HAS_THREADS, 0)
  +threads="#define APR_HAS_THREADS 0"
  +AC_SUBST(threads)
   AC_MSG_RESULT(no)
 else
   if test "$enableval" = "pthread"; then
 AC_CHECK_HEADERS(pthread.h, [ 
  -  AC_DEFINE(APR_HAS_THREADS, 1) ], [ 
  -  AC_DEFINE(APR_HAS_THREADS, 0) ] )
  +  threads="#define APR_HAS_THREADS 1"
  +  AC_SUBST(threads) ], [
  +  threads="#define APR_HAS_THREADS 0"
  +  AC_SUBST(threads) ] )
 AC_MSG_RESULT(yes)
   else
 AC_MSG_RESULT(no)
  @@ -258,8 +289,10 @@
   ],
   [
 AC_CHECK_HEADERS(pthread.h, [
  -  AC_DEFINE(APR_HAS_THREADS, 1) ], [ 
  -  AC_DEFINE(APR_HAS_THREADS, 0) ] )
  +  threads="#define APR_HAS_THREADS 1"
  +  AC_SUBST(threads) ], [
  +  threads="#define APR_HAS_THREADS 0"
  +  AC_SUBST(threads) ] )
   ]) 
   
   
  
  
  
  1.5   +1 -0  apache-2.0/src/lib/apr/file_io/unix/fileio.h
  
  Index: fileio.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/fileio.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- fileio.h  1999/11/10 15:49:53 1.4
  +++ fileio.h  1999/12/01 18:39:08 1.5
  @@ -62,6 +62,7 @@
   #include 
   #include 
   #include 
  +#include 
   #include "apr_general.h"
   #include "apr_file_io.h"
   #include "apr_errno.h"
  
  
  
  1.17  +1 -0  apache-2.0/src/lib/apr/file_io/unix/readwrite.c
  
  Index: readwrite.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/readwrite.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- readwrite.c   1999/11/10 15:49:53 1.16
  +++ readwrite.c   1999/12/01 18:39:09 

cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h sockets.c sockopt.c

1999-10-16 Thread rbb
rbb 99/10/16 07:07:01

  Modified:src/lib/apr/file_io/unix dir.c
   src/lib/apr/inc apr_macro.h
   src/lib/apr/network_io/unix networkio.h sockets.c sockopt.c
  Log:
  Put mutex's around non-thread-safe functions in APR.
  
  Revision  ChangesPath
  1.9   +10 -6 apache-2.0/src/lib/apr/file_io/unix/dir.c
  
  Index: dir.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/dir.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- dir.c 1999/10/12 06:14:42 1.8
  +++ dir.c 1999/10/16 14:06:58 1.9
  @@ -58,11 +58,15 @@
   #include 
   #include 
   #include 
  +#include "apr_macro.h"
   #include "fileio.h"
   #include "apr_file_io.h"
   #include "apr_lib.h"
  +#include "apr_lock.h"
   #include "apr_portable.h"
   
  +static ap_lock_t *lock_readdir = NULL;
  +
   static ap_status_t dir_cleanup(void *thedir)
   {
   struct dir_t *dir = thedir;
  @@ -88,7 +92,7 @@
   (*new)->cntxt = cont;
   (*new)->dirname = strdup(dirname);
   (*new)->dirstruct = opendir(dirname);
  -(*new)->entry = NULL;
  +(*new)->entry = ap_pcalloc(cont, sizeof(struct dirent));
   
   if ((*new)->dirstruct == NULL) {
   return errno;
  @@ -124,11 +128,11 @@
*/
   ap_status_t ap_readdir(struct dir_t *thedir)
   {
  -thedir->entry = readdir(thedir->dirstruct);
  -if (thedir->entry == NULL) {
  -return errno;
  -}
  -return APR_SUCCESS;
  +ap_status_t status;
  +SAFETY_LOCK(readdir, "readdir_file");
  +READDIR(thedir->dirstruct, thedir->entry, status);
  +SAFETY_UNLOCK(readdir);
  +return status;
   }
   
   /* ***APRDOC
  
  
  
  1.3   +55 -7 apache-2.0/src/lib/apr/inc/apr_macro.h
  
  Index: apr_macro.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/inc/apr_macro.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_macro.h   1999/10/16 12:47:59 1.2
  +++ apr_macro.h   1999/10/16 14:06:59 1.3
  @@ -62,18 +62,20 @@
   extern "C" {
   #endif
   
  +#include "apr_config.h"
  +
   #ifndef _POSIX_THREAD_SAFE_FUNCTIONS
  -#define SAFETY_LOCK(func_name, name_str) \
  +#define SAFETY_LOCK(funcname, namestr) \
   { \
   if (lock_##func_name == NULL) \
   if (ap_create_lock(&lock_##func_name, APR_MUTEX, APR_INTRAPROCESS, \
   name_str, NULL) != APR_SUCCESS) \
   return APR_NOTTHREADSAFE; \
  -if (ap_lock(lock_##func_name) != APR_SUCCESS) \
  +if (ap_lock(lock_##funcname) != APR_SUCCESS) \
   return APR_NOTTHREADSAFE; \
   }
   #else
  -#define SAFETY_LOCK(func_name, name_str)
  +#define SAFETY_LOCK(funcname, namestr)
   #endif
   
   #ifndef _POSIX_THREAD_SAFE_FUNCTIONS
  @@ -86,15 +88,61 @@
   #endif
   
   #ifdef HAVE_GMTIME_R
  -#define GMTIME_R(x, y) gmtime_r(x, y)
  +#define GMTIME_R(x, y) gmtime_r(x, y);
   #else
  -#define GMTIME_R(x, y) memcpy(y, gmtime(x), sizeof(y))
  +#define GMTIME_R(x, y) memcpy(y, gmtime(x), sizeof(y));
   #endif
   
   #ifdef HAVE_LOCALTIME_R
  -#define LOCALTIME_R(x, y) localtime_r(x, y)
  +#define LOCALTIME_R(x, y) localtime_r(x, y);
  +#else
  +#define LOCALTIME_R(x, y) memcpy(y, localtime(x), sizeof(y));
  +#endif
  +
  +#ifdef _POSIX_THREAD_SAFE_FUNCTIONS 
  +#define GETHOSTBYNAME(x, y, z) z = gethostbyname(x);
  +#else
  +#define GETHOSTBYNAME(x, y, z) \
  +y = gethostbyname(x); \
  +z = ap_palloc(NULL, sizeof(struct hostent)); \
  +memcpy(z, y, sizeof(struct hostent));
  +#endif
  +
  +#ifdef _POSIX_THREAD_SAFE_FUNCTIONS 
  +#define GETHOSTBYADDR(x, y, z) z = gethostbyaddr(x, sizeof(struct in_addr), 
AF_INET);
  +#else
  +#define GETHOSTBYADDR(x, y, z) \
  +y = gethostbyaddr(x, sizeof(struct in_addr), AF_INET); \
  +z = ap_palloc(NULL, sizeof(struct hostent)); \
  +memcpy(z, y, sizeof(struct hostent));
  +#endif
  +
  +#ifdef _POSIX_THREAD_SAFE_FUNCTIONS 
  +#define INET_NTOA(x, y, len) ap_cpystrn(y, inet_ntoa(x), len);
  +#else
  +#define INET_NTOA(x, y, len) ap_cpystrn(y, inet_ntoa(x), len);
  +#endif
  +
  +#ifdef _POSIX_THREAD_SAFE_FUNCTIONS 
  +#define READDIR(x, y, z)  y = readdir(x); \
  +   if (y == NULL) { \
  +   z = errno; \
  +   } \
  +   else { \
  +   z = APR_SUCCESS; \
  +   }
   #else
  -#define LOCALTIME_R(x, y) memcpy(y, localtime(x), sizeof(y))
  +#define READDIR(x, y, z) \
  +  { \
  +  struct dirent *temp = readdir(x); \
  +  if (temp == NULL) { \
  +  z = errno; \

cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h sockets.c sockopt.c

1999-10-08 Thread manoj
manoj   99/10/08 12:44:36

  Modified:src/lib/apr/network_io/unix networkio.h sockets.c sockopt.c
  Log:
  Every accept() was resulting in a reverse name lookup. This eliminates it.
  
  Revision  ChangesPath
  1.5   +0 -1  apache-2.0/src/lib/apr/network_io/unix/networkio.h
  
  Index: networkio.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/networkio.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -d -u -r1.4 -r1.5
  --- networkio.h   1999/10/01 16:18:34 1.4
  +++ networkio.h   1999/10/08 19:44:30 1.5
  @@ -65,7 +65,6 @@
   struct socket_t {
   ap_context_t *cntxt;
   int socketdes;
  -char *remote_hostname;
   struct sockaddr_in *addr;
   size_t addr_len;
   int timeout; 
  
  
  
  1.12  +0 -10 apache-2.0/src/lib/apr/network_io/unix/sockets.c
  
  Index: sockets.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockets.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -d -u -r1.11 -r1.12
  --- sockets.c 1999/10/04 16:37:13 1.11
  +++ sockets.c 1999/10/08 19:44:31 1.12
  @@ -100,7 +100,6 @@
   }

   (*new)->socketdes = socket(AF_INET ,SOCK_STREAM, IPPROTO_TCP);
  -(*new)->remote_hostname = NULL;
   
   (*new)->addr->sin_family = AF_INET;
   
  @@ -252,8 +251,6 @@
*/
   ap_status_t ap_accept(struct socket_t **new, const struct socket_t *sock)
   {
  -struct hostent *hptr;
  -
   (*new) = (struct socket_t *)ap_palloc(sock->cntxt, 
   sizeof(struct socket_t));
   
  @@ -269,12 +266,6 @@
   return errno;
   }
   
  -hptr = gethostbyaddr((char *)&(*new)->addr->sin_addr, 
  - sizeof(struct in_addr), AF_INET);
  -if (hptr != NULL) {
  -(*new)->remote_hostname = strdup(hptr->h_name);
  -}
  -
   ap_register_cleanup((*new)->cntxt, (void *)(*new), 
   socket_cleanup, NULL);
   return APR_SUCCESS;
  @@ -316,7 +307,6 @@
   return errno;
   }
   else {
  -sock->remote_hostname = strdup(hostname);
   return APR_SUCCESS;
   }
   }
  
  
  
  1.6   +14 -4 apache-2.0/src/lib/apr/network_io/unix/sockopt.c
  
  Index: sockopt.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockopt.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -d -u -r1.5 -r1.6
  --- sockopt.c 1999/10/04 16:37:13 1.5
  +++ sockopt.c 1999/10/08 19:44:32 1.6
  @@ -64,6 +64,8 @@
   #include 
   #include 
   #include 
  +#include 
  +#include 
   
   static ap_status_t soblock(int sd)
   {
  @@ -201,11 +203,19 @@
*/
   ap_status_t ap_get_remote_hostname(char **name, struct socket_t *sock)
   {
  -(*name) = ap_pstrdup(sock->cntxt, sock->remote_hostname);
  -if (*name) {
  -return APR_SUCCESS;
  +struct hostent *hptr;
  +
  +hptr = gethostbyaddr((char *)&(sock->addr->sin_addr), 
  + sizeof(struct in_addr), AF_INET);
  +if (hptr != NULL) {
  +*name = ap_pstrdup(sock->cntxt, hptr->h_name);
  +if (*name) {
  +return APR_SUCCESS;
  +}
  +return APR_ENOMEM;
   }
  -return APR_ENOMEM;
  +
  +return errno;
   }
   
   
  
  
  


cvs commit: apache-2.0/src/lib/apr/network_io/unix networkio.h sendrecv.c sockopt.c

1999-09-03 Thread rbb
rbb 99/09/03 07:20:24

  Modified:src/lib/apr configure
   src/lib/apr/include apr_network_io.h
   src/lib/apr/network_io/unix networkio.h sendrecv.c sockopt.c
  Log:
  Fix the timeout code in APR.  This is now done properly, by setting a field
  in the socket structure.  If we need this in files, we'll do the same thing
  there.
  
  Revision  ChangesPath
  1.5   +548 -186  apache-2.0/src/lib/apr/configure
  
  Index: configure
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/configure,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- configure 1999/08/19 13:31:08 1.4
  +++ configure 1999/09/03 14:20:17 1.5
  @@ -1882,6 +1882,11 @@
   
   
   case "$OS" in
  +   *-os2*)
  +   CFLAGS="$CFLAGS -DOS2"
  +   OSDIR="os2"
  +   LIBPREFIX=""
  +   ;;
  *beos*)
  OSDIR="beos"
  ;;
  @@ -1891,7 +1896,7 @@
   esac
   
   echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
  -echo "configure:1895: checking for dlopen in -ldl" >&5
  +echo "configure:1900: checking for dlopen in -ldl" >&5
   ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
   if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
 echo $ac_n "(cached) $ac_c" 1>&6
  @@ -1899,7 +1904,7 @@
 ac_save_LIBS="$LIBS"
   LIBS="-ldl  $LIBS"
   cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
  +if { (eval echo configure:1919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
 rm -rf conftest*
 eval "ac_cv_lib_$ac_lib_var=yes"
   else
  @@ -1938,7 +1943,7 @@
   fi
   
   echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6
  -echo "configure:1942: checking for pthread_mutex_init in -lpthread" >&5
  +echo "configure:1947: checking for pthread_mutex_init in -lpthread" >&5
   ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
   if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
 echo $ac_n "(cached) $ac_c" 1>&6
  @@ -1946,7 +1951,7 @@
 ac_save_LIBS="$LIBS"
   LIBS="-lpthread  $LIBS"
   cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
  +if { (eval echo configure:1966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
 rm -rf conftest*
 eval "ac_cv_lib_$ac_lib_var=yes"
   else
  @@ -1984,7 +1989,101 @@
 echo "$ac_t""no" 1>&6
   fi
   
  +echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
  +echo "configure:1994: checking for socket in -lsocket" >&5
  +ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
  +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  +  echo $ac_n "(cached) $ac_c" 1>&6
  +else
  +  ac_save_LIBS="$LIBS"
  +LIBS="-lsocket  $LIBS"
  +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
  +  rm -rf conftest*
  +  eval "ac_cv_lib_$ac_lib_var=yes"
  +else
  +  echo "configure: failed program was:" >&5
  +  cat conftest.$ac_ext >&5
  +  rm -rf conftest*
  +  eval "ac_cv_lib_$ac_lib_var=no"
  +fi
  +rm -f conftest*
  +LIBS="$ac_save_LIBS"
  +
  +fi
  +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  +  echo "$ac_t""yes" 1>&6
  +ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  +-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  +  cat >> confdefs.h <&6
  +fi
  +
  +echo $ac_n "checking for crypt in -lufc""... $ac_c" 1>&6
  +echo "configure:2041: checking for crypt in -lufc" >&5
  +ac_lib_var=`echo ufc'_'crypt | sed 'y%./+-%__p_%'`
  +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  +  echo $ac_n "(cached) $ac_c" 1>&6
  +else
  +  ac_save_LIBS="$LIBS"
  +LIBS="-lufc  $LIBS"
  +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } 
&& test -s conftest${ac_exeext}; then
  +  rm -rf conftest*
  +  eval "ac_cv_lib_$ac_lib_var=yes"
  +else
  +  echo "configure: failed program was:" >&5
  +  cat conftest.$ac_ext >&5
  +  rm -rf conftest*
  +  eval "ac_cv_lib_$ac_lib_var=no"
  +fi
  +rm -f conftest*
  +LIBS="$ac_save_LIBS"
  +
  +fi
  +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  +  echo "$ac_t""yes" 1>&6
  +ac_tr_lib=HAVE_LIB`echo ufc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  +-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  +  cat >> confdefs.h <&6
  +fi
  +
  +
   if (test "$SYS_SW" = "AIX"); then
   CFLAGS="$CFLAGS -U__STR__"
   case "$SYS_KV" in
  @@ -2014,12 +2113,12 @@
   fi
   
   echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
  -echo "configure:2018: checking for ANSI C header files" >&5
  +echo "configure:2117: checking for ANSI C header files" >&5
   if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
 echo $ac_n "(cached) $ac_c" 1>&6
   else
 cat > conftest.$ac_ext <