]> granicus.if.org Git - apache/commitdiff
Allow for an unclean shutdown of SSL ports to avoid timeout conditions
authorBradley Nicholes <bnicholes@apache.org>
Mon, 2 Jun 2003 15:24:30 +0000 (15:24 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Mon, 2 Jun 2003 15:24:30 +0000 (15:24 +0000)
between the client and the server.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100138 13f79535-47bb-0310-9956-ffa450edef68

modules/arch/netware/mod_nw_ssl.c

index a931cf8f33222c170f5ec7c04c372fe95b30a083..84cfc76c0c579d0203b8114779e9981efb9ab283 100644 (file)
 #include "apr_portable.h"
 #include "apr_optional.h"
 
+#ifndef SO_TLS_UNCLEAN_SHUTDOWN
+#define SO_TLS_UNCLEAN_SHUTDOWN 0
+#endif
+
 APR_DECLARE_OPTIONAL_FN(int, ssl_proxy_enable, (conn_rec *));
 APR_DECLARE_OPTIONAL_FN(int, ssl_engine_disable, (conn_rec *));
 
@@ -266,7 +270,7 @@ static int make_secure_socket(apr_pool_t *pconf, const struct sockaddr_in *serve
     }
 
     if (mutual) {
-        optParam = 0x07;               // SO_SSL_AUTH_CLIENT
+        optParam = 0x07;  // SO_SSL_AUTH_CLIENT
 
         if(WSAIoctl(s, SO_SSL_SET_FLAGS, (char*)&optParam,
             sizeof(optParam), NULL, 0, NULL, NULL, NULL)) {
@@ -277,6 +281,10 @@ static int make_secure_socket(apr_pool_t *pconf, const struct sockaddr_in *serve
         }
     }
 
+    optParam = SO_TLS_UNCLEAN_SHUTDOWN;
+    WSAIoctl(s, SO_SSL_SET_FLAGS, (char *)&optParam, sizeof(optParam), 
+             NULL, 0, NULL, NULL, NULL);
+
     return s;
 }
 
@@ -307,6 +315,10 @@ int convert_secure_socket(conn_rec *c, apr_socket_t *csd)
                return rcode;
        }
 
+    ulFlags = SO_TLS_UNCLEAN_SHUTDOWN;
+       WSAIoctl(sock, SO_TLS_SET_FLAGS, &ulFlags, sizeof(unsigned long),
+                     NULL, 0, NULL, NULL, NULL);
+
     /* setup the socket for SSL */
     memset (&sWS2Opts, 0, sizeof(sWS2Opts));
     memset (&sNWTLSOpts, 0, sizeof(sNWTLSOpts));
@@ -526,12 +538,13 @@ static int isSecure (const request_rec *r)
 
 static int nwssl_hook_Fixup(request_rec *r)
 {
-    apr_table_t *e = r->subprocess_env;    
+    int i;
+
     if (!isSecure(r))
         return DECLINED;
 
-    apr_table_set(e, "HTTPS", "on");
-    
+    apr_table_set(r->subprocess_env, "HTTPS", "on");
+
     return DECLINED;
 }