]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Simplified the test to determine if a NetWare socket is secure or not
authorBradley Nicholes <bnicholes@apache.org>
Fri, 30 Nov 2001 17:24:31 +0000 (17:24 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Fri, 30 Nov 2001 17:24:31 +0000 (17:24 +0000)
Submitted by: Pavel Novy

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@92264 13f79535-47bb-0310-9956-ffa450edef68

src/os/netware/os.c

index fdbab377c961aabffe316024a7bb14f1323de5b0..54043fa8051e54926ba58237be0431a2e7146196 100644 (file)
@@ -351,26 +351,9 @@ DIR *os_readdir (DIR *dirP)
 char *ap_os_http_method(void *r)
 {
     int s = ((request_rec*)r)->connection->client->fd;
-    long e;
-       struct sslserveropts *getOpts;
-       size_t getOptLen = sizeof(getOpts);
-    char *http_method = "http";
-
-    getOpts = ap_pcalloc(((request_rec*)r)->pool, getOptLen);
-    if (WSAIoctl(s, SO_SSL_GET_SERVER, 0, 0, (char *)getOpts, getOptLen, &getOptLen, NULL, NULL)) {
-               e = WSAGetLastError();
-               if(e == WSAEFAULT)
-               {
-            getOpts = ap_pcalloc(((request_rec*)r)->pool, getOptLen);
-            if (WSAIoctl(s, SO_SSL_GET_SERVER, 0, 0, (char *)getOpts, getOptLen, &getOptLen, NULL, NULL)) {
-                               errno = WSAGetLastError();
-            }
-            else
-                http_method = "https";
-               }
-        else
-                   errno = e;
-       }
+    unsigned int optParam;
 
-   return http_method;
+    if (!WSAIoctl(s, SO_SSL_GET_FLAGS, NULL, 0, &optParam, sizeof(optParam), NULL, NULL, NULL))
+        if (optParam & (SO_SSL_ENABLE | SO_SSL_SERVER)) return "https";
+    return "http";
 }