libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 4a08a776b3863d0d6de9c7fcb4efdae52a61d628
parent 46622f6b02b8ac3138cd2ef57fc8b1a5e7d893fd
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 24 Aug 2008 17:58:56 +0000

fix

Diffstat:
Msrc/daemon/connection_https.c | 35++++++++++++++++++-----------------
Msrc/daemon/daemon.c | 13+++----------
2 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/src/daemon/connection_https.c b/src/daemon/connection_https.c @@ -55,7 +55,7 @@ int MHD_connection_handle_idle (struct MHD_Connection *connection); */ const union MHD_ConnectionInfo * MHD_get_connection_info (struct MHD_Connection * connection, - enum MHD_InfoType infoType, + enum MHD_ConnectionInfoType infoType, ...) { if (connection->tls_session == NULL) @@ -63,23 +63,24 @@ MHD_get_connection_info (struct MHD_Connection * connection, switch (infoType) { #if HTTPS_SUPPORT - case MHS_INFO_CIPHER_ALGO: - return &connection->tls_session->security_parameters.read_bulk_cipher_algorithm; - case MHD_INFO_KX_ALGO: - return &connection->tls_session->security_parameters.kx_algorithm; - case MHD_INFO_CREDENTIALS_TYPE: - return &connection->tls_session->key->cred->algorithm; - case MHD_INFO_MAC_ALGO: - return &connection->tls_session->security_parameters.read_mac_algorithm; - case MHD_INFO_COMPRESSION_METHOD: - return &connection->tls_session->security_parameters.read_compression_algorithm; - case MHD_INFO_PROTOCOL: - return &connection->tls_session->security_parameters.version; - case MHD_INFO_CERT_TYPE: - return &connection->tls_session->security_parameters.cert_type; + case MHD_SESSION_INFO_CIPHER_ALGO: + return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.read_bulk_cipher_algorithm; + case MHD_SESSION_INFO_KX_ALGO: + return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.kx_algorithm; + case MHD_SESSION_INFO_CREDENTIALS_TYPE: + return (const union MHD_ConnectionInfo*) &connection->tls_session->key->cred->algorithm; + case MHD_SESSION_INFO_MAC_ALGO: + return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.read_mac_algorithm; + case MHD_SESSION_INFO_COMPRESSION_METHOD: + return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.read_compression_algorithm; + case MHD_SESSION_INFO_PROTOCOL: + return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.version; + case MHD_SESSION_INFO_CERT_TYPE: + return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.cert_type; #endif + default: + return NULL; }; - return NULL; } /** @@ -105,7 +106,7 @@ MHD_tls_connection_close (struct MHD_Connection * connection) connection->daemon->notify_completed (connection->daemon-> notify_completed_cls, connection, &connection->client_context, - MHD_TLS_REQUEST_TERMINATED_COMPLETED_OK); + MHD_REQUEST_TERMINATED_COMPLETED_OK); } /** diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c @@ -822,26 +822,18 @@ MHD_start_daemon_va (unsigned int options, { const int on = 1; struct MHD_Daemon *retVal; - void * daemon_ip_addr; - - /* listeningss sockets used by the daemon */ int socket_fd; - struct sockaddr_in servaddr4; struct sockaddr_in6 servaddr6; - const struct sockaddr *servaddr = 0; + const struct sockaddr *servaddr = NULL; socklen_t addrlen; enum MHD_OPTION opt; if ((port == 0) || (dh == NULL)) return NULL; - - /* allocate the mhd daemon */ retVal = malloc (sizeof (struct MHD_Daemon)); if (retVal == NULL) return NULL; - - /* set default daemon values */ memset (retVal, 0, sizeof (struct MHD_Daemon)); retVal->options = options; retVal->port = port; @@ -928,7 +920,8 @@ MHD_start_daemon_va (unsigned int options, #endif default: #if HAVE_MESSAGES - if (opt > MHD_HTTPS_OPTION_START && opt < MHD_HTTPS_OPTION_END) + if ( (opt >= MHD_OPTION_HTTPS_KEY_PATH) && + (opt <= MHD_OPTION_TLS_COMP_ALGO) ) { fprintf (stderr, "MHD HTTPS option %d passed to MHD compiled without HTTPS support\n",