mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
Some readability improvements
This commit is contained in:
@@ -411,8 +411,7 @@ access_handler (void *cls,
|
||||
{
|
||||
struct MHD_Response *response;
|
||||
response =
|
||||
MHD_create_response_from_buffer_static (strlen (
|
||||
PAGE_NOT_FOUND),
|
||||
MHD_create_response_from_buffer_static (strlen (PAGE_NOT_FOUND),
|
||||
PAGE_NOT_FOUND);
|
||||
ret = MHD_queue_response (connection,
|
||||
MHD_HTTP_NOT_FOUND,
|
||||
|
||||
@@ -373,8 +373,8 @@ fill_v1_v2_form (const void *cls,
|
||||
size_t slen;
|
||||
(void) cls; /* Unused. Silent compiler warning. */
|
||||
|
||||
slen = strlen (SECOND_PAGE) + strlen (session->value_1) + strlen (
|
||||
session->value_2);
|
||||
slen = strlen (SECOND_PAGE) + strlen (session->value_1)
|
||||
+ strlen (session->value_2);
|
||||
reply = malloc (slen + 1);
|
||||
if (NULL == reply)
|
||||
return MHD_NO;
|
||||
|
||||
@@ -966,12 +966,9 @@ chat_adduser (struct ConnectedUser *cu)
|
||||
|
||||
/* add the new user to the list */
|
||||
size_t user_count_ = user_count + 1;
|
||||
struct ConnectedUser **users_ = (struct ConnectedUser **) realloc (users,
|
||||
user_count_
|
||||
* sizeof (
|
||||
struct
|
||||
ConnectedUser
|
||||
*));
|
||||
struct ConnectedUser **users_ =
|
||||
(struct ConnectedUser **) realloc (users, user_count_
|
||||
* sizeof (struct ConnectedUser *));
|
||||
if (NULL == users_)
|
||||
{
|
||||
/* realloc failed */
|
||||
@@ -1546,8 +1543,8 @@ connecteduser_parse_received_websocket_stream (struct ConnectedUser *cu,
|
||||
snprintf (result_text + 5, 235, "%d", (int) cu->user_id);
|
||||
strcat (result_text,
|
||||
"|");
|
||||
snprintf (result_text + strlen (result_text), 240 - strlen (
|
||||
result_text), "%d", (int) ping);
|
||||
snprintf (result_text + strlen (result_text), 240
|
||||
- strlen (result_text), "%d", (int) ping);
|
||||
chat_addmessage (0,
|
||||
0,
|
||||
result_text,
|
||||
@@ -2256,9 +2253,10 @@ access_handler (void *cls,
|
||||
{
|
||||
/* return error page */
|
||||
struct MHD_Response *response;
|
||||
response = MHD_create_response_from_buffer_static (strlen (
|
||||
PAGE_INVALID_WEBSOCKET_REQUEST),
|
||||
PAGE_INVALID_WEBSOCKET_REQUEST);
|
||||
response =
|
||||
MHD_create_response_from_buffer_static ( \
|
||||
strlen (PAGE_INVALID_WEBSOCKET_REQUEST),
|
||||
PAGE_INVALID_WEBSOCKET_REQUEST);
|
||||
ret = MHD_queue_response (connection,
|
||||
MHD_HTTP_BAD_REQUEST,
|
||||
response);
|
||||
|
||||
@@ -861,18 +861,19 @@ ahc_cb (void *cls, struct MHD_Connection *con, const char *url,
|
||||
{
|
||||
return send_bad_request (con);
|
||||
}
|
||||
ws_version_header = MHD_lookup_connection_value (
|
||||
con, MHD_HEADER_KIND, MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION);
|
||||
ws_version_header =
|
||||
MHD_lookup_connection_value (con, MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION);
|
||||
if ((NULL == ws_version_header)
|
||||
|| (0 != strcmp (ws_version_header, WS_SEC_WEBSOCKET_VERSION)))
|
||||
{
|
||||
return send_upgrade_required (con);
|
||||
}
|
||||
ret = MHD_lookup_connection_value_n (
|
||||
con, MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY,
|
||||
strlen (MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY),
|
||||
&ws_key_header, &key_size);
|
||||
ret = MHD_lookup_connection_value_n (con, MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY,
|
||||
strlen (
|
||||
MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY),
|
||||
&ws_key_header, &key_size);
|
||||
if ((MHD_NO == ret) || (key_size != WS_KEY_LEN))
|
||||
{
|
||||
return send_bad_request (con);
|
||||
|
||||
@@ -3700,8 +3700,8 @@ MHD_create_response_from_callback (uint64_t size,
|
||||
* @deprecated use #MHD_create_response_from_buffer instead
|
||||
* @ingroup response
|
||||
*/
|
||||
_MHD_DEPR_FUNC (
|
||||
"MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \
|
||||
_MHD_DEPR_FUNC ("MHD_create_response_from_data() is deprecated, " \
|
||||
"use MHD_create_response_from_buffer()") \
|
||||
_MHD_EXTERN struct MHD_Response *
|
||||
MHD_create_response_from_data (size_t size,
|
||||
void *data,
|
||||
@@ -3974,8 +3974,8 @@ MHD_create_response_from_fd64 (uint64_t size,
|
||||
* @return NULL on error (i.e. invalid arguments, out of memory)
|
||||
* @ingroup response
|
||||
*/
|
||||
_MHD_DEPR_FUNC (
|
||||
"Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \
|
||||
_MHD_DEPR_FUNC ("Function MHD_create_response_from_fd_at_offset() is " \
|
||||
"deprecated, use MHD_create_response_from_fd_at_offset64()") \
|
||||
_MHD_EXTERN struct MHD_Response *
|
||||
MHD_create_response_from_fd_at_offset (size_t size,
|
||||
int fd,
|
||||
|
||||
+42
-38
@@ -766,13 +766,14 @@ need_100_continue (struct MHD_Connection *connection)
|
||||
const char *expect;
|
||||
|
||||
return (MHD_IS_HTTP_VER_1_1_COMPAT (connection->rq.http_ver) &&
|
||||
(MHD_NO != MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_EXPECT,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_EXPECT),
|
||||
&expect,
|
||||
NULL)) &&
|
||||
(MHD_NO !=
|
||||
MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_EXPECT,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_EXPECT),
|
||||
&expect,
|
||||
NULL)) &&
|
||||
(MHD_str_equal_caseless_ (expect,
|
||||
"100-continue")) );
|
||||
}
|
||||
@@ -1085,8 +1086,8 @@ try_ready_normal_body (struct MHD_Connection *connection)
|
||||
MHD_REQUEST_TERMINATED_COMPLETED_OK);
|
||||
else
|
||||
CONNECTION_CLOSE_ERROR (connection,
|
||||
_ (
|
||||
"Closing connection (application reported error generating data)."));
|
||||
_ ("Closing connection (application reported " \
|
||||
"error generating data)."));
|
||||
return MHD_NO;
|
||||
}
|
||||
response->data_start = connection->rp.rsp_write_position;
|
||||
@@ -1225,8 +1226,8 @@ try_ready_chunked_body (struct MHD_Connection *connection,
|
||||
MHD_mutex_unlock_chk_ (&response->mutex);
|
||||
#endif
|
||||
CONNECTION_CLOSE_ERROR (connection,
|
||||
_ (
|
||||
"Closing connection (application error generating response)."));
|
||||
_ ("Closing connection (application error " \
|
||||
"generating response)."));
|
||||
return MHD_NO;
|
||||
}
|
||||
if (MHD_CONTENT_READER_END_OF_STREAM == ret)
|
||||
@@ -3100,13 +3101,14 @@ parse_cookie_header (struct MHD_Connection *connection)
|
||||
bool strict_parsing;
|
||||
size_t i;
|
||||
|
||||
if (MHD_NO == MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_COOKIE,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_COOKIE),
|
||||
&hdr,
|
||||
&hdr_len))
|
||||
if (MHD_NO ==
|
||||
MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_COOKIE,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_COOKIE),
|
||||
&hdr,
|
||||
&hdr_len))
|
||||
return MHD_PARSE_COOKIE_OK;
|
||||
if (0 == hdr_len)
|
||||
return MHD_PARSE_COOKIE_OK;
|
||||
@@ -3414,8 +3416,8 @@ call_connection_handler (struct MHD_Connection *connection)
|
||||
{
|
||||
/* serious internal error, close connection */
|
||||
CONNECTION_CLOSE_ERROR (connection,
|
||||
_ (
|
||||
"Application reported internal error, closing connection."));
|
||||
_ ("Application reported internal error, " \
|
||||
"closing connection."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -3939,13 +3941,14 @@ parse_connection_headers (struct MHD_Connection *connection)
|
||||
}
|
||||
|
||||
connection->rq.remaining_upload_size = 0;
|
||||
if (MHD_NO != MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_TRANSFER_ENCODING,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_TRANSFER_ENCODING),
|
||||
&enc,
|
||||
NULL))
|
||||
if (MHD_NO !=
|
||||
MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_TRANSFER_ENCODING,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_TRANSFER_ENCODING),
|
||||
&enc,
|
||||
NULL))
|
||||
{
|
||||
connection->rq.remaining_upload_size = MHD_SIZE_UNKNOWN;
|
||||
if (MHD_str_equal_caseless_ (enc,
|
||||
@@ -3954,13 +3957,14 @@ parse_connection_headers (struct MHD_Connection *connection)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MHD_NO != MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_CONTENT_LENGTH,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_CONTENT_LENGTH),
|
||||
&clen,
|
||||
&val_len))
|
||||
if (MHD_NO !=
|
||||
MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_CONTENT_LENGTH,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_CONTENT_LENGTH),
|
||||
&clen,
|
||||
&val_len))
|
||||
{
|
||||
size_t num_digits;
|
||||
|
||||
@@ -4679,8 +4683,8 @@ cleanup_connection (struct MHD_Connection *connection)
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to signal end of connection via inter-thread communication channel.\n"));
|
||||
_ ("Failed to signal end of connection via inter-thread " \
|
||||
"communication channel.\n"));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -5189,8 +5193,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
|
||||
{
|
||||
/* oops - close! */
|
||||
CONNECTION_CLOSE_ERROR (connection,
|
||||
_ (
|
||||
"Closing connection (failed to create response footer)."));
|
||||
_ ("Closing connection (failed to create " \
|
||||
"response footer)."));
|
||||
continue;
|
||||
}
|
||||
mhd_assert (connection->write_buffer_send_offset < \
|
||||
|
||||
@@ -111,9 +111,9 @@ recv_tls_adapter (struct MHD_Connection *connection,
|
||||
#endif /* EPOLL_SUPPORT */
|
||||
|
||||
/* Check whether TLS buffers still have some unread data. */
|
||||
connection->tls_read_ready = ( ((size_t) res == i) &&
|
||||
(0 != gnutls_record_check_pending (
|
||||
connection->tls_session)) );
|
||||
connection->tls_read_ready =
|
||||
( ((size_t) res == i) &&
|
||||
(0 != gnutls_record_check_pending (connection->tls_session)) );
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
+98
-107
@@ -1337,8 +1337,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
|
||||
if (! urh->was_closed)
|
||||
{
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Initiated daemon shutdown while \"upgraded\" connection was not closed.\n"));
|
||||
_ ("Initiated daemon shutdown while \"upgraded\" " \
|
||||
"connection was not closed.\n"));
|
||||
}
|
||||
#endif
|
||||
urh->was_closed = true;
|
||||
@@ -1352,9 +1352,9 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ ("Failed to forward to application "
|
||||
"%" PRIu64 \
|
||||
" bytes of data received from remote side: application shut down socket.\n"),
|
||||
_ ("Failed to forward to application %" PRIu64 \
|
||||
" bytes of data received from remote side: " \
|
||||
"application shut down socket.\n"),
|
||||
(uint64_t) urh->in_buffer_used);
|
||||
#endif
|
||||
|
||||
@@ -1519,10 +1519,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
|
||||
* persistent / unrecoverable error. */
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to forward to remote client "
|
||||
"%" PRIu64 \
|
||||
" bytes of data received from application: %s\n"),
|
||||
_ ("Failed to forward to remote client %" PRIu64 \
|
||||
" bytes of data received from application: %s\n"),
|
||||
(uint64_t) urh->out_buffer_used,
|
||||
gnutls_strerror ((int) res));
|
||||
#endif
|
||||
@@ -1589,10 +1587,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
|
||||
* persistent / unrecoverable error. */
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to forward to application "
|
||||
"%" PRIu64 \
|
||||
" bytes of data received from remote side: %s\n"),
|
||||
_ ("Failed to forward to application %" PRIu64 \
|
||||
" bytes of data received from remote side: %s\n"),
|
||||
(uint64_t) urh->in_buffer_used,
|
||||
MHD_socket_strerr_ (err));
|
||||
#endif
|
||||
@@ -1645,10 +1641,8 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
|
||||
#ifdef HAVE_MESSAGES
|
||||
if (0 < urh->out_buffer_used)
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to forward to remote client "
|
||||
"%" PRIu64 \
|
||||
" bytes of data received from application: daemon shut down.\n"),
|
||||
_ ("Failed to forward to remote client %" PRIu64 \
|
||||
" bytes of data received from application: daemon shut down.\n"),
|
||||
(uint64_t) urh->out_buffer_used);
|
||||
#endif
|
||||
/* Discard any data unsent to remote. */
|
||||
@@ -2254,8 +2248,8 @@ exit:
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to signal thread termination via inter-thread communication channel.\n"));
|
||||
_ ("Failed to signal thread termination via inter-thread " \
|
||||
"communication channel.\n"));
|
||||
#endif
|
||||
}
|
||||
return (MHD_THRD_RTRN_TYPE_) 0;
|
||||
@@ -2361,8 +2355,8 @@ psk_gnutls_adapter (gnutls_session_t session,
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"PSK authentication failed: gnutls_malloc failed to allocate memory.\n"));
|
||||
_ ("PSK authentication failed: gnutls_malloc failed to " \
|
||||
"allocate memory.\n"));
|
||||
#endif
|
||||
free (app_psk);
|
||||
return -1;
|
||||
@@ -2446,8 +2440,8 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
|
||||
/* above connection limit - reject */
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Server reached connection limit. Closing inbound connection.\n"));
|
||||
_ ("Server reached connection limit. " \
|
||||
"Closing inbound connection.\n"));
|
||||
#endif
|
||||
MHD_socket_close_chk_ (client_socket);
|
||||
#if defined(ENFILE) && (ENFILE + 0 != 0)
|
||||
@@ -2640,8 +2634,8 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
|
||||
default:
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to setup TLS credentials: unknown credential type %d.\n"),
|
||||
_ ("Failed to setup TLS credentials: " \
|
||||
"unknown credential type %d.\n"),
|
||||
daemon->cred_type);
|
||||
#endif
|
||||
gnutls_deinit (connection->tls_session);
|
||||
@@ -3212,15 +3206,15 @@ MHD_suspend_connection (struct MHD_Connection *connection)
|
||||
#endif /* MHD_USE_THREADS */
|
||||
|
||||
if (0 == (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
|
||||
MHD_PANIC (_ (
|
||||
"Cannot suspend connections without enabling MHD_ALLOW_SUSPEND_RESUME!\n"));
|
||||
MHD_PANIC (_ ("Cannot suspend connections without " \
|
||||
"enabling MHD_ALLOW_SUSPEND_RESUME!\n"));
|
||||
#ifdef UPGRADE_SUPPORT
|
||||
if (NULL != connection->urh)
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Error: connection scheduled for \"upgrade\" cannot be suspended.\n"));
|
||||
_ ("Error: connection scheduled for \"upgrade\" cannot " \
|
||||
"be suspended.\n"));
|
||||
#endif /* HAVE_MESSAGES */
|
||||
return;
|
||||
}
|
||||
@@ -3252,8 +3246,8 @@ MHD_resume_connection (struct MHD_Connection *connection)
|
||||
#endif /* MHD_USE_THREADS */
|
||||
|
||||
if (0 == (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
|
||||
MHD_PANIC (_ (
|
||||
"Cannot resume connections without enabling MHD_ALLOW_SUSPEND_RESUME!\n"));
|
||||
MHD_PANIC (_ ("Cannot resume connections without enabling " \
|
||||
"MHD_ALLOW_SUSPEND_RESUME!\n"));
|
||||
#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
|
||||
MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
|
||||
#endif
|
||||
@@ -3267,8 +3261,8 @@ MHD_resume_connection (struct MHD_Connection *connection)
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to signal resume via inter-thread communication channel.\n"));
|
||||
_ ("Failed to signal resume via inter-thread " \
|
||||
"communication channel.\n"));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -3445,8 +3439,8 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to signal resume of connection via inter-thread communication channel.\n"));
|
||||
_ ("Failed to signal resume of connection via " \
|
||||
"inter-thread communication channel.\n"));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -3559,8 +3553,7 @@ MHD_add_connection (struct MHD_Daemon *daemon,
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to suppress SIGPIPE on new client socket: %s\n"),
|
||||
_ ("Failed to suppress SIGPIPE on new client socket: %s\n"),
|
||||
MHD_socket_last_strerr_ ());
|
||||
#else /* ! HAVE_MESSAGES */
|
||||
(void) 0; /* Mute compiler warning */
|
||||
@@ -3911,8 +3904,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
|
||||
EPOLL_CTL_DEL,
|
||||
pos->socket_fd,
|
||||
NULL))
|
||||
MHD_PANIC (_ (
|
||||
"Failed to remove FD from epoll set.\n"));
|
||||
MHD_PANIC (_ ("Failed to remove FD from epoll set.\n"));
|
||||
pos->epoll_state &=
|
||||
~((enum MHD_EpollState)
|
||||
MHD_EPOLL_STATE_IN_EPOLL_SET);
|
||||
@@ -5794,8 +5786,8 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Using MHD_quiesce_daemon in this mode requires MHD_USE_ITC.\n"));
|
||||
_ ("Using MHD_quiesce_daemon in this mode " \
|
||||
"requires MHD_USE_ITC.\n"));
|
||||
#endif
|
||||
return MHD_INVALID_SOCKET;
|
||||
}
|
||||
@@ -5822,8 +5814,8 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
|
||||
if (MHD_ITC_IS_VALID_ (daemon->worker_pool[i].itc))
|
||||
{
|
||||
if (! MHD_itc_activate_ (daemon->worker_pool[i].itc, "q"))
|
||||
MHD_PANIC (_ (
|
||||
"Failed to signal quiesce via inter-thread communication channel.\n"));
|
||||
MHD_PANIC (_ ("Failed to signal quiesce via inter-thread " \
|
||||
"communication channel.\n"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -5845,8 +5837,8 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
|
||||
#endif
|
||||
if ( (MHD_ITC_IS_VALID_ (daemon->itc)) &&
|
||||
(! MHD_itc_activate_ (daemon->itc, "q")) )
|
||||
MHD_PANIC (_ (
|
||||
"failed to signal quiesce via inter-thread communication channel.\n"));
|
||||
MHD_PANIC (_ ("failed to signal quiesce via inter-thread " \
|
||||
"communication channel.\n"));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -6007,18 +5999,16 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Warning: Zero size, specified for thread pool size, is ignored. "
|
||||
"Thread pool is not used.\n"));
|
||||
_ ("Warning: Zero size, specified for thread pool size," \
|
||||
" is ignored. Thread pool is not used.\n"));
|
||||
#endif
|
||||
}
|
||||
else if (1 == daemon->worker_pool_size)
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Warning: \"1\", specified for thread pool size, is ignored. "
|
||||
"Thread pool is not used.\n"));
|
||||
_ ("Warning: \"1\", specified for thread pool size, " \
|
||||
"is ignored. Thread pool is not used.\n"));
|
||||
#endif
|
||||
daemon->worker_pool_size = 0;
|
||||
}
|
||||
@@ -6069,8 +6059,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#ifdef HAVE_MESSAGES
|
||||
else
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set.\n"),
|
||||
_ ("MHD HTTPS option %d passed to MHD but " \
|
||||
"MHD_USE_TLS not set.\n"),
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
@@ -6082,8 +6072,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#ifdef HAVE_MESSAGES
|
||||
else
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set.\n"),
|
||||
_ ("MHD HTTPS option %d passed to MHD but " \
|
||||
"MHD_USE_TLS not set.\n"),
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
@@ -6095,8 +6085,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#ifdef HAVE_MESSAGES
|
||||
else
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set.\n"),
|
||||
_ ("MHD HTTPS option %d passed to MHD but " \
|
||||
"MHD_USE_TLS not set.\n"),
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
@@ -6108,8 +6098,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#ifdef HAVE_MESSAGES
|
||||
else
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set.\n"),
|
||||
_ ("MHD HTTPS option %d passed to MHD but " \
|
||||
"MHD_USE_TLS not set.\n"),
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
@@ -6160,8 +6150,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#ifdef HAVE_MESSAGES
|
||||
else
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set.\n"),
|
||||
_ ("MHD HTTPS option %d passed to MHD but " \
|
||||
"MHD_USE_TLS not set.\n"),
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
@@ -6190,8 +6180,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#ifdef HAVE_MESSAGES
|
||||
else
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set.\n"),
|
||||
_ ("MHD HTTPS option %d passed to MHD but " \
|
||||
"MHD_USE_TLS not set.\n"),
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
@@ -6199,8 +6189,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#if GNUTLS_VERSION_MAJOR < 3
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD_OPTION_HTTPS_CERT_CALLBACK requires building MHD with GnuTLS >= 3.0.\n"));
|
||||
_ ("MHD_OPTION_HTTPS_CERT_CALLBACK requires building " \
|
||||
"MHD with GnuTLS >= 3.0.\n"));
|
||||
#endif
|
||||
return MHD_NO;
|
||||
#else
|
||||
@@ -6211,8 +6201,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#ifdef HAVE_MESSAGES
|
||||
else
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set.\n"),
|
||||
_ ("MHD HTTPS option %d passed to MHD but " \
|
||||
"MHD_USE_TLS not set.\n"),
|
||||
opt);
|
||||
#endif /* HAVE_MESSAGES */
|
||||
break;
|
||||
@@ -6221,8 +6211,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#if GNUTLS_VERSION_NUMBER < 0x030603
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD_OPTION_HTTPS_CERT_CALLBACK2 requires building MHD with GnuTLS >= 3.6.3.\n"));
|
||||
_ ("MHD_OPTION_HTTPS_CERT_CALLBACK2 requires building " \
|
||||
"MHD with GnuTLS >= 3.6.3.\n"));
|
||||
#endif
|
||||
return MHD_NO;
|
||||
#else
|
||||
@@ -6233,8 +6223,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
#ifdef HAVE_MESSAGES
|
||||
else
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set.\n"),
|
||||
_ ("MHD HTTPS option %d passed to MHD but " \
|
||||
"MHD_USE_TLS not set.\n"),
|
||||
opt);
|
||||
#endif /* HAVE_MESSAGES */
|
||||
break;
|
||||
@@ -6491,8 +6481,8 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
break;
|
||||
#else
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD HTTPS option %d passed to MHD compiled without GNUtls >= 3.\n"),
|
||||
_ ("MHD HTTPS option %d passed to MHD compiled " \
|
||||
"without GNUtls >= 3.\n"),
|
||||
opt);
|
||||
return MHD_NO;
|
||||
#endif
|
||||
@@ -6875,10 +6865,11 @@ MHD_start_daemon_va (unsigned int flags,
|
||||
(0 == (flags & MHD_USE_INTERNAL_POLLING_THREAD)) )
|
||||
{
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Warning: MHD_USE_THREAD_PER_CONNECTION must be used only with "
|
||||
"MHD_USE_INTERNAL_POLLING_THREAD. Flag MHD_USE_INTERNAL_POLLING_THREAD "
|
||||
"was added. Consider setting MHD_USE_INTERNAL_POLLING_THREAD explicitly.\n"));
|
||||
_ ("Warning: MHD_USE_THREAD_PER_CONNECTION must be used " \
|
||||
"only with MHD_USE_INTERNAL_POLLING_THREAD. " \
|
||||
"Flag MHD_USE_INTERNAL_POLLING_THREAD was added. " \
|
||||
"Consider setting MHD_USE_INTERNAL_POLLING_THREAD " \
|
||||
"explicitly.\n"));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -6919,8 +6910,8 @@ MHD_start_daemon_va (unsigned int flags,
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"file descriptor for inter-thread communication channel exceeds maximum value.\n"));
|
||||
_ ("file descriptor for inter-thread communication " \
|
||||
"channel exceeds maximum value.\n"));
|
||||
#endif
|
||||
MHD_itc_destroy_chk_ (daemon->itc);
|
||||
#ifdef HTTPS_SUPPORT
|
||||
@@ -7013,8 +7004,8 @@ MHD_start_daemon_va (unsigned int flags,
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"MHD thread polling only works with MHD_USE_INTERNAL_POLLING_THREAD.\n"));
|
||||
_ ("MHD thread polling only works with " \
|
||||
"MHD_USE_INTERNAL_POLLING_THREAD.\n"));
|
||||
#endif
|
||||
goto free_and_fail;
|
||||
}
|
||||
@@ -7111,8 +7102,8 @@ MHD_start_daemon_va (unsigned int flags,
|
||||
on this platform we cannot; fail hard */
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Cannot allow listening address reuse: SO_REUSEPORT not defined.\n"));
|
||||
_ ("Cannot allow listening address reuse: " \
|
||||
"SO_REUSEPORT not defined.\n"));
|
||||
#endif
|
||||
goto free_and_fail;
|
||||
#endif /* !MHD_WINSOCK_SOCKETS && !SO_REUSEPORT */
|
||||
@@ -7147,8 +7138,8 @@ MHD_start_daemon_va (unsigned int flags,
|
||||
#elif defined(MHD_WINSOCK_SOCKETS) /* SO_EXCLUSIVEADDRUSE not defined on W32? */
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Cannot disallow listening address reuse: SO_EXCLUSIVEADDRUSE not defined.\n"));
|
||||
_ ("Cannot disallow listening address reuse: " \
|
||||
"SO_EXCLUSIVEADDRUSE not defined.\n"));
|
||||
#endif
|
||||
goto free_and_fail;
|
||||
#endif /* MHD_WINSOCK_SOCKETS */
|
||||
@@ -7299,8 +7290,8 @@ MHD_start_daemon_va (unsigned int flags,
|
||||
/* should be impossible with `struct sockaddr_storage` */
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to get listen port number (`struct sockaddr_storage` too small!?).\n"));
|
||||
_ ("Failed to get listen port number " \
|
||||
"(`struct sockaddr_storage` too small!?).\n"));
|
||||
#endif /* HAVE_MESSAGES */
|
||||
}
|
||||
#ifndef __linux__
|
||||
@@ -7404,8 +7395,8 @@ MHD_start_daemon_va (unsigned int flags,
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Combining MHD_USE_THREAD_PER_CONNECTION and MHD_USE_EPOLL is not supported.\n"));
|
||||
_ ("Combining MHD_USE_THREAD_PER_CONNECTION and " \
|
||||
"MHD_USE_EPOLL is not supported.\n"));
|
||||
#endif
|
||||
goto free_and_fail;
|
||||
}
|
||||
@@ -7569,8 +7560,8 @@ MHD_start_daemon_va (unsigned int flags,
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Failed to create worker inter-thread communication channel: %s\n"),
|
||||
_ ("Failed to create worker inter-thread " \
|
||||
"communication channel: %s\n"),
|
||||
MHD_itc_last_strerror_ () );
|
||||
#endif
|
||||
MHD_mutex_destroy_chk_ (&d->new_connections_mutex);
|
||||
@@ -7583,8 +7574,8 @@ MHD_start_daemon_va (unsigned int flags,
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"File descriptor for worker inter-thread communication channel exceeds maximum value.\n"));
|
||||
_ ("File descriptor for worker inter-thread " \
|
||||
"communication channel exceeds maximum value.\n"));
|
||||
#endif
|
||||
MHD_itc_destroy_chk_ (d->itc);
|
||||
MHD_mutex_destroy_chk_ (&d->new_connections_mutex);
|
||||
@@ -7855,8 +7846,8 @@ close_all_connections (struct MHD_Daemon *daemon)
|
||||
while (NULL != susp)
|
||||
{
|
||||
if (NULL == susp->urh) /* "Upgraded" connection? */
|
||||
MHD_PANIC (_ (
|
||||
"MHD_stop_daemon() called while we have suspended connections.\n"));
|
||||
MHD_PANIC (_ ("MHD_stop_daemon() called while we have " \
|
||||
"suspended connections.\n"));
|
||||
#ifdef HTTPS_SUPPORT
|
||||
else if (used_tls &&
|
||||
used_thr_p_c &&
|
||||
@@ -7869,8 +7860,8 @@ close_all_connections (struct MHD_Daemon *daemon)
|
||||
#ifdef HAVE_MESSAGES
|
||||
if (! susp->urh->was_closed)
|
||||
MHD_DLOG (daemon,
|
||||
_ (
|
||||
"Initiated daemon shutdown while \"upgraded\" connection was not closed.\n"));
|
||||
_ ("Initiated daemon shutdown while \"upgraded\" " \
|
||||
"connection was not closed.\n"));
|
||||
#endif
|
||||
susp->urh->was_closed = true;
|
||||
/* If thread-per-connection is used, connection's thread
|
||||
@@ -7888,8 +7879,8 @@ close_all_connections (struct MHD_Daemon *daemon)
|
||||
else /* This 'else' is combined with next 'if' */
|
||||
#endif /* UPGRADE_SUPPORT */
|
||||
if (NULL != daemon->suspended_connections_head)
|
||||
MHD_PANIC (_ (
|
||||
"MHD_stop_daemon() called while we have suspended connections.\n"));
|
||||
MHD_PANIC (_ ("MHD_stop_daemon() called while we have " \
|
||||
"suspended connections.\n"));
|
||||
#if defined(UPGRADE_SUPPORT) && defined(HTTPS_SUPPORT)
|
||||
#ifdef MHD_USE_THREADS
|
||||
if (upg_allowed && used_tls && used_thr_p_c)
|
||||
@@ -7927,8 +7918,8 @@ close_all_connections (struct MHD_Daemon *daemon)
|
||||
if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
|
||||
(MHD_ITC_IS_VALID_ (daemon->itc)) &&
|
||||
(! MHD_itc_activate_ (daemon->itc, "e")) )
|
||||
MHD_PANIC (_ (
|
||||
"Failed to signal shutdown via inter-thread communication channel.\n"));
|
||||
MHD_PANIC (_ ("Failed to signal shutdown via inter-thread " \
|
||||
"communication channel.\n"));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -8025,8 +8016,8 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
|
||||
{
|
||||
if (! MHD_itc_activate_ (daemon->worker_pool[i].itc,
|
||||
"e"))
|
||||
MHD_PANIC (_ (
|
||||
"Failed to signal shutdown via inter-thread communication channel.\n"));
|
||||
MHD_PANIC (_ ("Failed to signal shutdown via inter-thread " \
|
||||
"communication channel.\n"));
|
||||
}
|
||||
else
|
||||
mhd_assert (MHD_INVALID_SOCKET != fd);
|
||||
@@ -8063,8 +8054,8 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
|
||||
{
|
||||
if (! MHD_itc_activate_ (daemon->itc,
|
||||
"e"))
|
||||
MHD_PANIC (_ (
|
||||
"Failed to signal shutdown via inter-thread communication channel.\n"));
|
||||
MHD_PANIC (_ ("Failed to signal shutdown via inter-thread " \
|
||||
"communication channel.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -8573,8 +8564,8 @@ MHD_init (void)
|
||||
gcry_check_version (NULL);
|
||||
#else
|
||||
if (NULL == gcry_check_version ("1.6.0"))
|
||||
MHD_PANIC (_ (
|
||||
"libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 or newer.\n"));
|
||||
MHD_PANIC (_ ("libgcrypt is too old. MHD was compiled for " \
|
||||
"libgcrypt 1.6.0 or newer.\n"));
|
||||
#endif
|
||||
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
|
||||
gnutls_global_init ();
|
||||
|
||||
@@ -54,13 +54,14 @@ MHD_create_post_processor (struct MHD_Connection *connection,
|
||||
(NULL == iter))
|
||||
MHD_PANIC (_ ("libmicrohttpd API violation.\n"));
|
||||
encoding = NULL;
|
||||
if (MHD_NO == MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_CONTENT_TYPE,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_CONTENT_TYPE),
|
||||
&encoding,
|
||||
NULL))
|
||||
if (MHD_NO ==
|
||||
MHD_lookup_connection_value_n (connection,
|
||||
MHD_HEADER_KIND,
|
||||
MHD_HTTP_HEADER_CONTENT_TYPE,
|
||||
MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_CONTENT_TYPE),
|
||||
&encoding,
|
||||
NULL))
|
||||
return NULL;
|
||||
mhd_assert (NULL != encoding);
|
||||
boundary = NULL;
|
||||
|
||||
@@ -623,8 +623,8 @@ _MHD_dumbClient_create (uint16_t port, const char *method, const char *url,
|
||||
int prn_size;
|
||||
memcpy (send_buf + clnt->req_size, MHD_HTTP_HEADER_CONTENT_LENGTH ": ",
|
||||
MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_LENGTH ": "));
|
||||
clnt->req_size += MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_CONTENT_LENGTH ": ");
|
||||
clnt->req_size +=
|
||||
MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_LENGTH ": ");
|
||||
prn_size = snprintf (send_buf + clnt->req_size,
|
||||
(buf_alloc_size - clnt->req_size),
|
||||
"%u", (unsigned int) req_body_size);
|
||||
|
||||
@@ -394,8 +394,9 @@ test_multipart_garbage (void)
|
||||
header.value =
|
||||
MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", boundary=AaB03x";
|
||||
header.header_size = MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_TYPE);
|
||||
header.value_size = MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", boundary=AaB03x");
|
||||
header.value_size =
|
||||
MHD_STATICSTR_LEN_ (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA \
|
||||
", boundary=AaB03x");
|
||||
header.kind = MHD_HEADER_KIND;
|
||||
pp = MHD_create_post_processor (&connection,
|
||||
1024, &value_checker, &want_off);
|
||||
|
||||
@@ -530,8 +530,8 @@ _MHD_dumbClient_create (uint16_t port, const char *method, const char *url,
|
||||
memcpy (send_buf + clnt->req_size,
|
||||
MHD_HTTP_HEADER_CONTENT_LENGTH ": ",
|
||||
MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_LENGTH ": "));
|
||||
clnt->req_size += MHD_STATICSTR_LEN_ (
|
||||
MHD_HTTP_HEADER_CONTENT_LENGTH ": ");
|
||||
clnt->req_size +=
|
||||
MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_LENGTH ": ");
|
||||
prn_size = snprintf (send_buf + clnt->req_size,
|
||||
(buf_alloc_size - clnt->req_size),
|
||||
"%u", (unsigned int) req_body_size);
|
||||
|
||||
@@ -249,9 +249,9 @@ check_result (const char *test_name,
|
||||
{
|
||||
char calc_str[SHA1_DIGEST_STRING_SIZE];
|
||||
bin2hex (calculated, SHA1_DIGEST_SIZE, calc_str);
|
||||
printf (
|
||||
"PASSED: %s check %u: calculated digest %s matches expected digest.\n",
|
||||
test_name, check_num, calc_str);
|
||||
printf ("PASSED: %s check %u: calculated digest %s matches " \
|
||||
"expected digest.\n",
|
||||
test_name, check_num, calc_str);
|
||||
fflush (stdout);
|
||||
}
|
||||
return failed ? 1 : 0;
|
||||
@@ -275,7 +275,7 @@ test1_str (void)
|
||||
uint8_t digest[SHA1_DIGEST_SIZE];
|
||||
|
||||
MHD_SHA1_init (&ctx);
|
||||
MHD_SHA1_update (&ctx, (const uint8_t*) data_units1[i].str_l.str,
|
||||
MHD_SHA1_update (&ctx, (const uint8_t *) data_units1[i].str_l.str,
|
||||
data_units1[i].str_l.len);
|
||||
MHD_SHA1_finish (&ctx, digest);
|
||||
num_failed += check_result (__FUNCTION__, i, digest,
|
||||
@@ -321,8 +321,8 @@ test2_str (void)
|
||||
size_t part_s = data_units1[i].str_l.len / 4;
|
||||
|
||||
MHD_SHA1_init (&ctx);
|
||||
MHD_SHA1_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, part_s);
|
||||
MHD_SHA1_update (&ctx, (const uint8_t*) data_units1[i].str_l.str + part_s,
|
||||
MHD_SHA1_update (&ctx, (const uint8_t *) data_units1[i].str_l.str, part_s);
|
||||
MHD_SHA1_update (&ctx, (const uint8_t *) data_units1[i].str_l.str + part_s,
|
||||
data_units1[i].str_l.len - part_s);
|
||||
MHD_SHA1_finish (&ctx, digest);
|
||||
num_failed += check_result (__FUNCTION__, i, digest,
|
||||
|
||||
@@ -427,9 +427,9 @@ check_result (const char *test_name,
|
||||
{
|
||||
char calc_str[SHA512_256_DIGEST_SIZE * 2 + 1];
|
||||
bin2hex (calculated, SHA512_256_DIGEST_SIZE, calc_str);
|
||||
printf (
|
||||
"PASSED: %s check %u: calculated digest %s matches expected digest.\n",
|
||||
test_name, check_num, calc_str);
|
||||
printf ("PASSED: %s check %u: calculated digest %s matches " \
|
||||
"expected digest.\n",
|
||||
test_name, check_num, calc_str);
|
||||
fflush (stdout);
|
||||
}
|
||||
return failed ? 1 : 0;
|
||||
|
||||
+179
-188
@@ -312,22 +312,22 @@ struct two_eq_strs
|
||||
};
|
||||
|
||||
static const struct two_eq_strs eq_strings[] = {
|
||||
{D_STR_W_LEN ("1234567890!@~%&$@#{}[]\\/!?`."), D_STR_W_LEN (
|
||||
"1234567890!@~%&$@#{}[]\\/!?`.")},
|
||||
{D_STR_W_LEN ("1234567890!@~%&$@#{}[]\\/!?`."),
|
||||
D_STR_W_LEN ("1234567890!@~%&$@#{}[]\\/!?`.")},
|
||||
{D_STR_W_LEN ("Simple string."), D_STR_W_LEN ("Simple string.")},
|
||||
{D_STR_W_LEN ("SIMPLE STRING."), D_STR_W_LEN ("SIMPLE STRING.")},
|
||||
{D_STR_W_LEN ("simple string."), D_STR_W_LEN ("simple string.")},
|
||||
{D_STR_W_LEN ("simple string."), D_STR_W_LEN ("Simple String.")},
|
||||
{D_STR_W_LEN ("sImPlE StRiNg."), D_STR_W_LEN ("SiMpLe sTrInG.")},
|
||||
{D_STR_W_LEN ("SIMPLE STRING."), D_STR_W_LEN ("simple string.")},
|
||||
{D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz"), D_STR_W_LEN (
|
||||
"abcdefghijklmnopqrstuvwxyz")},
|
||||
{D_STR_W_LEN ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), D_STR_W_LEN (
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ")},
|
||||
{D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz"), D_STR_W_LEN (
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ")},
|
||||
{D_STR_W_LEN ("zyxwvutsrqponMLKJIHGFEDCBA"), D_STR_W_LEN (
|
||||
"ZYXWVUTSRQPONmlkjihgfedcba")},
|
||||
{D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz"),
|
||||
D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz")},
|
||||
{D_STR_W_LEN ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
|
||||
D_STR_W_LEN ("ABCDEFGHIJKLMNOPQRSTUVWXYZ")},
|
||||
{D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz"),
|
||||
D_STR_W_LEN ("ABCDEFGHIJKLMNOPQRSTUVWXYZ")},
|
||||
{D_STR_W_LEN ("zyxwvutsrqponMLKJIHGFEDCBA"),
|
||||
D_STR_W_LEN ("ZYXWVUTSRQPONmlkjihgfedcba")},
|
||||
|
||||
{D_STR_W_LEN ("Cha\x8cne pour le test."),
|
||||
D_STR_W_LEN ("Cha\x8cne pour le test.")}, /* "Chaîne pour le test." in CP850 */
|
||||
@@ -445,21 +445,21 @@ struct two_neq_strs
|
||||
};
|
||||
|
||||
static const struct two_neq_strs neq_strings[] = {
|
||||
{D_STR_W_LEN ("1234567890!@~%&$@#{}[]\\/!?`."), D_STR_W_LEN (
|
||||
"1234567890!@~%&$@#{}[]\\/!?`"), 27},
|
||||
{D_STR_W_LEN (".1234567890!@~%&$@#{}[]\\/!?`."), D_STR_W_LEN (
|
||||
"1234567890!@~%&$@#{}[]\\/!?`"), 0},
|
||||
{D_STR_W_LEN ("1234567890!@~%&$@#{}[]\\/!?`."),
|
||||
D_STR_W_LEN ("1234567890!@~%&$@#{}[]\\/!?`"), 27},
|
||||
{D_STR_W_LEN (".1234567890!@~%&$@#{}[]\\/!?`."),
|
||||
D_STR_W_LEN ("1234567890!@~%&$@#{}[]\\/!?`"), 0},
|
||||
{D_STR_W_LEN ("Simple string."), D_STR_W_LEN ("Simple ctring."), 7},
|
||||
{D_STR_W_LEN ("simple string."), D_STR_W_LEN ("simple string"), 13},
|
||||
{D_STR_W_LEN ("simple strings"), D_STR_W_LEN ("Simple String."), 13},
|
||||
{D_STR_W_LEN ("sImPlE StRiNg."), D_STR_W_LEN ("SYMpLe sTrInG."), 1},
|
||||
{D_STR_W_LEN ("SIMPLE STRING."), D_STR_W_LEN ("simple string.2"), 14},
|
||||
{D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz,"), D_STR_W_LEN (
|
||||
"abcdefghijklmnopqrstuvwxyz."), 26},
|
||||
{D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz!"), D_STR_W_LEN (
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ?"), 26},
|
||||
{D_STR_W_LEN ("zyxwvutsrqponwMLKJIHGFEDCBA"), D_STR_W_LEN (
|
||||
"ZYXWVUTSRQPON%mlkjihgfedcba"), 13},
|
||||
{D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz,"),
|
||||
D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz."), 26},
|
||||
{D_STR_W_LEN ("abcdefghijklmnopqrstuvwxyz!"),
|
||||
D_STR_W_LEN ("ABCDEFGHIJKLMNOPQRSTUVWXYZ?"), 26},
|
||||
{D_STR_W_LEN ("zyxwvutsrqponwMLKJIHGFEDCBA"),
|
||||
D_STR_W_LEN ("ZYXWVUTSRQPON%mlkjihgfedcba"), 13},
|
||||
|
||||
{D_STR_W_LEN ("S\xbdur veulent plus d'\xbdufs."), /* "Sœur veulent plus d'œufs." in ISO-8859-15 */
|
||||
D_STR_W_LEN ("S\xbcUR VEULENT PLUS D'\xbcUFS."), 1}, /* "SŒUR VEULENT PLUS D'ŒUFS." in ISO-8859-15 */
|
||||
@@ -644,11 +644,12 @@ check_eq_strings_n (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 0 && \\\n"
|
||||
" MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) != 0, where N is 0..%u\n",
|
||||
n_prnt (t->s1.str), n_prnt (t->s2.str), n_prnt (t->s2.str),
|
||||
n_prnt (t->s1.str), (unsigned int) m_len + 1);
|
||||
printf ("PASSED: MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) " \
|
||||
"!= 0 && \\\n" \
|
||||
" MHD_str_equal_caseless_n_(\"%s\", \"%s\", N) " \
|
||||
"!= 0, where N is 0..%u\n",
|
||||
n_prnt (t->s1.str), n_prnt (t->s2.str), n_prnt (t->s2.str),
|
||||
n_prnt (t->s1.str), (unsigned int) m_len + 1);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -1174,14 +1175,14 @@ check_str_to_uint64_valid (void)
|
||||
"FAILED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64
|
||||
") converted string to value %"
|
||||
PRIu64 ","
|
||||
" while expecting result %" PRIu64 ". Locale: %s\n", n_prnt (
|
||||
t->str.str), rv, rv,
|
||||
" while expecting result %" PRIu64 ". Locale: %s\n",
|
||||
n_prnt (t->str.str), rv, rv,
|
||||
t->val, get_current_locale_str ());
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64 ") == %" PRIuPTR "\n",
|
||||
n_prnt (t->str.str), rv, rs);
|
||||
printf ("PASSED: MHD_str_to_uint64_(\"%s\", ->%" PRIu64 ") == %" \
|
||||
PRIuPTR "\n",
|
||||
n_prnt (t->str.str), rv, rs);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -1245,9 +1246,9 @@ check_str_to_uint64_all_chars (void)
|
||||
char test_str[] = "0123";
|
||||
test_str[0] = (char) (unsigned char) c; /* replace first char with non-digit char */
|
||||
|
||||
printf (
|
||||
"PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
printf ("PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1304,9 +1305,9 @@ check_str_to_uint64_overflow (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
printf ("PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -1362,9 +1363,9 @@ check_str_to_uint64_no_val (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
printf ("PASSED: MHD_str_to_uint64_(\"%s\", &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -1431,12 +1432,11 @@ check_str_to_uint64_n_valid (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR ", ->%"
|
||||
PRIu64 ")"
|
||||
" == %" PRIuPTR "\n", n_prnt (t->str.str),
|
||||
(uintptr_t) t->num_of_digt,
|
||||
(uintptr_t) t->str.len + 1, rv, rs);
|
||||
printf ("PASSED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR "..%"
|
||||
PRIuPTR ", ->%" PRIu64 ")" " == %" PRIuPTR "\n",
|
||||
n_prnt (t->str.str),
|
||||
(uintptr_t) t->num_of_digt,
|
||||
(uintptr_t) t->str.len + 1, rv, rs);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -1510,9 +1510,9 @@ check_str_to_uint64_n_all_chars (void)
|
||||
char test_str[] = "0123";
|
||||
test_str[0] = (char) (unsigned char) c; /* replace first char with non-digit char */
|
||||
|
||||
printf (
|
||||
"PASSED: MHD_str_to_uint64_n_(\"%s\", 0..5, &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
printf ("PASSED: MHD_str_to_uint64_n_(\"%s\", 0..5, &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1577,12 +1577,11 @@ check_str_to_uint64_n_overflow (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len,
|
||||
(uintptr_t) t->len + 1);
|
||||
printf ("PASSED: MHD_str_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len,
|
||||
(uintptr_t) t->len + 1);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -1646,11 +1645,10 @@ check_str_to_uint64_n_no_val (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_str_to_uint64_n_(\"%s\", 0..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len + 1);
|
||||
printf ("PASSED: MHD_str_to_uint64_n_(\"%s\", 0..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len + 1);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -1715,15 +1713,14 @@ check_strx_to_uint32_valid (void)
|
||||
"FAILED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64
|
||||
") converted string to value 0x%"
|
||||
PRIX64 ","
|
||||
" while expecting result 0x%" PRIX64 ". Locale: %s\n", n_prnt (
|
||||
t->str.str), (uint64_t) rv, (uint64_t) rv,
|
||||
" while expecting result 0x%" PRIX64 ". Locale: %s\n",
|
||||
n_prnt (t->str.str), (uint64_t) rv, (uint64_t) rv,
|
||||
t->val, get_current_locale_str ());
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64 ") == %" PRIuPTR
|
||||
"\n",
|
||||
n_prnt (t->str.str), (uint64_t) rv, rs);
|
||||
printf ("PASSED: MHD_strx_to_uint32_(\"%s\", ->0x%" PRIX64 ") == %"
|
||||
PRIuPTR "\n",
|
||||
n_prnt (t->str.str), (uint64_t) rv, rs);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -1792,9 +1789,9 @@ check_strx_to_uint32_all_chars (void)
|
||||
char test_str[] = "0123";
|
||||
test_str[0] = (char) (unsigned char) c; /* replace first char with non-digit char */
|
||||
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
printf ("PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1869,9 +1866,9 @@ check_strx_to_uint32_overflow (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (str));
|
||||
printf ("PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (str));
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -1928,9 +1925,9 @@ check_strx_to_uint32_no_val (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
printf ("PASSED: MHD_strx_to_uint32_(\"%s\", &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -2086,9 +2083,9 @@ check_strx_to_uint32_n_all_chars (void)
|
||||
char test_str[] = "0123";
|
||||
test_str[0] = (char) (unsigned char) c; /* replace first char with non-digit char */
|
||||
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint32_n_(\"%s\", 0..5, &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
printf ("PASSED: MHD_strx_to_uint32_n_(\"%s\", 0..5, &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2186,12 +2183,11 @@ check_strx_to_uint32_n_overflow (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (str),
|
||||
(uintptr_t) min_len,
|
||||
(uintptr_t) max_len);
|
||||
printf ("PASSED: MHD_strx_to_uint32_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (str),
|
||||
(uintptr_t) min_len,
|
||||
(uintptr_t) max_len);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -2256,11 +2252,10 @@ check_strx_to_uint32_n_no_val (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint32_n_(\"%s\", 0..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len + 1);
|
||||
printf ("PASSED: MHD_strx_to_uint32_n_(\"%s\", 0..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len + 1);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -2326,10 +2321,9 @@ check_strx_to_uint64_valid (void)
|
||||
t->val, get_current_locale_str ());
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64 ") == %" PRIuPTR
|
||||
"\n",
|
||||
n_prnt (t->str.str), rv, rs);
|
||||
printf ("PASSED: MHD_strx_to_uint64_(\"%s\", ->0x%" PRIX64 ") == %"
|
||||
PRIuPTR "\n",
|
||||
n_prnt (t->str.str), rv, rs);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -2397,9 +2391,9 @@ check_strx_to_uint64_all_chars (void)
|
||||
char test_str[] = "0123";
|
||||
test_str[0] = (char) (unsigned char) c; /* replace first char with non-digit char */
|
||||
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
printf ("PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2456,9 +2450,9 @@ check_strx_to_uint64_overflow (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
printf ("PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -2514,9 +2508,9 @@ check_strx_to_uint64_no_val (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
printf ("PASSED: MHD_strx_to_uint64_(\"%s\", &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (t->str));
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -2583,13 +2577,12 @@ check_strx_to_uint64_n_valid (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
|
||||
", ->0x%"
|
||||
PRIX64 ")"
|
||||
" == %" PRIuPTR "\n", n_prnt (t->str.str),
|
||||
(uintptr_t) t->num_of_digt,
|
||||
(uintptr_t) t->str.len + 1, rv, rs);
|
||||
printf ("PASSED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
|
||||
", ->0x%"
|
||||
PRIX64 ")"
|
||||
" == %" PRIuPTR "\n", n_prnt (t->str.str),
|
||||
(uintptr_t) t->num_of_digt,
|
||||
(uintptr_t) t->str.len + 1, rv, rs);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -2668,9 +2661,9 @@ check_strx_to_uint64_n_all_chars (void)
|
||||
char test_str[] = "0123";
|
||||
test_str[0] = (char) (unsigned char) c; /* replace first char with non-digit char */
|
||||
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint64_n_(\"%s\", 0..5, &ret_val) == 0, value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
printf ("PASSED: MHD_strx_to_uint64_n_(\"%s\", 0..5, &ret_val) == 0, "
|
||||
"value of ret_val is unmodified\n",
|
||||
n_prnt (test_str));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2736,12 +2729,11 @@ check_strx_to_uint64_n_overflow (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len,
|
||||
(uintptr_t) t->len + 1);
|
||||
printf ("PASSED: MHD_strx_to_uint64_n_(\"%s\", %" PRIuPTR "..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len,
|
||||
(uintptr_t) t->len + 1);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -2806,11 +2798,10 @@ check_strx_to_uint64_n_no_val (void)
|
||||
}
|
||||
}
|
||||
if ((verbose > 1) && (j == locale_name_count - 1) && ! c_failed[i])
|
||||
printf (
|
||||
"PASSED: MHD_strx_to_uint64_n_(\"%s\", 0..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len + 1);
|
||||
printf ("PASSED: MHD_strx_to_uint64_n_(\"%s\", 0..%" PRIuPTR
|
||||
", &ret_val) == 0,"
|
||||
" value of ret_val is unmodified\n", n_prnt (t->str),
|
||||
(uintptr_t) t->len + 1);
|
||||
}
|
||||
}
|
||||
return t_failed;
|
||||
@@ -2847,8 +2838,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_str_to_uint64_all_chars() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_to_uint64_all_chars() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_to_uint64_all_chars() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_str_to_uint64_overflow ();
|
||||
if (res != 0)
|
||||
@@ -2858,8 +2849,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_str_to_uint64_overflow() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_to_uint64_overflow() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_to_uint64_overflow() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_str_to_uint64_no_val ();
|
||||
if (res != 0)
|
||||
@@ -2869,8 +2860,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_str_to_uint64_no_val() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_to_uint64_no_val() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_to_uint64_no_val() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
if (str_to_uint64_fails)
|
||||
fprintf (stderr,
|
||||
@@ -2878,8 +2869,8 @@ run_str_to_X_tests (void)
|
||||
(unsigned long) str_to_uint64_fails,
|
||||
str_to_uint64_fails == 1 ? "" : "s");
|
||||
else if (verbose > 0)
|
||||
printf (
|
||||
"PASSED: function MHD_str_to_uint64_() successfully passed all checks.\n\n");
|
||||
printf ("PASSED: function MHD_str_to_uint64_() successfully "
|
||||
"passed all checks.\n\n");
|
||||
|
||||
res = check_str_to_uint64_n_valid ();
|
||||
if (res != 0)
|
||||
@@ -2889,8 +2880,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_str_to_uint64_n_valid() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_to_uint64_n_valid() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_to_uint64_n_valid() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_str_to_uint64_n_all_chars ();
|
||||
if (res != 0)
|
||||
@@ -2900,8 +2891,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_str_to_uint64_n_all_chars() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_to_uint64_n_all_chars() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_to_uint64_n_all_chars() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_str_to_uint64_n_overflow ();
|
||||
if (res != 0)
|
||||
@@ -2911,8 +2902,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_str_to_uint64_n_overflow() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_to_uint64_n_overflow() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_to_uint64_n_overflow() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_str_to_uint64_n_no_val ();
|
||||
if (res != 0)
|
||||
@@ -2922,8 +2913,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_str_to_uint64_n_no_val() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_to_uint64_n_no_val() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_to_uint64_n_no_val() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
if (str_to_uint64_n_fails)
|
||||
fprintf (stderr,
|
||||
@@ -2931,8 +2922,8 @@ run_str_to_X_tests (void)
|
||||
(unsigned long) str_to_uint64_n_fails,
|
||||
str_to_uint64_n_fails == 1 ? "" : "s");
|
||||
else if (verbose > 0)
|
||||
printf (
|
||||
"PASSED: function MHD_str_to_uint64_n_() successfully passed all checks.\n\n");
|
||||
printf ("PASSED: function MHD_str_to_uint64_n_() successfully "
|
||||
"passed all checks.\n\n");
|
||||
|
||||
res = check_strx_to_uint32_valid ();
|
||||
if (res != 0)
|
||||
@@ -2942,8 +2933,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint32_valid() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint32_valid() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint32_valid() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint32_all_chars ();
|
||||
if (res != 0)
|
||||
@@ -2953,8 +2944,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint32_all_chars() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint32_all_chars() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint32_all_chars() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint32_overflow ();
|
||||
if (res != 0)
|
||||
@@ -2964,8 +2955,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint32_overflow() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint32_overflow() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint32_overflow() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint32_no_val ();
|
||||
if (res != 0)
|
||||
@@ -2975,8 +2966,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint32_no_val() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint32_no_val() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint32_no_val() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
if (strx_to_uint32_fails)
|
||||
fprintf (stderr,
|
||||
@@ -2984,8 +2975,8 @@ run_str_to_X_tests (void)
|
||||
(unsigned long) strx_to_uint32_fails,
|
||||
strx_to_uint32_fails == 1 ? "" : "s");
|
||||
else if (verbose > 0)
|
||||
printf (
|
||||
"PASSED: function MHD_strx_to_uint32_() successfully passed all checks.\n\n");
|
||||
printf ("PASSED: function MHD_strx_to_uint32_() successfully "
|
||||
"passed all checks.\n\n");
|
||||
|
||||
res = check_strx_to_uint32_n_valid ();
|
||||
if (res != 0)
|
||||
@@ -2995,8 +2986,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint32_n_valid() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint32_n_valid() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint32_n_valid() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint32_n_all_chars ();
|
||||
if (res != 0)
|
||||
@@ -3006,8 +2997,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint32_n_all_chars() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint32_n_all_chars() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint32_n_all_chars() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint32_n_overflow ();
|
||||
if (res != 0)
|
||||
@@ -3017,8 +3008,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint32_n_overflow() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint32_n_overflow() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint32_n_overflow() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint32_n_no_val ();
|
||||
if (res != 0)
|
||||
@@ -3028,8 +3019,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint32_n_no_val() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint32_n_no_val() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint32_n_no_val() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
if (strx_to_uint32_n_fails)
|
||||
fprintf (stderr,
|
||||
@@ -3037,8 +3028,8 @@ run_str_to_X_tests (void)
|
||||
(unsigned long) strx_to_uint32_n_fails,
|
||||
strx_to_uint32_n_fails == 1 ? "" : "s");
|
||||
else if (verbose > 0)
|
||||
printf (
|
||||
"PASSED: function MHD_strx_to_uint32_n_() successfully passed all checks.\n\n");
|
||||
printf ("PASSED: function MHD_strx_to_uint32_n_() successfully "
|
||||
"passed all checks.\n\n");
|
||||
|
||||
res = check_strx_to_uint64_valid ();
|
||||
if (res != 0)
|
||||
@@ -3048,8 +3039,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint64_valid() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint64_valid() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint64_valid() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint64_all_chars ();
|
||||
if (res != 0)
|
||||
@@ -3059,8 +3050,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint64_all_chars() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint64_all_chars() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint64_all_chars() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint64_overflow ();
|
||||
if (res != 0)
|
||||
@@ -3070,8 +3061,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint64_overflow() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint64_overflow() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint64_overflow() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint64_no_val ();
|
||||
if (res != 0)
|
||||
@@ -3081,8 +3072,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint64_no_val() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint64_no_val() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint64_no_val() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
if (strx_to_uint64_fails)
|
||||
fprintf (stderr,
|
||||
@@ -3090,8 +3081,8 @@ run_str_to_X_tests (void)
|
||||
(unsigned long) strx_to_uint64_fails,
|
||||
strx_to_uint64_fails == 1 ? "" : "s");
|
||||
else if (verbose > 0)
|
||||
printf (
|
||||
"PASSED: function MHD_strx_to_uint64_() successfully passed all checks.\n\n");
|
||||
printf ("PASSED: function MHD_strx_to_uint64_() successfully "
|
||||
"passed all checks.\n\n");
|
||||
|
||||
res = check_strx_to_uint64_n_valid ();
|
||||
if (res != 0)
|
||||
@@ -3101,8 +3092,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint64_n_valid() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint64_n_valid() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint64_n_valid() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint64_n_all_chars ();
|
||||
if (res != 0)
|
||||
@@ -3112,8 +3103,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint64_n_all_chars() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint64_n_all_chars() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint64_n_all_chars() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint64_n_overflow ();
|
||||
if (res != 0)
|
||||
@@ -3123,8 +3114,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint64_n_overflow() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint64_n_overflow() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint64_n_overflow() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
res = check_strx_to_uint64_n_no_val ();
|
||||
if (res != 0)
|
||||
@@ -3134,8 +3125,8 @@ run_str_to_X_tests (void)
|
||||
"FAILED: testcase check_strx_to_uint64_n_no_val() failed.\n\n");
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_to_uint64_n_no_val() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_to_uint64_n_no_val() "
|
||||
"successfully passed.\n\n");
|
||||
|
||||
if (strx_to_uint64_n_fails)
|
||||
fprintf (stderr,
|
||||
@@ -3143,8 +3134,8 @@ run_str_to_X_tests (void)
|
||||
(unsigned long) strx_to_uint64_n_fails,
|
||||
strx_to_uint64_n_fails == 1 ? "" : "s");
|
||||
else if (verbose > 0)
|
||||
printf (
|
||||
"PASSED: function MHD_strx_to_uint64_n_() successfully passed all checks.\n\n");
|
||||
printf ("PASSED: function MHD_strx_to_uint64_n_() successfully "
|
||||
"passed all checks.\n\n");
|
||||
|
||||
if (str_to_uint64_fails || str_to_uint64_n_fails ||
|
||||
strx_to_uint32_fails || strx_to_uint32_n_fails ||
|
||||
@@ -4454,8 +4445,8 @@ run_str_from_X_tests (void)
|
||||
failures += str_from_uint16;
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_from_uint16() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_from_uint16() successfully "
|
||||
"passed.\n\n");
|
||||
|
||||
str_from_uint64 = check_str_from_uint64 ();
|
||||
if (str_from_uint64 != 0)
|
||||
@@ -4465,8 +4456,8 @@ run_str_from_X_tests (void)
|
||||
failures += str_from_uint64;
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_from_uint16() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_from_uint16() successfully "
|
||||
"passed.\n\n");
|
||||
strx_from_uint32 = check_strx_from_uint32 ();
|
||||
if (strx_from_uint32 != 0)
|
||||
{
|
||||
@@ -4475,8 +4466,8 @@ run_str_from_X_tests (void)
|
||||
failures += strx_from_uint32;
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_strx_from_uint32() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_strx_from_uint32() successfully "
|
||||
"passed.\n\n");
|
||||
|
||||
str_from_uint8_pad = check_str_from_uint8_pad ();
|
||||
if (str_from_uint8_pad != 0)
|
||||
@@ -4486,8 +4477,8 @@ run_str_from_X_tests (void)
|
||||
failures += str_from_uint8_pad;
|
||||
}
|
||||
else if (verbose > 1)
|
||||
printf (
|
||||
"PASSED: testcase check_str_from_uint8_pad() successfully passed.\n\n");
|
||||
printf ("PASSED: testcase check_str_from_uint8_pad() successfully "
|
||||
"passed.\n\n");
|
||||
|
||||
if (failures)
|
||||
{
|
||||
|
||||
@@ -353,8 +353,8 @@ wr_create_tls_sckt (void)
|
||||
{
|
||||
if (GNUTLS_E_SUCCESS == gnutls_set_default_priority (s->tls_s))
|
||||
{
|
||||
if (GNUTLS_E_SUCCESS == gnutls_certificate_allocate_credentials (
|
||||
&(s->tls_crd)))
|
||||
if (GNUTLS_E_SUCCESS ==
|
||||
gnutls_certificate_allocate_credentials (&(s->tls_crd)))
|
||||
{
|
||||
if (GNUTLS_E_SUCCESS == gnutls_credentials_set (s->tls_s,
|
||||
GNUTLS_CRD_CERTIFICATE,
|
||||
|
||||
@@ -519,8 +519,8 @@ wr_create_tls_sckt (void)
|
||||
{
|
||||
if (GNUTLS_E_SUCCESS == gnutls_set_default_priority (s->tls_s))
|
||||
{
|
||||
if (GNUTLS_E_SUCCESS == gnutls_certificate_allocate_credentials (
|
||||
&(s->tls_crd)))
|
||||
if (GNUTLS_E_SUCCESS ==
|
||||
gnutls_certificate_allocate_credentials (&(s->tls_crd)))
|
||||
{
|
||||
if (GNUTLS_E_SUCCESS == gnutls_credentials_set (s->tls_s,
|
||||
GNUTLS_CRD_CERTIFICATE,
|
||||
|
||||
@@ -711,8 +711,8 @@ testsuite_curl_global_init (void)
|
||||
res = curl_global_init (CURL_GLOBAL_ALL);
|
||||
if (CURLE_OK != res)
|
||||
{
|
||||
fprintf (stderr, "libcurl initialisation error: %s\n", curl_easy_strerror (
|
||||
res));
|
||||
fprintf (stderr, "libcurl initialisation error: %s\n",
|
||||
curl_easy_strerror (res));
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -119,15 +119,15 @@ testLongUrlGet (size_t buff_size)
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
port,
|
||||
&apc_all,
|
||||
NULL,
|
||||
&ahc_echo,
|
||||
"GET",
|
||||
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
|
||||
(size_t) buff_size, MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
port,
|
||||
&apc_all,
|
||||
NULL,
|
||||
&ahc_echo,
|
||||
"GET",
|
||||
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
|
||||
(size_t) buff_size, MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 1;
|
||||
if (0 == port)
|
||||
@@ -213,15 +213,15 @@ testLongHeaderGet (size_t buff_size)
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
port,
|
||||
&apc_all,
|
||||
NULL,
|
||||
&ahc_echo,
|
||||
"GET",
|
||||
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
|
||||
(size_t) buff_size, MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
port,
|
||||
&apc_all,
|
||||
NULL,
|
||||
&ahc_echo,
|
||||
"GET",
|
||||
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
|
||||
(size_t) buff_size, MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 16;
|
||||
if (0 == port)
|
||||
|
||||
@@ -116,9 +116,9 @@ testInternalGet ()
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 1;
|
||||
zzuf_socat_start ();
|
||||
|
||||
@@ -158,9 +158,9 @@ testInternalGet ()
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 1;
|
||||
zzuf_socat_start ();
|
||||
|
||||
@@ -119,15 +119,15 @@ testLongUrlGet ()
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080,
|
||||
&apc_all,
|
||||
NULL,
|
||||
&ahc_echo,
|
||||
"GET",
|
||||
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
|
||||
(size_t) (VERY_LONG / 2), MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080,
|
||||
&apc_all,
|
||||
NULL,
|
||||
&ahc_echo,
|
||||
"GET",
|
||||
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
|
||||
(size_t) (VERY_LONG / 2), MHD_OPTION_END);
|
||||
|
||||
if (d == NULL)
|
||||
return 1;
|
||||
@@ -187,15 +187,15 @@ testLongHeaderGet ()
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080,
|
||||
&apc_all,
|
||||
NULL,
|
||||
&ahc_echo,
|
||||
"GET",
|
||||
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
|
||||
(size_t) (VERY_LONG / 2), MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080,
|
||||
&apc_all,
|
||||
NULL,
|
||||
&ahc_echo,
|
||||
"GET",
|
||||
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
|
||||
(size_t) (VERY_LONG / 2), MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 16;
|
||||
zzuf_socat_start ();
|
||||
|
||||
@@ -172,11 +172,11 @@ testInternalPost ()
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080, NULL, NULL, &ahc_echo, NULL,
|
||||
MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
|
||||
MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080, NULL, NULL, &ahc_echo, NULL,
|
||||
MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
|
||||
MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 1;
|
||||
zzuf_socat_start ();
|
||||
|
||||
@@ -192,11 +192,11 @@ testInternalPost ()
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080, NULL, NULL, &ahc_echo, NULL,
|
||||
MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
|
||||
MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080, NULL, NULL, &ahc_echo, NULL,
|
||||
MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
|
||||
MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 1;
|
||||
zzuf_socat_start ();
|
||||
|
||||
@@ -141,10 +141,10 @@ testInternalPut ()
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080,
|
||||
NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080,
|
||||
NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 1;
|
||||
zzuf_socat_start ();
|
||||
|
||||
@@ -155,10 +155,10 @@ testInternalPut ()
|
||||
cbc.buf = buf;
|
||||
cbc.size = 2048;
|
||||
cbc.pos = 0;
|
||||
d = MHD_start_daemon (
|
||||
MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080,
|
||||
NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
|
||||
d =
|
||||
MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD /* | MHD_USE_ERROR_LOG */,
|
||||
11080,
|
||||
NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 1;
|
||||
zzuf_socat_start ();
|
||||
|
||||
Reference in New Issue
Block a user