[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8031 - in libmicrohttpd/src: daemon daemon/https/tls inclu
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8031 - in libmicrohttpd/src: daemon daemon/https/tls include testcurl testcurl/https |
Date: |
Sat, 27 Dec 2008 00:49:35 -0700 (MST) |
Author: grothoff
Date: 2008-12-27 00:49:35 -0700 (Sat, 27 Dec 2008)
New Revision: 8031
Modified:
libmicrohttpd/src/daemon/connection.c
libmicrohttpd/src/daemon/connection_https.c
libmicrohttpd/src/daemon/daemon.c
libmicrohttpd/src/daemon/https/tls/auth_rsa.c
libmicrohttpd/src/daemon/https/tls/ext_cert_type.c
libmicrohttpd/src/daemon/https/tls/ext_max_record.c
libmicrohttpd/src/daemon/https/tls/ext_server_name.c
libmicrohttpd/src/daemon/https/tls/gnutls_algorithms.c
libmicrohttpd/src/daemon/https/tls/gnutls_auth.c
libmicrohttpd/src/daemon/https/tls/gnutls_buffers.c
libmicrohttpd/src/daemon/https/tls/gnutls_cipher.c
libmicrohttpd/src/daemon/https/tls/gnutls_constate.c
libmicrohttpd/src/daemon/https/tls/gnutls_extensions.c
libmicrohttpd/src/daemon/https/tls/gnutls_handshake.c
libmicrohttpd/src/daemon/https/tls/gnutls_kx.c
libmicrohttpd/src/daemon/https/tls/gnutls_pk.c
libmicrohttpd/src/daemon/https/tls/gnutls_record.c
libmicrohttpd/src/daemon/https/tls/gnutls_sig.c
libmicrohttpd/src/daemon/https/tls/gnutls_state.c
libmicrohttpd/src/daemon/https/tls/gnutls_x509.c
libmicrohttpd/src/daemon/https/tls/memmem.c
libmicrohttpd/src/daemon/https/tls/str-two-way.h
libmicrohttpd/src/daemon/internal.c
libmicrohttpd/src/daemon/internal.h
libmicrohttpd/src/include/microhttpd.h
libmicrohttpd/src/testcurl/daemontest_parse_cookies.c
libmicrohttpd/src/testcurl/daemontest_process_headers.c
libmicrohttpd/src/testcurl/https/bug-test.c
libmicrohttpd/src/testcurl/https/mhds_multi_daemon_test.c
libmicrohttpd/src/testcurl/https/tls_authentication_test.c
libmicrohttpd/src/testcurl/https/tls_daemon_options_test.c
libmicrohttpd/src/testcurl/https/tls_thread_mode_test.c
Log:
indent
Modified: libmicrohttpd/src/daemon/connection.c
===================================================================
--- libmicrohttpd/src/daemon/connection.c 2008-12-27 07:48:57 UTC (rev
8030)
+++ libmicrohttpd/src/daemon/connection.c 2008-12-27 07:49:35 UTC (rev
8031)
@@ -288,9 +288,8 @@
connection->socket_fd = -1;
connection->state = MHD_CONNECTION_CLOSED;
if (connection->daemon->notify_completed != NULL)
- connection->daemon->notify_completed (connection->
- daemon->notify_completed_cls,
- connection,
+ connection->daemon->notify_completed (connection->daemon->
+ notify_completed_cls, connection,
&connection->client_context,
termination_code);
}
@@ -976,35 +975,29 @@
while (pos != NULL)
{
while (*pos == ' ')
- pos++; /* skip spaces */
-
+ pos++; /* skip spaces */
+
sce = pos;
- while ( ( (*sce) != '\0') &&
- ( (*sce) != ',') &&
- ( (*sce) != ';') &&
- ( (*sce) != '=') )
- sce++;
+ while (((*sce) != '\0') &&
+ ((*sce) != ',') && ((*sce) != ';') && ((*sce) != '='))
+ sce++;
/* remove tailing whitespace (if any) from key */
ekill = sce - 1;
- while ( (*ekill == ' ') &&
- (ekill >= pos) )
- *(ekill--) = '\0';
+ while ((*ekill == ' ') && (ekill >= pos))
+ *(ekill--) = '\0';
old = *sce;
*sce = '\0';
if (old != '=')
- {
- /* value part omitted, use empty string... */
- if (MHD_NO ==
- connection_add_header (connection,
- pos,
- "",
- MHD_COOKIE_KIND))
- return MHD_NO;
- if (old == '\0')
- break;
- pos = sce + 1;
- continue;
- }
+ {
+ /* value part omitted, use empty string... */
+ if (MHD_NO ==
+ connection_add_header (connection, pos, "", MHD_COOKIE_KIND))
+ return MHD_NO;
+ if (old == '\0')
+ break;
+ pos = sce + 1;
+ continue;
+ }
equals = sce + 1;
quotes = 0;
semicolon = equals;
@@ -1068,9 +1061,8 @@
if (connection->daemon->uri_log_callback != NULL)
connection->client_context
=
- connection->daemon->uri_log_callback (connection->
- daemon->uri_log_callback_cls,
- uri);
+ connection->daemon->uri_log_callback (connection->daemon->
+ uri_log_callback_cls, uri);
args = strstr (uri, "?");
if (args != NULL)
{
@@ -1218,8 +1210,8 @@
}
used = processed;
if (MHD_NO ==
- connection->daemon->default_handler (connection->
- daemon->default_handler_cls,
+ connection->daemon->default_handler (connection->daemon->
+ default_handler_cls,
connection, connection->url,
connection->method,
connection->version,
@@ -1620,11 +1612,9 @@
case MHD_CONNECTION_CONTINUE_SENDING:
ret = connection->send_cls (connection,
&HTTP_100_CONTINUE
- [connection->
- continue_message_write_offset],
+
[connection->continue_message_write_offset],
strlen (HTTP_100_CONTINUE) -
- connection->
- continue_message_write_offset);
+
connection->continue_message_write_offset);
if (ret < 0)
{
if (errno == EINTR)
@@ -1674,12 +1664,12 @@
{
ret = MHD__gnutls_record_send (connection->tls_session,
&connection->response->data
-
[connection->response_write_position
- - response->data_start],
- response->data_size -
- (connection->
+ [connection->
response_write_position -
- response->data_start));
+ response->data_start],
+ response->data_size -
+
(connection->response_write_position
+ - response->data_start));
}
else
#endif
@@ -1749,10 +1739,10 @@
case MHD_TLS_HANDSHAKE_FAILED:
EXTRA_CHECK (0);
break;
- default:
- EXTRA_CHECK (0);
- connection_close_error (connection);
- return MHD_NO;
+ default:
+ EXTRA_CHECK (0);
+ connection_close_error (connection);
+ return MHD_NO;
}
break;
}
@@ -2043,8 +2033,8 @@
#endif
MHD_destroy_response (connection->response);
if (connection->daemon->notify_completed != NULL)
- connection->daemon->notify_completed (connection->
- daemon->notify_completed_cls,
+ connection->daemon->notify_completed (connection->daemon->
+ notify_completed_cls,
connection,
&connection->client_context,
MHD_REQUEST_TERMINATED_COMPLETED_OK);
Modified: libmicrohttpd/src/daemon/connection_https.c
===================================================================
--- libmicrohttpd/src/daemon/connection_https.c 2008-12-27 07:48:57 UTC (rev
8030)
+++ libmicrohttpd/src/daemon/connection_https.c 2008-12-27 07:49:35 UTC (rev
8031)
@@ -58,11 +58,11 @@
{
#if HTTPS_SUPPORT
case MHD_CONNECTION_INFO_CIPHER_ALGO:
- return (const union MHD_ConnectionInfo *) &connection->tls_session->
- security_parameters.read_bulk_cipher_algorithm;
+ return (const union MHD_ConnectionInfo *) &connection->
+ tls_session->security_parameters.read_bulk_cipher_algorithm;
case MHD_CONNECTION_INFO_PROTOCOL:
- return (const union MHD_ConnectionInfo *) &connection->tls_session->
- security_parameters.version;
+ return (const union MHD_ConnectionInfo *) &connection->
+ tls_session->security_parameters.version;
#endif
default:
return NULL;
@@ -246,9 +246,8 @@
MHD_DLOG (connection->daemon,
"Received TLS alert: %s\n",
MHD__gnutls_alert_get_name ((int)
- connection->
- tls_session->internals.
- last_alert));
+ connection->tls_session->
+ internals.last_alert));
#endif
return MHD_YES;
}
Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c 2008-12-27 07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/daemon/daemon.c 2008-12-27 07:49:35 UTC (rev 8031)
@@ -835,7 +835,8 @@
retVal->pool_size = MHD_POOL_SIZE_DEFAULT;
retVal->connection_timeout = 0; /* no timeout */
#if HAVE_MESSAGES
- retVal->custom_error_log = (void(*)(void*,const char *,va_list)) &vfprintf;
+ retVal->custom_error_log =
+ (void (*)(void *, const char *, va_list)) &vfprintf;
retVal->custom_error_log_cls = stderr;
#endif
#if HTTPS_SUPPORT
@@ -896,13 +897,14 @@
va_arg (ap, const int *));
break;
#endif
- case MHD_OPTION_EXTERNAL_LOGGER:
+ case MHD_OPTION_EXTERNAL_LOGGER:
#if HAVE_MESSAGES
- retVal->custom_error_log = va_arg(ap, void (*)(void*cls, const char
*, va_list));
- retVal->custom_error_log_cls = va_arg(ap, void *);
+ retVal->custom_error_log =
+ va_arg (ap, void (*)(void *cls, const char *, va_list));
+ retVal->custom_error_log_cls = va_arg (ap, void *);
#else
- va_arg(ap, void (*)(void*cls, const char *,...));
- va_arg(ap, void *);
+ va_arg (ap, void (*)(void *cls, const char *, ...));
+ va_arg (ap, void *);
#endif
default:
#if HAVE_MESSAGES
Modified: libmicrohttpd/src/daemon/https/tls/auth_rsa.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/auth_rsa.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/auth_rsa.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -168,8 +168,8 @@
}
bits =
- MHD__gnutls_mpi_get_nbits (session->internals.
- selected_cert_list[0].params[0]);
+ MHD__gnutls_mpi_get_nbits (session->internals.selected_cert_list[0].
+ params[0]);
if (MHD_gtls_cipher_suite_get_kx_algo
(&session->security_parameters.current_cipher_suite)
Modified: libmicrohttpd/src/daemon/https/tls/ext_cert_type.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/ext_cert_type.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/ext_cert_type.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -183,8 +183,8 @@
for (i = 0; i < len; i++)
{
data[i + 1] =
- MHD__gnutls_cert_type2num (session->internals.priorities.
- cert_type.priority[i]);
+ MHD__gnutls_cert_type2num (session->internals.
+ priorities.cert_type.priority[i]);
}
return len + 1;
}
@@ -203,8 +203,8 @@
}
data[0] =
- MHD__gnutls_cert_type2num (session->security_parameters.
- cert_type);
+ MHD__gnutls_cert_type2num (session->
+ security_parameters.cert_type);
return len;
}
Modified: libmicrohttpd/src/daemon/https/tls/ext_max_record.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/ext_max_record.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/ext_max_record.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -121,8 +121,8 @@
}
data[0] =
- (uint8_t) MHD_gtls_mre_record2num (session->
- internals.proposed_record_size);
+ (uint8_t) MHD_gtls_mre_record2num (session->internals.
+ proposed_record_size);
return len;
}
Modified: libmicrohttpd/src/daemon/https/tls/ext_server_name.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/ext_server_name.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/ext_server_name.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -118,10 +118,10 @@
case 0: /* NAME_DNS */
if (len <= MAX_SERVER_NAME_SIZE)
{
- memcpy (session->security_parameters.extensions.server_names[i].
- name, p, len);
- session->security_parameters.extensions.
- server_names[i].name_length = len;
+ memcpy (session->security_parameters.extensions.
+ server_names[i].name, p, len);
+ session->security_parameters.extensions.server_names[i].
+ name_length = len;
session->security_parameters.extensions.server_names[i].type =
GNUTLS_NAME_DNS;
break;
@@ -163,8 +163,8 @@
/* count the total size
*/
len =
- session->security_parameters.extensions.
- server_names[i].name_length;
+ session->security_parameters.extensions.server_names[i].
+ name_length;
/* uint8_t + uint16_t + size
*/
@@ -183,14 +183,14 @@
i < session->security_parameters.extensions.server_names_size; i++)
{
- switch (session->security_parameters.extensions.server_names[i].
- type)
+ switch (session->security_parameters.extensions.
+ server_names[i].type)
{
case GNUTLS_NAME_DNS:
len =
- session->security_parameters.extensions.server_names[i].
- name_length;
+ session->security_parameters.extensions.
+ server_names[i].name_length;
if (len == 0)
break;
@@ -208,8 +208,8 @@
p += 2;
memcpy (p,
- session->security_parameters.extensions.server_names[0].
- name, len);
+ session->security_parameters.extensions.
+ server_names[0].name, len);
p += len;
break;
default:
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_algorithms.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_algorithms.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_algorithms.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -1188,8 +1188,8 @@
for (i = j = 0; i < SUPPORTED_COMPRESSION_METHODS; i++)
{
int tmp =
- MHD_gtls_compression_get_num (session->internals.
- priorities.compression.priority[i]);
+ MHD_gtls_compression_get_num (session->internals.priorities.
+ compression.priority[i]);
/* remove private compression algorithms, if requested.
*/
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_auth.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_auth.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_auth.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -166,9 +166,8 @@
return
MHD_gtls_map_kx_get_cred (MHD_gtls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite),
- server);
+ (&session->security_parameters.
+ current_cipher_suite), server);
}
/*
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_buffers.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_buffers.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_buffers.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -734,9 +734,9 @@
session->internals.record_send_buffer_prev_size += n - left;
retval =
- MHD__gnutls_buffer_insert (&session->internals.
- record_send_buffer, &ptr[n - left],
- left);
+ MHD__gnutls_buffer_insert (&session->
+ internals.record_send_buffer,
+ &ptr[n - left], left);
if (retval < 0)
{
MHD_gnutls_assert ();
@@ -944,8 +944,8 @@
MHD_gnutls_assert ();
retval =
- MHD__gnutls_buffer_insert (&session->
- internals.handshake_send_buffer,
+ MHD__gnutls_buffer_insert (&session->internals.
+ handshake_send_buffer,
&ptr[n - left], left);
if (retval < 0)
{
@@ -1047,9 +1047,8 @@
session->internals.handshake_recv_buffer.data
=
- MHD_gtls_realloc_fast (session->
- internals.handshake_recv_buffer.data,
- dsize);
+ MHD_gtls_realloc_fast (session->internals.
+ handshake_recv_buffer.data, dsize);
if (session->internals.handshake_recv_buffer.data == NULL)
{
MHD_gnutls_assert ();
@@ -1100,9 +1099,13 @@
if ((session->internals.max_handshake_data_buffer_size > 0) && ((length
+
-
session->internals.handshake_hash_buffer.length)
- >
-
session->internals.max_handshake_data_buffer_size))
+ session->
+ internals.
+
handshake_hash_buffer.
+ length) >
+ session->
+ internals.
+
max_handshake_data_buffer_size))
{
MHD_gnutls_assert ();
return GNUTLS_E_MEMORY_ERROR;
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_cipher.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_cipher.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_cipher.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -212,15 +212,15 @@
uint8_t type = _type;
uint8_t major, minor;
int hash_size =
- MHD_gnutls_hash_get_algo_len (session->
- security_parameters.write_mac_algorithm);
+ MHD_gnutls_hash_get_algo_len (session->security_parameters.
+ write_mac_algorithm);
enum MHD_GNUTLS_Protocol ver;
int blocksize =
- MHD_gtls_cipher_get_block_size (session->
-
security_parameters.write_bulk_cipher_algorithm);
+ MHD_gtls_cipher_get_block_size (session->security_parameters.
+ write_bulk_cipher_algorithm);
cipher_type_t block_algo =
- MHD_gtls_cipher_is_block (session->
- security_parameters.write_bulk_cipher_algorithm);
+ MHD_gtls_cipher_is_block (session->security_parameters.
+ write_bulk_cipher_algorithm);
opaque *data_ptr;
@@ -247,9 +247,8 @@
if (td != GNUTLS_MAC_FAILED)
{ /* actually when the algorithm in not the NULL
one */
MHD_gnutls_hash (td,
- UINT64DATA (session->
- connection_state.write_sequence_number),
- 8);
+ UINT64DATA (session->connection_state.
+ write_sequence_number), 8);
MHD_gnutls_hash (td, &type, 1);
if (ver >= MHD_GNUTLS_PROTOCOL_TLS1_0)
@@ -343,16 +342,16 @@
uint8_t major, minor;
enum MHD_GNUTLS_Protocol ver;
int hash_size =
- MHD_gnutls_hash_get_algo_len (session->
- security_parameters.read_mac_algorithm);
+ MHD_gnutls_hash_get_algo_len (session->security_parameters.
+ read_mac_algorithm);
ver = MHD__gnutls_protocol_get_version (session);
minor = MHD_gtls_version_get_minor (ver);
major = MHD_gtls_version_get_major (ver);
blocksize =
- MHD_gtls_cipher_get_block_size (session->
-
security_parameters.read_bulk_cipher_algorithm);
+ MHD_gtls_cipher_get_block_size (session->security_parameters.
+ read_bulk_cipher_algorithm);
/* initialize MAC
*/
@@ -376,9 +375,9 @@
{
case CIPHER_STREAM:
if ((ret =
- MHD_gtls_cipher_decrypt (session->
- connection_state.read_cipher_state,
- ciphertext.data, ciphertext.size)) < 0)
+ MHD_gtls_cipher_decrypt (session->connection_state.
+ read_cipher_state, ciphertext.data,
+ ciphertext.size)) < 0)
{
MHD_gnutls_assert ();
return ret;
@@ -395,9 +394,9 @@
}
if ((ret =
- MHD_gtls_cipher_decrypt (session->
- connection_state.read_cipher_state,
- ciphertext.data, ciphertext.size)) < 0)
+ MHD_gtls_cipher_decrypt (session->connection_state.
+ read_cipher_state, ciphertext.data,
+ ciphertext.size)) < 0)
{
MHD_gnutls_assert ();
return ret;
@@ -455,8 +454,8 @@
if (td != GNUTLS_MAC_FAILED)
{
MHD_gnutls_hash (td,
- UINT64DATA (session->
- connection_state.read_sequence_number), 8);
+ UINT64DATA (session->connection_state.
+ read_sequence_number), 8);
MHD_gnutls_hash (td, &type, 1);
if (ver >= MHD_GNUTLS_PROTOCOL_TLS1_0)
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_constate.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_constate.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_constate.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -105,9 +105,10 @@
{ /* TLS 1.0 */
ret =
MHD_gtls_PRF (session,
- (const unsigned char *) session->security_parameters.
- master_secret, TLS_MASTER_SIZE, keyexp, keyexp_length,
- rnd, 2 * TLS_RANDOM_SIZE, block_size, key_block);
+ (const unsigned char *) session->
+ security_parameters.master_secret, TLS_MASTER_SIZE,
+ keyexp, keyexp_length, rnd, 2 * TLS_RANDOM_SIZE,
+ block_size, key_block);
}
if (ret < 0)
@@ -506,35 +507,35 @@
{
rc = MHD_gtls_set_read_cipher (session,
MHD_gtls_cipher_suite_get_cipher_algo
- (&session->
-
security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = MHD_gtls_set_read_mac (session,
MHD_gtls_cipher_suite_get_mac_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = MHD_gtls_set_kx (session,
MHD_gtls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = MHD_gtls_set_read_compression (session,
- session->
- internals.compression_method);
+ session->internals.
+ compression_method);
if (rc < 0)
return rc;
}
else
{ /* RESUME_TRUE */
MHD__gnutls_cpy_read_security_parameters (&session->security_parameters,
- &session->
-
internals.resumed_security_parameters);
+ &session->internals.
+ resumed_security_parameters);
}
@@ -545,8 +546,8 @@
MHD__gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n",
session,
MHD_gtls_cipher_suite_get_name
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (MHD_gtls_compression_is_ok
(session->security_parameters.read_compression_algorithm) != 0)
@@ -571,8 +572,8 @@
MHD_gnutls_cipher_deinit (session->connection_state.read_cipher_state);
mac_size =
- MHD_gnutls_hash_get_algo_len (session->
- security_parameters.read_mac_algorithm);
+ MHD_gnutls_hash_get_algo_len (session->security_parameters.
+ read_mac_algorithm);
MHD__gnutls_handshake_log
("HSK[%x]: Initializing internal [read] cipher sessions\n", session);
@@ -583,8 +584,8 @@
/* initialize cipher session
*/
session->connection_state.read_cipher_state =
- MHD_gtls_cipher_init (session->
- security_parameters.read_bulk_cipher_algorithm,
+ MHD_gtls_cipher_init (session->security_parameters.
+ read_bulk_cipher_algorithm,
&session->cipher_specs.client_write_key,
&session->cipher_specs.client_write_IV);
if (session->connection_state.read_cipher_state == GNUTLS_CIPHER_FAILED
@@ -615,8 +616,8 @@
#if MHD_DEBUG_TLS
case GNUTLS_CLIENT:
session->connection_state.read_cipher_state =
- MHD_gtls_cipher_init (session->
- security_parameters.read_bulk_cipher_algorithm,
+ MHD_gtls_cipher_init (session->security_parameters.
+ read_bulk_cipher_algorithm,
&session->cipher_specs.server_write_key,
&session->cipher_specs.server_write_IV);
@@ -674,27 +675,27 @@
{
rc = MHD_gtls_set_write_cipher (session,
MHD_gtls_cipher_suite_get_cipher_algo
- (&session->
-
security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = MHD_gtls_set_write_mac (session,
MHD_gtls_cipher_suite_get_mac_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = MHD_gtls_set_kx (session,
MHD_gtls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = MHD_gtls_set_write_compression (session,
- session->
- internals.compression_method);
+ session->internals.
+ compression_method);
if (rc < 0)
return rc;
}
@@ -711,8 +712,8 @@
MHD__gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n", session,
MHD_gtls_cipher_suite_get_name
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (MHD_gtls_compression_is_ok
(session->security_parameters.write_compression_algorithm) != 0)
@@ -739,8 +740,8 @@
MHD_gnutls_cipher_deinit (session->connection_state.write_cipher_state);
mac_size =
- MHD_gnutls_hash_get_algo_len (session->
- security_parameters.write_mac_algorithm);
+ MHD_gnutls_hash_get_algo_len (session->security_parameters.
+ write_mac_algorithm);
MHD__gnutls_handshake_log
("HSK[%x]: Initializing internal [write] cipher sessions\n", session);
@@ -751,8 +752,8 @@
/* initialize cipher session
*/
session->connection_state.write_cipher_state =
- MHD_gtls_cipher_init (session->
- security_parameters.write_bulk_cipher_algorithm,
+ MHD_gtls_cipher_init (session->security_parameters.
+ write_bulk_cipher_algorithm,
&session->cipher_specs.server_write_key,
&session->cipher_specs.server_write_IV);
@@ -787,8 +788,8 @@
#if MHD_DEBUG_TLS
case GNUTLS_CLIENT:
session->connection_state.write_cipher_state =
- MHD_gtls_cipher_init (session->
- security_parameters.write_bulk_cipher_algorithm,
+ MHD_gtls_cipher_init (session->security_parameters.
+ write_bulk_cipher_algorithm,
&session->cipher_specs.client_write_key,
&session->cipher_specs.client_write_IV);
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_extensions.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_extensions.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_extensions.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -204,9 +204,8 @@
{
if (session->internals.extensions_sent_size < MAX_EXT_TYPES)
{
- session->internals.extensions_sent[session->
- internals.extensions_sent_size] =
- type;
+ session->internals.extensions_sent[session->internals.
+ extensions_sent_size] = type;
session->internals.extensions_sent_size++;
}
else
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_handshake.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_handshake.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_handshake.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -171,13 +171,11 @@
MHD_gnutls_hash (td_sha, mesg, siz);
MHD_gnutls_mac_deinit_ssl3_handshake (td_md5, ret,
- session->
- security_parameters.master_secret,
- TLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, TLS_MASTER_SIZE);
MHD_gnutls_mac_deinit_ssl3_handshake (td_sha, &ret[16],
- session->
- security_parameters.master_secret,
- TLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, TLS_MASTER_SIZE);
return 0;
}
@@ -359,9 +357,9 @@
pos += session_id_len;
MHD_gtls_generate_session_id (session->security_parameters.session_id,
- &session->
- security_parameters.session_id_size);
-
+ &session->security_parameters.
+ session_id_size);
+
session->internals.resumed = RESUME_FALSE;
/* Remember ciphersuites for later
*/
@@ -708,9 +706,9 @@
*/
if (MHD_gtls_get_kx_cred
(session,
- MHD_gtls_cipher_suite_get_kx_algo (&session->
-
security_parameters.current_cipher_suite),
- &err) == NULL && err != 0)
+ MHD_gtls_cipher_suite_get_kx_algo (&session->security_parameters.
+ current_cipher_suite), &err) == NULL
+ && err != 0)
{
MHD_gnutls_assert ();
return GNUTLS_E_INSUFFICIENT_CREDENTIALS;
@@ -723,8 +721,8 @@
*/
session->internals.auth_struct =
MHD_gtls_kx_auth_struct (MHD_gtls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (session->internals.auth_struct == NULL)
{
@@ -931,8 +929,8 @@
if (session->internals.handshake_header_buffer.header_size ==
handshake_header_size || (session->internals.v2_hello != 0
&& type == GNUTLS_HANDSHAKE_CLIENT_HELLO
- && session->internals.handshake_header_buffer.
- packet_length > 0))
+ && session->internals.
+ handshake_header_buffer.packet_length > 0))
{
*recv_type = session->internals.handshake_header_buffer.recv_type;
@@ -975,13 +973,11 @@
MHD_gtls_handshake_io_recv_int (session, GNUTLS_HANDSHAKE,
type,
&dataptr
- [session->
- internals.handshake_header_buffer.
- header_size],
+ [session->internals.
+ handshake_header_buffer.header_size],
HANDSHAKE_HEADER_SIZE -
- session->
- internals.handshake_header_buffer.
- header_size);
+ session->internals.
+ handshake_header_buffer.header_size);
if (ret <= 0)
{
MHD_gnutls_assert ();
@@ -1164,12 +1160,11 @@
ret = MHD__gnutls_handshake_hash_add_recvd (session, recv_type,
- session->
-
internals.handshake_header_buffer.
- header,
- session->
-
internals.handshake_header_buffer.
- header_size, dataptr, length32);
+ session->internals.
+ handshake_header_buffer.header,
+ session->internals.
+
handshake_header_buffer.header_size,
+ dataptr, length32);
if (ret < 0)
{
MHD_gnutls_assert ();
@@ -1263,8 +1258,8 @@
MHD__gnutls_handshake_log ("HSK[%x]: Selected cipher suite: %s\n", session,
MHD_gtls_cipher_suite_get_name
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
/* check if the credentials (username, public key etc.) are ok.
@@ -1287,8 +1282,8 @@
*/
session->internals.auth_struct =
MHD_gtls_kx_auth_struct (MHD_gtls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (session->internals.auth_struct == NULL)
{
@@ -1862,8 +1857,8 @@
pos += 2;
comp =
- (uint8_t) MHD_gtls_compression_get_num (session->internals.
- compression_method);
+ (uint8_t) MHD_gtls_compression_get_num (session->
+ internals.compression_method);
data[pos++] = comp;
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_kx.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_kx.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_kx.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -65,13 +65,13 @@
MHD_gtls_bin2hex (PREMASTER.data, PREMASTER.size, buf,
sizeof (buf)));
MHD__gnutls_hard_log ("INT: CLIENT RANDOM[%d]: %s\n", 32,
- MHD_gtls_bin2hex (session->
- security_parameters.client_random,
- 32, buf, sizeof (buf)));
+ MHD_gtls_bin2hex (session->security_parameters.
+ client_random, 32, buf,
+ sizeof (buf)));
MHD__gnutls_hard_log ("INT: SERVER RANDOM[%d]: %s\n", 32,
- MHD_gtls_bin2hex (session->
- security_parameters.server_random,
- 32, buf, sizeof (buf)));
+ MHD_gtls_bin2hex (session->security_parameters.
+ server_random, 32, buf,
+ sizeof (buf)));
if (MHD__gnutls_protocol_get_version (session) == MHD_GNUTLS_PROTOCOL_SSL3)
{
@@ -86,8 +86,8 @@
MHD_gnutls_ssl3_generate_random (PREMASTER.data, PREMASTER.size,
rnd, 2 * TLS_RANDOM_SIZE,
TLS_MASTER_SIZE,
- session->
- security_parameters.master_secret);
+ session->security_parameters.
+ master_secret);
}
else
@@ -117,9 +117,8 @@
return ret;
MHD__gnutls_hard_log ("INT: MASTER SECRET: %s\n",
- MHD_gtls_bin2hex (session->
- security_parameters.master_secret,
- TLS_MASTER_SIZE, buf,
+ MHD_gtls_bin2hex (session->security_parameters.
+ master_secret, TLS_MASTER_SIZE, buf,
sizeof (buf)));
return ret;
@@ -186,8 +185,8 @@
int data_size = 0;
int ret = 0;
- if (session->internals.
- auth_struct->MHD_gtls_gen_server_certificate_request == NULL)
+ if (session->internals.auth_struct->
+ MHD_gtls_gen_server_certificate_request == NULL)
return 0;
if (session->internals.send_cert_req <= 0)
@@ -199,8 +198,8 @@
if (again == 0)
{
data_size =
- session->internals.
- auth_struct->MHD_gtls_gen_server_certificate_request (session, &data);
+ session->internals.auth_struct->
+ MHD_gtls_gen_server_certificate_request (session, &data);
if (data_size < 0)
{
@@ -299,8 +298,8 @@
if (again == 0)
{
data_size =
- session->internals.
- auth_struct->MHD_gtls_gen_client_cert_vrfy (session, &data);
+ session->internals.auth_struct->
+ MHD_gtls_gen_client_cert_vrfy (session, &data);
if (data_size < 0)
{
MHD_gnutls_assert ();
@@ -372,8 +371,8 @@
int datasize;
int ret = 0;
- if (session->internals.
- auth_struct->MHD_gtls_process_server_certificate_request != NULL)
+ if (session->internals.auth_struct->
+ MHD_gtls_process_server_certificate_request != NULL)
{
ret =
@@ -388,10 +387,8 @@
return 0; /* ignored */
ret =
- session->internals.
- auth_struct->MHD_gtls_process_server_certificate_request (session,
- data,
- datasize);
+ session->internals.auth_struct->
+ MHD_gtls_process_server_certificate_request (session, data, datasize);
MHD_gnutls_free (data);
if (ret < 0)
return ret;
@@ -462,8 +459,8 @@
/* TLS 1.0 or SSL 3.0 with a valid certificate
*/
data_size =
- session->internals.
- auth_struct->MHD_gtls_gen_client_certificate (session, &data);
+ session->internals.auth_struct->
+ MHD_gtls_gen_client_certificate (session, &data);
if (data_size < 0)
{
@@ -523,8 +520,8 @@
if (again == 0)
{
data_size =
- session->internals.
- auth_struct->MHD_gtls_gen_server_certificate (session, &data);
+ session->internals.auth_struct->
+ MHD_gtls_gen_server_certificate (session, &data);
if (data_size < 0)
{
@@ -620,9 +617,8 @@
return 0;
}
ret =
- session->internals.
- auth_struct->MHD_gtls_process_client_certificate (session, data,
- datasize);
+ session->internals.auth_struct->
+ MHD_gtls_process_client_certificate (session, data, datasize);
MHD_gnutls_free (data);
if (ret < 0 && ret != GNUTLS_E_NO_CERTIFICATE_FOUND)
@@ -666,9 +662,8 @@
}
ret =
- session->internals.
- auth_struct->MHD_gtls_process_server_certificate (session, data,
- datasize);
+ session->internals.auth_struct->
+ MHD_gtls_process_server_certificate (session, data, datasize);
MHD_gnutls_free (data);
if (ret < 0)
{
@@ -719,9 +714,8 @@
}
ret =
- session->internals.
- auth_struct->MHD_gtls_process_client_cert_vrfy (session, data,
- datasize);
+ session->internals.auth_struct->
+ MHD_gtls_process_client_cert_vrfy (session, data, datasize);
MHD_gnutls_free (data);
if (ret < 0)
return ret;
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_pk.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_pk.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_pk.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -634,5 +634,3 @@
gcry_sexp_release (s_sig);
return 0;
}
-
-
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_record.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_record.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_record.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -293,8 +293,8 @@
MHD__gnutls_record_log
("REC[%x]: Sending Packet[%d] %s(%d) with length: %d\n", session,
- (int) MHD_gtls_uint64touint32 (&session->
- connection_state.write_sequence_number),
+ (int) MHD_gtls_uint64touint32 (&session->connection_state.
+ write_sequence_number),
MHD__gnutls_packet2str (type), type, sizeofdata);
if (sizeofdata > MAX_RECORD_SEND_SIZE)
@@ -856,13 +856,13 @@
MHD__gnutls_record_log
("REC[%x]: Expected Packet[%d] %s(%d) with length: %d\n", session,
- (int) MHD_gtls_uint64touint32 (&session->
- connection_state.read_sequence_number),
+ (int) MHD_gtls_uint64touint32 (&session->connection_state.
+ read_sequence_number),
MHD__gnutls_packet2str (type), type, sizeofdata);
MHD__gnutls_record_log
("REC[%x]: Received Packet[%d] %s(%d) with length: %d\n", session,
- (int) MHD_gtls_uint64touint32 (&session->
- connection_state.read_sequence_number),
+ (int) MHD_gtls_uint64touint32 (&session->connection_state.
+ read_sequence_number),
MHD__gnutls_packet2str (recv_type), recv_type, length);
if (length > MAX_RECV_SIZE)
@@ -938,8 +938,8 @@
MHD__gnutls_record_log
("REC[%x]: Decrypted Packet[%d] %s(%d) with length: %d\n", session,
- (int) MHD_gtls_uint64touint32 (&session->
- connection_state.read_sequence_number),
+ (int) MHD_gtls_uint64touint32 (&session->connection_state.
+ read_sequence_number),
MHD__gnutls_packet2str (recv_type), recv_type, decrypted_length);
/* increase sequence number
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_sig.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_sig.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_sig.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -75,9 +75,8 @@
}
MHD_gnutls_mac_deinit_ssl3_handshake (td_sha, &concat[16],
- session->
- security_parameters.master_secret,
- TLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, TLS_MASTER_SIZE);
}
else
MHD_gnutls_hash_deinit (td_sha, &concat[16]);
@@ -95,9 +94,8 @@
if (ver == MHD_GNUTLS_PROTOCOL_SSL3)
MHD_gnutls_mac_deinit_ssl3_handshake (td_md5, concat,
- session->
-
security_parameters.master_secret,
- TLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, TLS_MASTER_SIZE);
else
MHD_gnutls_hash_deinit (td_md5, concat);
@@ -267,8 +265,8 @@
return GNUTLS_E_INSUFFICIENT_CREDENTIALS;
return (*session->internals.sign_func) (session,
- session->
- internals.sign_func_userdata,
+ session->internals.
+ sign_func_userdata,
cert->cert_type, &cert->raw,
hash_concat, signature);
}
@@ -367,13 +365,11 @@
}
MHD_gnutls_mac_deinit_ssl3_handshake (td_md5, concat,
- session->
- security_parameters.master_secret,
- TLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, TLS_MASTER_SIZE);
MHD_gnutls_mac_deinit_ssl3_handshake (td_sha, &concat[16],
- session->
- security_parameters.master_secret,
- TLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, TLS_MASTER_SIZE);
}
else
{
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_state.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_state.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_state.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -771,8 +771,8 @@
enum MHD_GNUTLS_CipherAlgorithm cipher;
cipher =
- MHD_gtls_cipher_suite_get_cipher_algo (&session->
-
security_parameters.current_cipher_suite);
+ MHD_gtls_cipher_suite_get_cipher_algo (&session->security_parameters.
+ current_cipher_suite);
if (MHD_gtls_cipher_get_export_flag (cipher) != 0)
return 1;
Modified: libmicrohttpd/src/daemon/https/tls/gnutls_x509.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/gnutls_x509.c 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/gnutls_x509.c 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -113,8 +113,8 @@
1].params_size, &kid);
- MHD__gnutls_x509_write_rsa_params (res->cert_list[res->ncerts - 1][0].
- params,
+ MHD__gnutls_x509_write_rsa_params (res->
+ cert_list[res->ncerts - 1][0].params,
res->cert_list[res->ncerts -
1][0].params_size, &cid);
Modified: libmicrohttpd/src/daemon/https/tls/memmem.c
===================================================================
--- libmicrohttpd/src/daemon/https/tls/memmem.c 2008-12-27 07:48:57 UTC (rev
8030)
+++ libmicrohttpd/src/daemon/https/tls/memmem.c 2008-12-27 07:49:35 UTC (rev
8031)
@@ -37,7 +37,7 @@
HAYSTACK. */
void *
memmem (const void *haystack_start, size_t haystack_len,
- const void *needle_start, size_t needle_len)
+ const void *needle_start, size_t needle_len)
{
/* Abstract memory is considered to be an array of 'unsigned char' values,
not an array of 'char' values. See ISO C 99 section 6.2.6.1. */
@@ -62,11 +62,12 @@
{
haystack = memchr (haystack, *needle, haystack_len);
if (!haystack || __builtin_expect (needle_len == 1, 0))
- return (void *) haystack;
+ return (void *) haystack;
haystack_len -= haystack - (const unsigned char *) haystack_start;
if (haystack_len < needle_len)
- return NULL;
- return two_way_short_needle (haystack, haystack_len, needle, needle_len);
+ return NULL;
+ return two_way_short_needle (haystack, haystack_len, needle,
+ needle_len);
}
else
return two_way_long_needle (haystack, haystack_len, needle, needle_len);
Modified: libmicrohttpd/src/daemon/https/tls/str-two-way.h
===================================================================
--- libmicrohttpd/src/daemon/https/tls/str-two-way.h 2008-12-27 07:48:57 UTC
(rev 8030)
+++ libmicrohttpd/src/daemon/https/tls/str-two-way.h 2008-12-27 07:49:35 UTC
(rev 8031)
@@ -103,14 +103,14 @@
periodicity. */
static size_t
critical_factorization (const unsigned char *needle, size_t needle_len,
- size_t *period)
+ size_t * period)
{
/* Index of last byte of left half, or SIZE_MAX. */
size_t max_suffix, max_suffix_rev;
- size_t j; /* Index into NEEDLE for current candidate suffix. */
- size_t k; /* Offset into current period. */
- size_t p; /* Intermediate period. */
- unsigned char a, b; /* Current comparison bytes. */
+ size_t j; /* Index into NEEDLE for current candidate
suffix. */
+ size_t k; /* Offset into current period. */
+ size_t p; /* Intermediate period. */
+ unsigned char a, b; /* Current comparison bytes. */
/* Invariants:
0 <= j < NEEDLE_LEN - 1
@@ -119,7 +119,7 @@
1 <= p <= global period of NEEDLE
p == global period of the substring NEEDLE[max_suffix{,_rev}+1...j]
1 <= k <= p
- */
+ */
/* Perform lexicographic search. */
max_suffix = SIZE_MAX;
@@ -130,29 +130,29 @@
a = CANON_ELEMENT (needle[j + k]);
b = CANON_ELEMENT (needle[max_suffix + k]);
if (a < b)
- {
- /* Suffix is smaller, period is entire prefix so far. */
- j += k;
- k = 1;
- p = j - max_suffix;
- }
+ {
+ /* Suffix is smaller, period is entire prefix so far. */
+ j += k;
+ k = 1;
+ p = j - max_suffix;
+ }
else if (a == b)
- {
- /* Advance through repetition of the current period. */
- if (k != p)
- ++k;
- else
- {
- j += p;
- k = 1;
- }
- }
- else /* b < a */
- {
- /* Suffix is larger, start over from current location. */
- max_suffix = j++;
- k = p = 1;
- }
+ {
+ /* Advance through repetition of the current period. */
+ if (k != p)
+ ++k;
+ else
+ {
+ j += p;
+ k = 1;
+ }
+ }
+ else /* b < a */
+ {
+ /* Suffix is larger, start over from current location. */
+ max_suffix = j++;
+ k = p = 1;
+ }
}
*period = p;
@@ -165,29 +165,29 @@
a = CANON_ELEMENT (needle[j + k]);
b = CANON_ELEMENT (needle[max_suffix_rev + k]);
if (b < a)
- {
- /* Suffix is smaller, period is entire prefix so far. */
- j += k;
- k = 1;
- p = j - max_suffix_rev;
- }
+ {
+ /* Suffix is smaller, period is entire prefix so far. */
+ j += k;
+ k = 1;
+ p = j - max_suffix_rev;
+ }
else if (a == b)
- {
- /* Advance through repetition of the current period. */
- if (k != p)
- ++k;
- else
- {
- j += p;
- k = 1;
- }
- }
- else /* a < b */
- {
- /* Suffix is larger, start over from current location. */
- max_suffix_rev = j++;
- k = p = 1;
- }
+ {
+ /* Advance through repetition of the current period. */
+ if (k != p)
+ ++k;
+ else
+ {
+ j += p;
+ k = 1;
+ }
+ }
+ else /* a < b */
+ {
+ /* Suffix is larger, start over from current location. */
+ max_suffix_rev = j++;
+ k = p = 1;
+ }
}
/* Choose the longer suffix. Return the first byte of the right
@@ -210,12 +210,12 @@
HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */
static RETURN_TYPE
two_way_short_needle (const unsigned char *haystack, size_t haystack_len,
- const unsigned char *needle, size_t needle_len)
+ const unsigned char *needle, size_t needle_len)
{
- size_t i; /* Index into current byte of NEEDLE. */
- size_t j; /* Index into current window of HAYSTACK. */
- size_t period; /* The period of the right half of needle. */
- size_t suffix; /* The index of the right half of needle. */
+ size_t i; /* Index into current byte of NEEDLE. */
+ size_t j; /* Index into current window of HAYSTACK. */
+ size_t period; /* The period of the right half of needle. */
+ size_t suffix; /* The index of the right half of needle. */
/* Factor the needle into two halves, such that the left half is
smaller than the global period, and the right half is
@@ -227,65 +227,65 @@
if (CMP_FUNC (needle, needle + period, suffix) == 0)
{
/* Entire needle is periodic; a mismatch can only advance by the
- period, so use memory to avoid rescanning known occurrences
- of the period. */
+ period, so use memory to avoid rescanning known occurrences
+ of the period. */
size_t memory = 0;
j = 0;
while (AVAILABLE (haystack, haystack_len, j, needle_len))
- {
- /* Scan for matches in right half. */
- i = MAX (suffix, memory);
- while (i < needle_len && (CANON_ELEMENT (needle[i])
- == CANON_ELEMENT (haystack[i + j])))
- ++i;
- if (needle_len <= i)
- {
- /* Scan for matches in left half. */
- i = suffix - 1;
- while (memory < i + 1 && (CANON_ELEMENT (needle[i])
- == CANON_ELEMENT (haystack[i + j])))
- --i;
- if (i + 1 < memory + 1)
- return (RETURN_TYPE) (haystack + j);
- /* No match, so remember how many repetitions of period
- on the right half were scanned. */
- j += period;
- memory = needle_len - period;
- }
- else
- {
- j += i - suffix + 1;
- memory = 0;
- }
- }
+ {
+ /* Scan for matches in right half. */
+ i = MAX (suffix, memory);
+ while (i < needle_len && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (memory < i + 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i + 1 < memory + 1)
+ return (RETURN_TYPE) (haystack + j);
+ /* No match, so remember how many repetitions of period
+ on the right half were scanned. */
+ j += period;
+ memory = needle_len - period;
+ }
+ else
+ {
+ j += i - suffix + 1;
+ memory = 0;
+ }
+ }
}
else
{
/* The two halves of needle are distinct; no extra memory is
- required, and any mismatch results in a maximal shift. */
+ required, and any mismatch results in a maximal shift. */
period = MAX (suffix, needle_len - suffix) + 1;
j = 0;
while (AVAILABLE (haystack, haystack_len, j, needle_len))
- {
- /* Scan for matches in right half. */
- i = suffix;
- while (i < needle_len && (CANON_ELEMENT (needle[i])
- == CANON_ELEMENT (haystack[i + j])))
- ++i;
- if (needle_len <= i)
- {
- /* Scan for matches in left half. */
- i = suffix - 1;
- while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
- == CANON_ELEMENT (haystack[i + j])))
- --i;
- if (i == SIZE_MAX)
- return (RETURN_TYPE) (haystack + j);
- j += period;
- }
- else
- j += i - suffix + 1;
- }
+ {
+ /* Scan for matches in right half. */
+ i = suffix;
+ while (i < needle_len && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i == SIZE_MAX)
+ return (RETURN_TYPE) (haystack + j);
+ j += period;
+ }
+ else
+ j += i - suffix + 1;
+ }
}
return NULL;
}
@@ -304,13 +304,13 @@
sublinear performance is not possible. */
static RETURN_TYPE
two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
- const unsigned char *needle, size_t needle_len)
+ const unsigned char *needle, size_t needle_len)
{
- size_t i; /* Index into current byte of NEEDLE. */
- size_t j; /* Index into current window of HAYSTACK. */
- size_t period; /* The period of the right half of needle. */
- size_t suffix; /* The index of the right half of needle. */
- size_t shift_table[1U << CHAR_BIT]; /* See below. */
+ size_t i; /* Index into current byte of NEEDLE. */
+ size_t j; /* Index into current window of HAYSTACK. */
+ size_t period; /* The period of the right half of needle. */
+ size_t suffix; /* The index of the right half of needle. */
+ size_t shift_table[1U << CHAR_BIT]; /* See below. */
/* Factor the needle into two halves, such that the left half is
smaller than the global period, and the right half is
@@ -331,93 +331,93 @@
if (CMP_FUNC (needle, needle + period, suffix) == 0)
{
/* Entire needle is periodic; a mismatch can only advance by the
- period, so use memory to avoid rescanning known occurrences
- of the period. */
+ period, so use memory to avoid rescanning known occurrences
+ of the period. */
size_t memory = 0;
size_t shift;
j = 0;
while (AVAILABLE (haystack, haystack_len, j, needle_len))
- {
- /* Check the last byte first; if it does not match, then
- shift to the next possible match location. */
- shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
- if (0 < shift)
- {
- if (memory && shift < period)
- {
- /* Since needle is periodic, but the last period has
- a byte out of place, there can be no match until
- after the mismatch. */
- shift = needle_len - period;
- memory = 0;
- }
- j += shift;
- continue;
- }
- /* Scan for matches in right half. The last byte has
- already been matched, by virtue of the shift table. */
- i = MAX (suffix, memory);
- while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
- == CANON_ELEMENT (haystack[i + j])))
- ++i;
- if (needle_len - 1 <= i)
- {
- /* Scan for matches in left half. */
- i = suffix - 1;
- while (memory < i + 1 && (CANON_ELEMENT (needle[i])
- == CANON_ELEMENT (haystack[i + j])))
- --i;
- if (i + 1 < memory + 1)
- return (RETURN_TYPE) (haystack + j);
- /* No match, so remember how many repetitions of period
- on the right half were scanned. */
- j += period;
- memory = needle_len - period;
- }
- else
- {
- j += i - suffix + 1;
- memory = 0;
- }
- }
+ {
+ /* Check the last byte first; if it does not match, then
+ shift to the next possible match location. */
+ shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
+ if (0 < shift)
+ {
+ if (memory && shift < period)
+ {
+ /* Since needle is periodic, but the last period has
+ a byte out of place, there can be no match until
+ after the mismatch. */
+ shift = needle_len - period;
+ memory = 0;
+ }
+ j += shift;
+ continue;
+ }
+ /* Scan for matches in right half. The last byte has
+ already been matched, by virtue of the shift table. */
+ i = MAX (suffix, memory);
+ while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len - 1 <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (memory < i + 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i + 1 < memory + 1)
+ return (RETURN_TYPE) (haystack + j);
+ /* No match, so remember how many repetitions of period
+ on the right half were scanned. */
+ j += period;
+ memory = needle_len - period;
+ }
+ else
+ {
+ j += i - suffix + 1;
+ memory = 0;
+ }
+ }
}
else
{
/* The two halves of needle are distinct; no extra memory is
- required, and any mismatch results in a maximal shift. */
+ required, and any mismatch results in a maximal shift. */
size_t shift;
period = MAX (suffix, needle_len - suffix) + 1;
j = 0;
while (AVAILABLE (haystack, haystack_len, j, needle_len))
- {
- /* Check the last byte first; if it does not match, then
- shift to the next possible match location. */
- shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
- if (0 < shift)
- {
- j += shift;
- continue;
- }
- /* Scan for matches in right half. The last byte has
- already been matched, by virtue of the shift table. */
- i = suffix;
- while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
- == CANON_ELEMENT (haystack[i + j])))
- ++i;
- if (needle_len - 1 <= i)
- {
- /* Scan for matches in left half. */
- i = suffix - 1;
- while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
- == CANON_ELEMENT (haystack[i + j])))
- --i;
- if (i == SIZE_MAX)
- return (RETURN_TYPE) (haystack + j);
- j += period;
- }
- else
- j += i - suffix + 1;
- }
+ {
+ /* Check the last byte first; if it does not match, then
+ shift to the next possible match location. */
+ shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
+ if (0 < shift)
+ {
+ j += shift;
+ continue;
+ }
+ /* Scan for matches in right half. The last byte has
+ already been matched, by virtue of the shift table. */
+ i = suffix;
+ while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len - 1 <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i == SIZE_MAX)
+ return (RETURN_TYPE) (haystack + j);
+ j += period;
+ }
+ else
+ j += i - suffix + 1;
+ }
}
return NULL;
}
Modified: libmicrohttpd/src/daemon/internal.c
===================================================================
--- libmicrohttpd/src/daemon/internal.c 2008-12-27 07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/daemon/internal.c 2008-12-27 07:49:35 UTC (rev 8031)
@@ -102,9 +102,7 @@
if ((daemon->options & MHD_USE_DEBUG) == 0)
return;
va_start (va, format);
- daemon->custom_error_log(daemon->custom_error_log_cls,
- format,
- va);
+ daemon->custom_error_log (daemon->custom_error_log_cls, format, va);
va_end (va);
}
#endif
Modified: libmicrohttpd/src/daemon/internal.h
===================================================================
--- libmicrohttpd/src/daemon/internal.h 2008-12-27 07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/daemon/internal.h 2008-12-27 07:49:35 UTC (rev 8031)
@@ -143,7 +143,7 @@
* Set to -1 if size is not known.
*/
size_t total_size;
-
+
/**
* Size of data.
*/
@@ -153,7 +153,7 @@
* Size of the data buffer.
*/
size_t data_buffer_size;
-
+
/**
* At what offset in the stream is the
* beginning of data located?
@@ -224,7 +224,7 @@
* rest.
*/
MHD_CONNECTION_FOOTER_PART_RECEIVED = MHD_CONNECTION_BODY_RECEIVED + 1,
-
+
/**
* 9: We received the entire footer. Wait for a response to be queued
* and prepare the response headers.
@@ -353,7 +353,7 @@
* This is a linked list.
*/
struct MHD_Connection *next;
-
+
/**
* Reference to the MHD_Daemon struct.
*/
@@ -466,7 +466,7 @@
* Size of write_buffer (in bytes).
*/
size_t write_buffer_size;
-
+
/**
* Offset where we are with sending from write_buffer.
*/
@@ -571,19 +571,19 @@
* with respect to the current chunk (at what offset / position)?
*/
unsigned int current_chunk_offset;
-
+
/**
- * Handler used for processing read connection operations
+ * Handler used for processing read connection operations
*/
int (*read_handler) (struct MHD_Connection * connection);
/**
- * Handler used for processing write connection operations
+ * Handler used for processing write connection operations
*/
int (*write_handler) (struct MHD_Connection * connection);
/**
- * Handler used for processing idle connection operations
+ * Handler used for processing idle connection operations
*/
int (*idle_handler) (struct MHD_Connection * connection);
@@ -615,7 +615,7 @@
* Callback function for all requests.
*/
MHD_AccessHandlerCallback default_handler;
-
+
/**
* Closure argument to default_handler.
*/
@@ -665,7 +665,7 @@
#if HAVE_MESSAGES
/**
- * Function for logging error messages (if we
+ * Function for logging error messages (if we
* support error reporting).
*/
void (*custom_error_log) (void *cls, const char *fmt, va_list va);
@@ -685,7 +685,7 @@
* Listen socket.
*/
int socket_fd;
-
+
/**
* Are we shutting down?
*/
@@ -731,12 +731,12 @@
enum MHD_GNUTLS_CredentialsType cred_type;
/**
- * Server x509 credentials
+ * Server x509 credentials
*/
MHD_gtls_cert_credentials_t x509_cred;
/**
- * Cipher priority cache
+ * Cipher priority cache
*/
MHD_gnutls_priority_t priority_cache;
Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h 2008-12-27 07:48:57 UTC (rev
8030)
+++ libmicrohttpd/src/include/microhttpd.h 2008-12-27 07:49:35 UTC (rev
8031)
@@ -925,10 +925,9 @@
* @param key the header to look for
* @return NULL if no such item was found
*/
-const char *
-MHD_lookup_connection_value (struct MHD_Connection *connection,
- enum MHD_ValueKind kind,
- const char *key);
+const char *MHD_lookup_connection_value (struct MHD_Connection *connection,
+ enum MHD_ValueKind kind,
+ const char *key);
/**
* Queue a response to be transmitted to the client (as soon as
Modified: libmicrohttpd/src/testcurl/daemontest_parse_cookies.c
===================================================================
--- libmicrohttpd/src/testcurl/daemontest_parse_cookies.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/testcurl/daemontest_parse_cookies.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -82,30 +82,18 @@
*unused = NULL;
ret = 0;
- hdr = MHD_lookup_connection_value (connection,
- MHD_COOKIE_KIND,
- "name1");
- if ( (hdr == NULL) ||
- (0 != strcmp(hdr, "var1")) )
- abort();
- hdr = MHD_lookup_connection_value (connection,
- MHD_COOKIE_KIND,
- "name2");
- if ( (hdr == NULL) ||
- (0 != strcmp(hdr, "var2")) )
- abort();
- hdr = MHD_lookup_connection_value (connection,
- MHD_COOKIE_KIND,
- "name3");
- if ( (hdr == NULL) ||
- (0 != strcmp(hdr, "")) )
- abort();
- hdr = MHD_lookup_connection_value (connection,
- MHD_COOKIE_KIND,
- "name4");
- if ( (hdr == NULL) ||
- (0 != strcmp(hdr, "var4 with spaces")) )
- abort();
+ hdr = MHD_lookup_connection_value (connection, MHD_COOKIE_KIND, "name1");
+ if ((hdr == NULL) || (0 != strcmp (hdr, "var1")))
+ abort ();
+ hdr = MHD_lookup_connection_value (connection, MHD_COOKIE_KIND, "name2");
+ if ((hdr == NULL) || (0 != strcmp (hdr, "var2")))
+ abort ();
+ hdr = MHD_lookup_connection_value (connection, MHD_COOKIE_KIND, "name3");
+ if ((hdr == NULL) || (0 != strcmp (hdr, "")))
+ abort ();
+ hdr = MHD_lookup_connection_value (connection, MHD_COOKIE_KIND, "name4");
+ if ((hdr == NULL) || (0 != strcmp (hdr, "var4 with spaces")))
+ abort ();
response = MHD_create_response_from_data (strlen (url),
(void *) url, MHD_NO, MHD_YES);
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
@@ -145,12 +133,12 @@
curl_easy_setopt (c, CURLOPT_URL, "http://localhost:21080/hello_world");
curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer);
curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
- curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);
+ curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);
/* note that the string below intentionally uses the
various ways cookies can be specified to exercise the
parser! Do not change! */
curl_easy_setopt (c, CURLOPT_COOKIE,
- "name1=var1; name2=var2,name3 ;name4=\"var4 with
spaces\";");
+ "name1=var1; name2=var2,name3 ;name4=\"var4 with
spaces\";");
if (oneone)
curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
else
@@ -158,8 +146,8 @@
curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 15L);
/* NOTE: use of CONNECTTIMEOUT without also
- setting NOSIGNAL results in really weird
- crashes on my system! */
+ setting NOSIGNAL results in really weird
+ crashes on my system! */
curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1);
Modified: libmicrohttpd/src/testcurl/daemontest_process_headers.c
===================================================================
--- libmicrohttpd/src/testcurl/daemontest_process_headers.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/testcurl/daemontest_process_headers.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -57,17 +57,13 @@
return size * nmemb;
}
-static int
-kv_cb(void * cls,
- enum MHD_ValueKind kind,
- const char * key,
- const char * value)
+static int
+kv_cb (void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
{
- if ( (0 == strcmp(key, MHD_HTTP_HEADER_HOST)) &&
- (0 == strcmp(value, "localhost:21080")) &&
- (kind == MHD_HEADER_KIND) )
+ if ((0 == strcmp (key, MHD_HTTP_HEADER_HOST)) &&
+ (0 == strcmp (value, "localhost:21080")) && (kind == MHD_HEADER_KIND))
{
- *((int*) cls) = 1;
+ *((int *) cls) = 1;
return MHD_NO;
}
return MHD_YES;
@@ -97,61 +93,41 @@
}
*unused = NULL;
ret = 0;
- MHD_get_connection_values (connection,
- MHD_HEADER_KIND,
- &kv_cb,
- &ret);
+ MHD_get_connection_values (connection, MHD_HEADER_KIND, &kv_cb, &ret);
if (ret != 1)
- abort();
- hdr = MHD_lookup_connection_value (connection,
- MHD_HEADER_KIND,
- "NotFound");
+ abort ();
+ hdr = MHD_lookup_connection_value (connection, MHD_HEADER_KIND, "NotFound");
if (hdr != NULL)
- abort();
- hdr = MHD_lookup_connection_value (connection,
- MHD_HEADER_KIND,
- MHD_HTTP_HEADER_ACCEPT);
- if ( (hdr == NULL) ||
- (0 != strcmp(hdr, "*/*")) )
- abort();
- hdr = MHD_lookup_connection_value (connection,
- MHD_HEADER_KIND,
- MHD_HTTP_HEADER_HOST);
- if ( (hdr == NULL) ||
- (0 != strcmp(hdr, "localhost:21080")) )
- abort();
- MHD_set_connection_value (connection,
- MHD_HEADER_KIND,
- "FakeHeader",
- "NowPresent");
- hdr = MHD_lookup_connection_value (connection,
- MHD_HEADER_KIND,
- "FakeHeader");
- if ( (hdr == NULL) ||
- (0 != strcmp(hdr, "NowPresent")) )
- abort();
+ abort ();
+ hdr = MHD_lookup_connection_value (connection,
+ MHD_HEADER_KIND, MHD_HTTP_HEADER_ACCEPT);
+ if ((hdr == NULL) || (0 != strcmp (hdr, "*/*")))
+ abort ();
+ hdr = MHD_lookup_connection_value (connection,
+ MHD_HEADER_KIND, MHD_HTTP_HEADER_HOST);
+ if ((hdr == NULL) || (0 != strcmp (hdr, "localhost:21080")))
+ abort ();
+ MHD_set_connection_value (connection,
+ MHD_HEADER_KIND, "FakeHeader", "NowPresent");
+ hdr = MHD_lookup_connection_value (connection,
+ MHD_HEADER_KIND, "FakeHeader");
+ if ((hdr == NULL) || (0 != strcmp (hdr, "NowPresent")))
+ abort ();
response = MHD_create_response_from_data (strlen (url),
(void *) url, MHD_NO, MHD_YES);
- MHD_add_response_header (response,
- "MyHeader",
- "MyValue");
+ MHD_add_response_header (response, "MyHeader", "MyValue");
hdr = MHD_get_response_header (response, "MyHeader");
if (0 != strcmp ("MyValue", hdr))
- abort();
- MHD_add_response_header (response,
- "MyHeader",
- "MyValueToo");
- if (MHD_YES !=
- MHD_del_response_header (response,
- "MyHeader",
- "MyValue"))
- abort();
+ abort ();
+ MHD_add_response_header (response, "MyHeader", "MyValueToo");
+ if (MHD_YES != MHD_del_response_header (response, "MyHeader", "MyValue"))
+ abort ();
hdr = MHD_get_response_header (response, "MyHeader");
if (0 != strcmp ("MyValueToo", hdr))
- abort();
+ abort ();
if (1 != MHD_get_response_headers (response, NULL, NULL))
- abort();
+ abort ();
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
MHD_destroy_response (response);
if (ret == MHD_NO)
@@ -297,8 +273,8 @@
curl_easy_setopt (c, CURLOPT_TIMEOUT, 150L);
curl_easy_setopt (c, CURLOPT_CONNECTTIMEOUT, 15L);
/* NOTE: use of CONNECTTIMEOUT without also
- setting NOSIGNAL results in really weird
- crashes on my system! */
+ setting NOSIGNAL results in really weird
+ crashes on my system! */
curl_easy_setopt (c, CURLOPT_NOSIGNAL, 1);
Modified: libmicrohttpd/src/testcurl/https/bug-test.c
===================================================================
--- libmicrohttpd/src/testcurl/https/bug-test.c 2008-12-27 07:48:57 UTC (rev
8030)
+++ libmicrohttpd/src/testcurl/https/bug-test.c 2008-12-27 07:49:35 UTC (rev
8031)
@@ -151,7 +151,7 @@
fprintf (stderr, MHD_E_MEM);
return -1;
}
- if (getcwd (doc_path, doc_path_len) == NULL)
+ if (getcwd (doc_path, doc_path_len) == NULL)
{
fclose (test_fd);
free (doc_path);
Modified: libmicrohttpd/src/testcurl/https/mhds_multi_daemon_test.c
===================================================================
--- libmicrohttpd/src/testcurl/https/mhds_multi_daemon_test.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/testcurl/https/mhds_multi_daemon_test.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -147,7 +147,7 @@
fprintf (stderr, MHD_E_MEM);
return -1;
}
- if (getcwd (doc_path, doc_path_len) == NULL)
+ if (getcwd (doc_path, doc_path_len) == NULL)
{
fclose (test_fd);
free (doc_path);
Modified: libmicrohttpd/src/testcurl/https/tls_authentication_test.c
===================================================================
--- libmicrohttpd/src/testcurl/https/tls_authentication_test.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/testcurl/https/tls_authentication_test.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -148,7 +148,7 @@
fprintf (stderr, MHD_E_MEM);
return -1;
}
- if (getcwd (doc_path, doc_path_len) == NULL)
+ if (getcwd (doc_path, doc_path_len) == NULL)
{
fclose (test_fd);
free (doc_path);
Modified: libmicrohttpd/src/testcurl/https/tls_daemon_options_test.c
===================================================================
--- libmicrohttpd/src/testcurl/https/tls_daemon_options_test.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/testcurl/https/tls_daemon_options_test.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -303,9 +303,9 @@
/* TODO test_wrap: change sig to (setup_func, test, va_list test_arg) & move
to test_util.c */
static int
test_wrap (char *test_name, int
- (*test_function) (FILE * test_fd, char *cipher_suite, int
proto_version),
- FILE * test_fd, int daemon_flags, char *cipher_suite,
- int proto_version, ...)
+ (*test_function) (FILE * test_fd, char *cipher_suite,
+ int proto_version), FILE * test_fd,
+ int daemon_flags, char *cipher_suite, int proto_version, ...)
{
int ret;
va_list arg_list;
Modified: libmicrohttpd/src/testcurl/https/tls_thread_mode_test.c
===================================================================
--- libmicrohttpd/src/testcurl/https/tls_thread_mode_test.c 2008-12-27
07:48:57 UTC (rev 8030)
+++ libmicrohttpd/src/testcurl/https/tls_thread_mode_test.c 2008-12-27
07:49:35 UTC (rev 8031)
@@ -1,17 +1,17 @@
/*
This file is part of libmicrohttpd
(C) 2007 Christian Grothoff
-
+
libmicrohttpd is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2, or (at your
option) any later version.
-
+
libmicrohttpd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with libmicrohttpd; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
@@ -23,8 +23,8 @@
* @brief Testcase for libmicrohttpd HTTPS GET operations
* @author Sagie Amir
* @author Christian Grothoff
- *
- * TODO: add test for external select!
+ *
+ * TODO: add test for external select!
*/
#include "platform.h"
@@ -268,7 +268,7 @@
/* time spread incomming requests */
usleep ((useconds_t) 10.0 * ((double) rand ()) / ((double) RAND_MAX));
ret = test_https_transfer (cargs->test_fd,
- cargs->cipher_suite, cargs->proto_version);
+ cargs->cipher_suite, cargs->proto_version);
if (ret == 0)
return NULL;
return &nonnull;
@@ -326,9 +326,9 @@
/* TODO test_wrap: change sig to (setup_func, test, va_list test_arg) & move
to test_util.c */
static int
test_wrap (char *test_name, int
- (*test_function) (FILE * test_fd, char *cipher_suite, int
proto_version),
- FILE * test_fd, int daemon_flags, char *cipher_suite,
- int proto_version, ...)
+ (*test_function) (FILE * test_fd, char *cipher_suite,
+ int proto_version), FILE * test_fd,
+ int daemon_flags, char *cipher_suite, int proto_version, ...)
{
int ret;
va_list arg_list;
@@ -367,14 +367,15 @@
*/
static int
test_single_client (FILE * test_fd, char *cipher_suite,
- int curl_proto_version)
+ int curl_proto_version)
{
void *client_thread_ret;
- struct https_test_data client_args = {test_fd, cipher_suite,
curl_proto_version};
+ struct https_test_data client_args =
+ { test_fd, cipher_suite, curl_proto_version };
client_thread_ret = https_transfer_thread_adapter (&client_args);
if (client_thread_ret != NULL)
- return -1;
+ return -1;
return 0;
}
@@ -388,18 +389,20 @@
*/
static int
test_parallel_clients (FILE * test_fd, char *cipher_suite,
- int curl_proto_version)
+ int curl_proto_version)
{
int i;
int client_count = 3;
void *client_thread_ret;
pthread_t client_arr[client_count];
- struct https_test_data client_args = {test_fd, cipher_suite,
curl_proto_version};
+ struct https_test_data client_args =
+ { test_fd, cipher_suite, curl_proto_version };
for (i = 0; i < client_count; ++i)
{
if (pthread_create (&client_arr[i], NULL,
- (void * ) &https_transfer_thread_adapter,
&client_args) != 0)
+ (void *) &https_transfer_thread_adapter,
+ &client_args) != 0)
{
fprintf (stderr, "Error: failed to spawn test client threads.\n");
return -1;
@@ -410,8 +413,8 @@
for (i = 0; i < client_count; ++i)
{
if ((pthread_join (client_arr[i], &client_thread_ret) != 0) ||
- (client_thread_ret != NULL) )
- return -1;
+ (client_thread_ret != NULL))
+ return -1;
}
return 0;
@@ -429,7 +432,7 @@
srand (iseed);
if (curl_check_version (MHD_REQ_CURL_VERSION))
- return -1;
+ return -1;
if ((test_fd = setupTestFile ()) == NULL)
{
@@ -444,34 +447,34 @@
}
errorCount +=
- test_wrap ("multi threaded daemon, single client", &test_single_client,
test_fd,
- MHD_USE_SSL | MHD_USE_DEBUG, "AES256-SHA",
+ test_wrap ("multi threaded daemon, single client", &test_single_client,
+ test_fd, MHD_USE_SSL | MHD_USE_DEBUG, "AES256-SHA",
CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
MHD_OPTION_END);
errorCount +=
- test_wrap ("single threaded daemon, single client", &test_single_client,
test_fd,
- MHD_USE_SELECT_INTERNALLY |
- MHD_USE_SSL | MHD_USE_DEBUG, "AES256-SHA",
- CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
- MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
- MHD_OPTION_END);
+ test_wrap ("single threaded daemon, single client", &test_single_client,
+ test_fd,
+ MHD_USE_SELECT_INTERNALLY | MHD_USE_SSL | MHD_USE_DEBUG,
+ "AES256-SHA", CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
+ srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
+ srv_self_signed_cert_pem, MHD_OPTION_END);
errorCount +=
- test_wrap ("multi threaded daemon, parallel client",
&test_parallel_clients, test_fd,
- MHD_USE_SSL | MHD_USE_DEBUG, "AES256-SHA",
- CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
- MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
- MHD_OPTION_END);
+ test_wrap ("multi threaded daemon, parallel client",
+ &test_parallel_clients, test_fd, MHD_USE_SSL | MHD_USE_DEBUG,
+ "AES256-SHA", CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
+ srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
+ srv_self_signed_cert_pem, MHD_OPTION_END);
errorCount +=
- test_wrap ("single threaded daemon, parallel clients",
&test_parallel_clients, test_fd,
- MHD_USE_SELECT_INTERNALLY |
- MHD_USE_SSL | MHD_USE_DEBUG, "AES256-SHA",
- CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
- MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
- MHD_OPTION_END);
+ test_wrap ("single threaded daemon, parallel clients",
+ &test_parallel_clients, test_fd,
+ MHD_USE_SELECT_INTERNALLY | MHD_USE_SSL | MHD_USE_DEBUG,
+ "AES256-SHA", CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
+ srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
+ srv_self_signed_cert_pem, MHD_OPTION_END);
if (errorCount != 0)
fprintf (stderr, "Failed test: %s.\n", argv[0]);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8031 - in libmicrohttpd/src: daemon daemon/https/tls include testcurl testcurl/https,
gnunet <=