httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/modules/ssl mod_ssl.h ssl_engine_config.c ssl_engine_init.c ssl_engine_io.c ssl_engine_kernel.c ssl_engine_mutex.c ssl_util.c
Date Sat, 05 May 2001 16:35:20 GMT
rse         01/05/05 09:35:20

  Modified:    modules/ssl mod_ssl.h ssl_engine_config.c ssl_engine_init.c
                        ssl_engine_io.c ssl_engine_kernel.c
                        ssl_engine_mutex.c ssl_util.c
  Log:
  Axe most WIN32 stuff from Apache 1.3. In Apache 2.0 we either use APR
  later for this or we don't do it at all. But we certainly no longer want
  to see any platform specific things inside a module.
  
  Revision  Changes    Path
  1.9       +1 -25     httpd-2.0/modules/ssl/mod_ssl.h
  
  Index: mod_ssl.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/mod_ssl.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mod_ssl.h	2001/05/05 16:22:59	1.8
  +++ mod_ssl.h	2001/05/05 16:35:17	1.9
  @@ -97,13 +97,7 @@
   #include <sys/types.h>
   #include <sys/stat.h>
   #include <time.h>
  -#ifndef WIN32
   #include <sys/time.h>
  -#endif
  -#ifdef WIN32
  -#include <wincrypt.h>
  -#include <winsock2.h>
  -#endif
   
   /* OpenSSL headers */
   #include <openssl/ssl.h>
  @@ -257,7 +251,7 @@
   #endif
   #if !defined(SSL_USE_FCNTL) && !defined(SSL_USE_FLOCK)
   #define SSL_USE_FLOCK 1
  -#if !defined(MPE) && !defined(WIN32)
  +#if !defined(MPE)
   #include <sys/file.h>
   #endif
   #ifndef LOCK_UN
  @@ -275,11 +269,7 @@
   /*
    * Support for Mutex
    */
  -#ifndef WIN32
   #define SSL_MUTEX_LOCK_MODE ( S_IRUSR|S_IWUSR )
  -#else
  -#define SSL_MUTEX_LOCK_MODE (_S_IREAD|_S_IWRITE )
  -#endif
   #if defined(USE_SYSVSEM_SERIALIZED_ACCEPT) ||\
       (defined(__FreeBSD__) && defined(__FreeBSD_version) &&\
        __FreeBSD_version >= 300000) ||\
  @@ -305,30 +295,16 @@
       unsigned short int *array;
   };
   #endif
  -#ifdef WIN32
  -#define SSL_CAN_USE_SEM
  -#define SSL_HAVE_W32SEM
  -#include "multithread.h"
  -#include <process.h>
  -#endif
   
   /*
    * Support for MM library
    */
  -#ifndef WIN32
   #define SSL_MM_FILE_MODE ( S_IRUSR|S_IWUSR )
  -#else
  -#define SSL_MM_FILE_MODE ( _S_IREAD|_S_IWRITE )
  -#endif
   
   /*
    * Support for DBM library
    */
  -#ifndef WIN32
   #define SSL_DBM_FILE_MODE ( S_IRUSR|S_IWUSR )
  -#else
  -#define SSL_DBM_FILE_MODE ( _S_IREAD|_S_IWRITE )
  -#endif
   
   #if !defined(SSL_DBM_FILE_SUFFIX_DIR) && !defined(SSL_DBM_FILE_SUFFIX_PAG)
   #if defined(DBM_SUFFIX)
  
  
  
  1.8       +0 -4      httpd-2.0/modules/ssl/ssl_engine_config.c
  
  Index: ssl_engine_config.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_config.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ssl_engine_config.c	2001/05/05 16:02:33	1.7
  +++ ssl_engine_config.c	2001/05/05 16:35:17	1.8
  @@ -342,14 +342,10 @@
           mc->nMutexMode  = SSL_MUTEXMODE_NONE;
       }
       else if (strlen(arg) > 5 && strcEQn(arg, "file:", 5)) {
  -#ifndef WIN32
           mc->nMutexMode  = SSL_MUTEXMODE_FILE;
           mc->szMutexFile = ap_psprintf(mc->pPool, "%s.%lu",
                                         ap_server_root_relative(cmd->pool, "mutex", arg+5),
                                         (unsigned long)getpid());
  -#else
  -        return "SSLMutex: Lockfiles not available on this platform";
  -#endif
       }
       else if (strcEQ(arg, "sem")) {
   #ifdef SSL_CAN_USE_SEM
  
  
  
  1.5       +0 -7      httpd-2.0/modules/ssl/ssl_engine_init.c
  
  Index: ssl_engine_init.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_init.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ssl_engine_init.c	2001/05/05 15:02:13	1.4
  +++ ssl_engine_init.c	2001/05/05 16:35:17	1.5
  @@ -127,11 +127,6 @@
                   SERVER_BASEVERSION,
                   ssl_var_lookup(p, NULL, NULL, NULL, "SSL_VERSION_INTERFACE"),
                   ssl_var_lookup(p, NULL, NULL, NULL, "SSL_VERSION_LIBRARY"));
  -#ifdef WIN32
  -        ssl_log(s, SSL_LOG_WARN, "You are using mod_ssl under Win32. " 
  -                "This combination is *NOT* officially supported. "
  -                "Use it at your own risk!");
  -#endif
       }
   
       /*
  @@ -194,9 +189,7 @@
       if (mc->nInitCount == 1) {
           ssl_pphrase_Handle(s, p);
           ssl_init_TmpKeysHandle(SSL_TKP_GEN, s, p);
  -#ifndef WIN32
           return;
  -#endif
       }
   
       /*
  
  
  
  1.5       +0 -175    httpd-2.0/modules/ssl/ssl_engine_io.c
  
  Index: ssl_engine_io.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_io.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ssl_engine_io.c	2001/05/05 16:23:00	1.4
  +++ ssl_engine_io.c	2001/05/05 16:35:17	1.5
  @@ -80,10 +80,6 @@
   #ifndef NO_WRITEV
   static int ssl_io_hook_writev(BUFF *fb, const struct iovec *iov, int iovcnt);
   #endif
  -#ifdef WIN32
  -static int ssl_io_hook_recvwithtimeout(BUFF *fb, char *buf, int len);
  -static int ssl_io_hook_sendwithtimeout(BUFF *fb, const char *buf, int len);
  -#endif /* WIN32 */
   
   void ssl_io_register(void)
   {
  @@ -92,12 +88,6 @@
   #ifndef NO_WRITEV
       ap_hook_register("ap::buff::writev", ssl_io_hook_writev, AP_HOOK_NOCTX);
   #endif
  -#ifdef WIN32
  -    ap_hook_register("ap::buff::recvwithtimeout",
  -                     ssl_io_hook_recvwithtimeout, AP_HOOK_NOCTX);
  -    ap_hook_register("ap::buff::sendwithtimeout",
  -                     ssl_io_hook_sendwithtimeout, AP_HOOK_NOCTX);
  -#endif
       return;
   }
   
  @@ -108,10 +98,6 @@
   #ifndef NO_WRITEV
       ap_hook_unregister("ap::buff::writev", ssl_io_hook_writev);
   #endif
  -#ifdef WIN32
  -    ap_hook_unregister("ap::buff::recvwithtimeout", ssl_io_hook_recvwithtimeout);
  -    ap_hook_unregister("ap::buff::sendwithtimeout", ssl_io_hook_sendwithtimeout);
  -#endif
       return;
   }
   
  @@ -218,172 +204,11 @@
   }
   #endif
   
  -#ifdef WIN32
  -
  -/* these two functions are exported from buff.c under WIN32 */
  -API_EXPORT(int) sendwithtimeout(int sock, const char *buf, int len, int flags);
  -API_EXPORT(int) recvwithtimeout(int sock, char *buf, int len, int flags);
  -
  -/* and the prototypes for our SSL_xxx variants */
  -static int SSL_sendwithtimeout(BUFF *fb, const char *buf, int len);
  -static int SSL_recvwithtimeout(BUFF *fb, char *buf, int len);
  -
  -static int ssl_io_hook_recvwithtimeout(BUFF *fb, char *buf, int len)
  -{
  -    SSL *ssl;
  -    int rc;
  -
  -    if ((ssl = ap_ctx_get(fb->ctx, "ssl")) != NULL)
  -        rc = SSL_recvwithtimeout(fb, buf, len);
  -    else
  -        rc = recvwithtimeout(fb->fd, buf, len, 0);
  -    return rc;
  -}
  -
  -static int ssl_io_hook_sendwithtimeout(BUFF *fb, const char *buf, int len)
  -{
  -    SSL *ssl;
  -    int rc;
  -
  -    if ((ssl = ap_ctx_get(fb->ctx, "ssl")) != NULL)
  -        rc = SSL_sendwithtimeout(fb, buf, len);
  -    else
  -        rc = sendwithtimeout(fb->fd, buf, len, 0);
  -    return rc;
  -}
  -
  -#endif /* WIN32 */
  -
   /*  _________________________________________________________________
   **
   **  Special Functions for OpenSSL
   **  _________________________________________________________________
   */
  -
  -#ifdef WIN32
  -
  -static int SSL_sendwithtimeout(BUFF *fb, const char *buf, int len)
  -{
  -    int iostate = 1;
  -    fd_set fdset;
  -    struct timeval tv;
  -    int err = WSAEWOULDBLOCK;
  -    int rv;
  -    int retry;
  -    int sock = fb->fd;
  -    SSL *ssl;
  -
  -    ssl = ap_ctx_get(fb->ctx, "ssl");
  -
  -    if (!(tv.tv_sec = ap_check_alarm()))
  -        return (SSL_write(ssl, (char*)buf, len));
  -
  -    rv = ioctlsocket(sock, FIONBIO, &iostate);
  -    iostate = 0;
  -    if (rv) {
  -        err = WSAGetLastError();
  -        ap_assert(0);
  -    }
  -    rv = SSL_write(ssl, (char*)buf, len);
  -    if (rv <= 0) {
  -        if (BIO_sock_should_retry(rv)) {
  -            do {
  -                retry = 0;
  -                FD_ZERO(&fdset);
  -                FD_SET((unsigned int)sock, &fdset);
  -                tv.tv_usec = 0;
  -                rv = select(FD_SETSIZE, NULL, &fdset, NULL, &tv);
  -                if (rv == SOCKET_ERROR)
  -                    err = WSAGetLastError();
  -                else if (rv == 0) {
  -                    ioctlsocket(sock, FIONBIO, &iostate);
  -                    if(ap_check_alarm() < 0) {
  -                        WSASetLastError(EINTR); /* Simulate an alarm() */
  -                        return (SOCKET_ERROR);
  -                    }
  -                }
  -                else {
  -                    rv = SSL_write(ssl, (char*)buf, len);
  -                    if (BIO_sock_should_retry(rv)) {
  -                        ap_log_error(APLOG_MARK,APLOG_DEBUG, NULL,
  -                                     "select claimed we could write, "
  -                                     "but in fact we couldn't. "
  -                                     "This is a bug in Windows.");
  -                        retry = 1;
  -                        Sleep(100);
  -                    }
  -                }
  -            } while(retry);
  -        }
  -    }
  -    ioctlsocket(sock, FIONBIO, &iostate);
  -    if (rv == SOCKET_ERROR)
  -        WSASetLastError(err);
  -    return (rv);
  -}
  -
  -static int SSL_recvwithtimeout(BUFF *fb, char *buf, int len)
  -{
  -    int iostate = 1;
  -    fd_set fdset;
  -    struct timeval tv;
  -    int err = WSAEWOULDBLOCK;
  -    int rv;
  -    int sock = fb->fd_in;
  -    SSL *ssl;
  -    int retry;
  -
  -    ssl = ap_ctx_get(fb->ctx, "ssl");
  -
  -    if (!(tv.tv_sec = ap_check_alarm()))
  -        return (SSL_read(ssl, buf, len));
  -
  -    rv = ioctlsocket(sock, FIONBIO, &iostate);
  -    iostate = 0;
  -    ap_assert(!rv);
  -    rv = SSL_read(ssl, buf, len);
  -    if (rv <= 0) {
  -        if (BIO_sock_should_retry(rv)) {
  -            do {
  -                retry = 0;
  -                FD_ZERO(&fdset);
  -                FD_SET((unsigned int)sock, &fdset);
  -                tv.tv_usec = 0;
  -                rv = select(FD_SETSIZE, &fdset, NULL, NULL, &tv);
  -                if (rv == SOCKET_ERROR)
  -                    err = WSAGetLastError();
  -                else if (rv == 0) {
  -                    ioctlsocket(sock, FIONBIO, &iostate);
  -                    ap_check_alarm();
  -                    WSASetLastError(WSAEWOULDBLOCK);
  -                    return (SOCKET_ERROR);
  -                }
  -                else {
  -                    rv = SSL_read(ssl, buf, len);
  -                    if (rv == SOCKET_ERROR) {
  -                        if (BIO_sock_should_retry(rv)) {
  -                          ap_log_error(APLOG_MARK,APLOG_DEBUG, NULL,
  -                                       "select claimed we could read, "
  -                                       "but in fact we couldn't. "
  -                                       "This is a bug in Windows.");
  -                          retry = 1;
  -                          Sleep(100);
  -                        }
  -                        else {
  -                            err = WSAGetLastError();
  -                        }
  -                    }
  -                }
  -            } while(retry);
  -        }
  -    }
  -    ioctlsocket(sock, FIONBIO, &iostate);
  -    if (rv == SOCKET_ERROR)
  -        WSASetLastError(err);
  -    return (rv);
  -}
  -
  -#endif /*WIN32*/
   
   /*
    * There is no SSL_writev() provided by OpenSSL. The reason is mainly because
  
  
  
  1.7       +0 -4      httpd-2.0/modules/ssl/ssl_engine_kernel.c
  
  Index: ssl_engine_kernel.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_kernel.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ssl_engine_kernel.c	2001/05/05 16:23:00	1.6
  +++ ssl_engine_kernel.c	2001/05/05 16:35:17	1.7
  @@ -359,12 +359,8 @@
       /*
        * Improve I/O throughput by using
        * OpenSSL's read-ahead functionality
  -     * (don't used under Win32, because
  -     * there we use select())
        */
  -#ifndef WIN32
       SSL_set_read_ahead(ssl, TRUE);
  -#endif
       return;
   }
   
  
  
  
  1.4       +0 -12     httpd-2.0/modules/ssl/ssl_engine_mutex.c
  
  Index: ssl_engine_mutex.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_mutex.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ssl_engine_mutex.c	2001/05/05 10:12:04	1.3
  +++ ssl_engine_mutex.c	2001/05/05 16:35:17	1.4
  @@ -140,7 +140,6 @@
   
   void ssl_mutex_file_create(server_rec *s, pool *p)
   {
  -#ifndef WIN32
       SSLModConfigRec *mc = myModConfig();
   
       /* create the lockfile */
  @@ -168,13 +167,11 @@
                   mc->szMutexFile);
           ssl_die();
       }
  -#endif
       return;
   }
   
   void ssl_mutex_file_open(server_rec *s, pool *p)
   {
  -#ifndef WIN32
       SSLModConfigRec *mc = myModConfig();
   
       /* open the lockfile (once per child) to get a unique fd */
  @@ -185,32 +182,26 @@
                   mc->szMutexFile);
           ssl_die();
       }
  -#endif
       return;
   }
   
   void ssl_mutex_file_remove(void *data)
   {
  -#ifndef WIN32
       SSLModConfigRec *mc = myModConfig();
   
       /* remove the mutex lockfile */
       unlink(mc->szMutexFile);
  -#endif
       return;
   }
   
  -#ifndef WIN32
   #ifdef SSL_USE_FCNTL
   static struct flock   lock_it;
   static struct flock unlock_it;
   #endif
  -#endif
   
   BOOL ssl_mutex_file_acquire(void)
   {
       int rc = -1;
  -#ifndef WIN32
       SSLModConfigRec *mc = myModConfig();
   
   #ifdef SSL_USE_FCNTL
  @@ -229,7 +220,6 @@
              && (errno == EINTR)                         )
           ;
   #endif
  -#endif
   
       if (rc < 0)
           return FALSE;
  @@ -240,7 +230,6 @@
   BOOL ssl_mutex_file_release(void)
   {
       int rc = -1;
  -#ifndef WIN32
       SSLModConfigRec *mc = myModConfig();
   
   #ifdef SSL_USE_FCNTL
  @@ -258,7 +247,6 @@
       while (   (rc = flock(mc->nMutexFD, LOCK_UN)) < 0
              && (errno == EINTR)                       ) 
           ;
  -#endif
   #endif
   
       if (rc < 0)
  
  
  
  1.5       +0 -32     httpd-2.0/modules/ssl/ssl_util.c
  
  Index: ssl_util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_util.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ssl_util.c	2001/05/05 15:02:13	1.4
  +++ ssl_util.c	2001/05/05 16:35:18	1.5
  @@ -168,39 +168,7 @@
       /*
        * Exec() the child program
        */
  -#if defined(WIN32)
  -    /* MS Windows */
  -    {
  -        char pCommand[MAX_STRING_LEN];
  -        STARTUPINFO si;
  -        PROCESS_INFORMATION pi;
  -
  -        ap_snprintf(pCommand, sizeof(pCommand), "%s /C %s", SHELL_PATH, cmd);
  -
  -        memset(&si, 0, sizeof(si));
  -        memset(&pi, 0, sizeof(pi));
  -
  -        si.cb          = sizeof(si);
  -        si.dwFlags     = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
  -        si.wShowWindow = SW_HIDE;
  -        si.hStdInput   = pinfo->hPipeInputRead;
  -        si.hStdOutput  = pinfo->hPipeOutputWrite;
  -        si.hStdError   = pinfo->hPipeErrorWrite;
  -
  -        if (CreateProcess(NULL, pCommand, NULL, NULL, TRUE, 0,
  -                          environ, NULL, &si, &pi)) {
  -            CloseHandle(pi.hProcess);
  -            CloseHandle(pi.hThread);
  -            child_pid = pi.dwProcessId;
  -        }
  -    }
  -#elif defined(OS2)
  -    /* IBM OS/2 */
  -    spawnl(P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
  -#else
  -    /* Standard Unix */
       execl(SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, NULL);
  -#endif
       return (child_pid);
   }
   
  
  
  

Mime
View raw message