aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2008-08-24 17:58:56 +0000
committerChristian Grothoff <christian@grothoff.org>2008-08-24 17:58:56 +0000
commit4a08a776b3863d0d6de9c7fcb4efdae52a61d628 (patch)
treeb4bc81bbd7232943d5a95339a42b1b30e1e064c7 /src
parent46622f6b02b8ac3138cd2ef57fc8b1a5e7d893fd (diff)
downloadlibmicrohttpd-4a08a776b3863d0d6de9c7fcb4efdae52a61d628.tar.gz
libmicrohttpd-4a08a776b3863d0d6de9c7fcb4efdae52a61d628.zip
fix
Diffstat (limited to 'src')
-rw-r--r--src/daemon/connection_https.c35
-rw-r--r--src/daemon/daemon.c13
2 files changed, 21 insertions, 27 deletions
diff --git a/src/daemon/connection_https.c b/src/daemon/connection_https.c
index 26a43414..5c0fa263 100644
--- 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);
55 */ 55 */
56const union MHD_ConnectionInfo * 56const union MHD_ConnectionInfo *
57MHD_get_connection_info (struct MHD_Connection * connection, 57MHD_get_connection_info (struct MHD_Connection * connection,
58 enum MHD_InfoType infoType, 58 enum MHD_ConnectionInfoType infoType,
59 ...) 59 ...)
60{ 60{
61 if (connection->tls_session == NULL) 61 if (connection->tls_session == NULL)
@@ -63,23 +63,24 @@ MHD_get_connection_info (struct MHD_Connection * connection,
63 switch (infoType) 63 switch (infoType)
64 { 64 {
65#if HTTPS_SUPPORT 65#if HTTPS_SUPPORT
66 case MHS_INFO_CIPHER_ALGO: 66 case MHD_SESSION_INFO_CIPHER_ALGO:
67 return &connection->tls_session->security_parameters.read_bulk_cipher_algorithm; 67 return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.read_bulk_cipher_algorithm;
68 case MHD_INFO_KX_ALGO: 68 case MHD_SESSION_INFO_KX_ALGO:
69 return &connection->tls_session->security_parameters.kx_algorithm; 69 return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.kx_algorithm;
70 case MHD_INFO_CREDENTIALS_TYPE: 70 case MHD_SESSION_INFO_CREDENTIALS_TYPE:
71 return &connection->tls_session->key->cred->algorithm; 71 return (const union MHD_ConnectionInfo*) &connection->tls_session->key->cred->algorithm;
72 case MHD_INFO_MAC_ALGO: 72 case MHD_SESSION_INFO_MAC_ALGO:
73 return &connection->tls_session->security_parameters.read_mac_algorithm; 73 return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.read_mac_algorithm;
74 case MHD_INFO_COMPRESSION_METHOD: 74 case MHD_SESSION_INFO_COMPRESSION_METHOD:
75 return &connection->tls_session->security_parameters.read_compression_algorithm; 75 return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.read_compression_algorithm;
76 case MHD_INFO_PROTOCOL: 76 case MHD_SESSION_INFO_PROTOCOL:
77 return &connection->tls_session->security_parameters.version; 77 return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.version;
78 case MHD_INFO_CERT_TYPE: 78 case MHD_SESSION_INFO_CERT_TYPE:
79 return &connection->tls_session->security_parameters.cert_type; 79 return (const union MHD_ConnectionInfo*) &connection->tls_session->security_parameters.cert_type;
80#endif 80#endif
81 default:
82 return NULL;
81 }; 83 };
82 return NULL;
83} 84}
84 85
85/** 86/**
@@ -105,7 +106,7 @@ MHD_tls_connection_close (struct MHD_Connection * connection)
105 connection->daemon->notify_completed (connection->daemon-> 106 connection->daemon->notify_completed (connection->daemon->
106 notify_completed_cls, connection, 107 notify_completed_cls, connection,
107 &connection->client_context, 108 &connection->client_context,
108 MHD_TLS_REQUEST_TERMINATED_COMPLETED_OK); 109 MHD_REQUEST_TERMINATED_COMPLETED_OK);
109} 110}
110 111
111/** 112/**
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index 26ec3af3..d9b24d0e 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -822,26 +822,18 @@ MHD_start_daemon_va (unsigned int options,
822{ 822{
823 const int on = 1; 823 const int on = 1;
824 struct MHD_Daemon *retVal; 824 struct MHD_Daemon *retVal;
825 void * daemon_ip_addr;
826
827 /* listeningss sockets used by the daemon */
828 int socket_fd; 825 int socket_fd;
829
830 struct sockaddr_in servaddr4; 826 struct sockaddr_in servaddr4;
831 struct sockaddr_in6 servaddr6; 827 struct sockaddr_in6 servaddr6;
832 const struct sockaddr *servaddr = 0; 828 const struct sockaddr *servaddr = NULL;
833 socklen_t addrlen; 829 socklen_t addrlen;
834 enum MHD_OPTION opt; 830 enum MHD_OPTION opt;
835 831
836 if ((port == 0) || (dh == NULL)) 832 if ((port == 0) || (dh == NULL))
837 return NULL; 833 return NULL;
838
839 /* allocate the mhd daemon */
840 retVal = malloc (sizeof (struct MHD_Daemon)); 834 retVal = malloc (sizeof (struct MHD_Daemon));
841 if (retVal == NULL) 835 if (retVal == NULL)
842 return NULL; 836 return NULL;
843
844 /* set default daemon values */
845 memset (retVal, 0, sizeof (struct MHD_Daemon)); 837 memset (retVal, 0, sizeof (struct MHD_Daemon));
846 retVal->options = options; 838 retVal->options = options;
847 retVal->port = port; 839 retVal->port = port;
@@ -928,7 +920,8 @@ MHD_start_daemon_va (unsigned int options,
928#endif 920#endif
929 default: 921 default:
930#if HAVE_MESSAGES 922#if HAVE_MESSAGES
931 if (opt > MHD_HTTPS_OPTION_START && opt < MHD_HTTPS_OPTION_END) 923 if ( (opt >= MHD_OPTION_HTTPS_KEY_PATH) &&
924 (opt <= MHD_OPTION_TLS_COMP_ALGO) )
932 { 925 {
933 fprintf (stderr, 926 fprintf (stderr,
934 "MHD HTTPS option %d passed to MHD compiled without HTTPS support\n", 927 "MHD HTTPS option %d passed to MHD compiled without HTTPS support\n",