libmicrohttpd

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

commit 1be634886d61c176df26b8e0784e2f751e563c56
parent fc198042d3bb1f824bb6979209ebd1699f447e4d
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 24 Aug 2008 22:07:29 +0000

cleanup

Diffstat:
Msrc/daemon/daemon.c | 7++-----
Msrc/daemon/https/tls/auth_cert.c | 3---
Msrc/daemon/https/tls/auth_rsa_export.c | 2--
Msrc/daemon/https/tls/gnutls_session.c | 129-------------------------------------------------------------------------------
Msrc/testcurl/curl_version_check.c | 2+-
5 files changed, 3 insertions(+), 140 deletions(-)

diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c @@ -330,7 +330,6 @@ MHD_TLS_init_connection (void *data) /* initialize connection state */ con->state = MHD_TLS_CONNECTION_INIT; - MHD_gnutls_init (&con->tls_session, GNUTLS_SERVER); /* sets cipher priorities */ @@ -588,10 +587,8 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon) MHD_destroy_response (pos->response); MHD_pool_destroy (pos->pool); #if HTTPS_SUPPORT - if (pos->tls_session != 0) - { - MHD_gnutls_deinit (pos->tls_session); - } + if (pos->tls_session != NULL) + MHD_gnutls_deinit (pos->tls_session); #endif free (pos->addr); free (pos); diff --git a/src/daemon/https/tls/auth_cert.c b/src/daemon/https/tls/auth_cert.c @@ -820,7 +820,6 @@ mhd_gtls_proc_cert_cert_req (mhd_gtls_session_t session, opaque * data, int size, ret; opaque *p; mhd_gtls_cert_credentials_t cred; - cert_auth_info_t info; ssize_t dsize; int i, j; enum MHD_GNUTLS_PublicKeyAlgorithm pk_algos[MAX_SIGN_ALGOS]; @@ -843,8 +842,6 @@ mhd_gtls_proc_cert_cert_req (mhd_gtls_session_t session, opaque * data, return ret; } - info = mhd_gtls_get_auth_info (session); - p = data; dsize = data_size; diff --git a/src/daemon/https/tls/auth_rsa_export.c b/src/daemon/https/tls/auth_rsa_export.c @@ -77,7 +77,6 @@ gen_rsa_export_server_kx (mhd_gtls_session_t session, opaque ** data) gnutls_privkey *apr_pkey; int apr_cert_list_length; gnutls_datum_t signature, ddata; - cert_auth_info_t info; mhd_gtls_cert_credentials_t cred; cred = (mhd_gtls_cert_credentials_t) @@ -123,7 +122,6 @@ gen_rsa_export_server_kx (mhd_gtls_session_t session, opaque ** data) return ret; } - info = mhd_gtls_get_auth_info (session); mhd_gtls_rsa_export_set_pubkey (session, rsa_mpis[1], rsa_mpis[0]); mhd_gtls_mpi_print (NULL, &n_m, rsa_mpis[0]); diff --git a/src/daemon/https/tls/gnutls_session.c b/src/daemon/https/tls/gnutls_session.c @@ -30,94 +30,6 @@ /* TODO this file should be removed if session resumption will be abandoned */ /** - * gnutls_session_get_data - Returns all session parameters. - * @session: is a #mhd_gtls_session_t structure. - * @session_data: is a pointer to space to hold the session. - * @session_data_size: is the session_data's size, or it will be set by the function. - * - * Returns all session parameters, in order to support resuming. - * The client should call this, and keep the returned session, if he wants to - * resume that current version later by calling gnutls_session_set_data() - * This function must be called after a successful handshake. - * - * Resuming sessions is really useful and speedups connections after a succesful one. - **/ -//int -//gnutls_session_get_data (mhd_gtls_session_t session, -// void *session_data, size_t * session_data_size) -//{ -// -// gnutls_datum_t psession; -// int ret; -// -// if (session->internals.resumable == RESUME_FALSE) -// return GNUTLS_E_INVALID_SESSION; -// -// psession.data = session_data; -// -// ret = mhd_gtls_session_pack (session, &psession); -// if (ret < 0) -// { -// gnutls_assert (); -// return ret; -// } -// *session_data_size = psession.size; -// -// if (psession.size > *session_data_size) -// { -// ret = GNUTLS_E_SHORT_MEMORY_BUFFER; -// goto error; -// } -// -// if (session_data != NULL) -// memcpy (session_data, psession.data, psession.size); -// -// ret = 0; -// -//error: -// _gnutls_free_datum (&psession); -// return ret; -//} - -/** - * gnutls_session_get_data2 - Returns all session parameters. - * @session: is a #mhd_gtls_session_t structure. - * @session_data: is a pointer to a datum that will hold the session. - * - * Returns all session parameters, in order to support resuming. - * The client should call this, and keep the returned session, if he wants to - * resume that current version later by calling gnutls_session_set_data() - * This function must be called after a successful handshake. The returned - * datum must be freed with gnutls_free(). - * - * Resuming sessions is really useful and speedups connections after a succesful one. - **/ -//int -//gnutls_session_get_data2 (mhd_gtls_session_t session, gnutls_datum_t * data) -//{ -// -// int ret; -// -// if (data == NULL) -// { -// return GNUTLS_E_INVALID_REQUEST; -// } -// -// if (session->internals.resumable == RESUME_FALSE) -// return GNUTLS_E_INVALID_SESSION; -// -// ret = mhd_gtls_session_pack (session, data); -// if (ret < 0) -// { -// gnutls_assert (); -// return ret; -// } -// -// return 0; -//} - - -/** * MHD_gtls_session_get_id - Returns session id. * @session: is a #mhd_gtls_session_t structure. * @session_id: is a pointer to space to hold the session id. @@ -158,44 +70,3 @@ MHD_gtls_session_get_id (mhd_gtls_session_t session, return 0; } -/** - * gnutls_session_set_data - Sets all session parameters - * @session: is a #mhd_gtls_session_t structure. - * @session_data: is a pointer to space to hold the session. - * @session_data_size: is the session's size - * - * Sets all session parameters, in order to resume a previously established - * session. The session data given must be the one returned by gnutls_session_get_data(). - * This function should be called before MHD_gnutls_handshake(). - * - * Keep in mind that session resuming is advisory. The server may - * choose not to resume the session, thus a full handshake will be - * performed. - * - * Returns a negative value on error. - * - **/ -//int -//gnutls_session_set_data (mhd_gtls_session_t session, -// const void *session_data, size_t session_data_size) -//{ -// int ret; -// gnutls_datum_t psession; -// -// psession.data = (opaque *) session_data; -// psession.size = session_data_size; -// -// if (session_data == NULL || session_data_size == 0) -// { -// gnutls_assert (); -// return GNUTLS_E_INVALID_REQUEST; -// } -// ret = mhd_gtls_session_unpack (session, &psession); -// if (ret < 0) -// { -// gnutls_assert (); -// return ret; -// } -// -// return 0; -//} diff --git a/src/testcurl/curl_version_check.c b/src/testcurl/curl_version_check.c @@ -38,7 +38,7 @@ static int parse_version_number (const char **s) { int i = 0; - char num[16]; + char num[17]; while (i < 16 && ((**s >= '0') & (**s <= '9'))) {