From: Bradley Nicholes Date: Mon, 13 Aug 2001 17:12:38 +0000 (+0000) Subject: Added ap_os_http_method(r) for NetWare so that we can return the X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17175bc57d199acf0f9b71519b0af948a2f806a5;p=thirdparty%2Fapache%2Fhttpd.git Added ap_os_http_method(r) for NetWare so that we can return the appropriate http method (ie. http or https) based on a secure or unsecure socket. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@90140 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/os/netware/os.c b/src/os/netware/os.c index 12383138dd2..5b534090df9 100644 --- a/src/os/netware/os.c +++ b/src/os/netware/os.c @@ -56,6 +56,8 @@ * University of Illinois, Urbana-Champaign. */ +#define WS_SSL + #include "httpd.h" #include "ap_config.h" #include "http_config.h" @@ -339,3 +341,30 @@ DIR *os_readdir (DIR *dirP) else return readdir_411 (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; + } + + return http_method; +} \ No newline at end of file diff --git a/src/os/netware/os.h b/src/os/netware/os.h index 3ed87f312b6..85e363e6e48 100644 --- a/src/os/netware/os.h +++ b/src/os/netware/os.h @@ -164,5 +164,6 @@ char *remove_filename(char*); char *bslash2slash(char*); void init_name_space(void); int ap_os_is_filename_valid(const char *file); +char *ap_os_http_method(void *r); #endif /*! APACHE_OS_H*/