mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
Fixes for 32-bit platforms
This commit is contained in:
@@ -524,8 +524,10 @@ post_iterator (void *cls,
|
||||
}
|
||||
if (0 == strcmp ("v1", key))
|
||||
{
|
||||
if (size + off > sizeof(session->value_1))
|
||||
size = sizeof (session->value_1) - off;
|
||||
if (off >= sizeof(session->value_1) - 1)
|
||||
return MHD_YES; /* Discard extra data */
|
||||
if (size + off >= sizeof(session->value_1))
|
||||
size = (size_t) (sizeof (session->value_1) - off - 1); /* crop extra data */
|
||||
memcpy (&session->value_1[off],
|
||||
data,
|
||||
size);
|
||||
@@ -535,8 +537,10 @@ post_iterator (void *cls,
|
||||
}
|
||||
if (0 == strcmp ("v2", key))
|
||||
{
|
||||
if (size + off > sizeof(session->value_2))
|
||||
size = sizeof (session->value_2) - off;
|
||||
if (off >= sizeof(session->value_2) - 1)
|
||||
return MHD_YES; /* Discard extra data */
|
||||
if (size + off >= sizeof(session->value_2))
|
||||
size = (size_t) (sizeof (session->value_2) - off - 1); /* crop extra data */
|
||||
memcpy (&session->value_2[off],
|
||||
data,
|
||||
size);
|
||||
|
||||
@@ -62,7 +62,7 @@ callback (void *cls,
|
||||
if (buf_size < (param->response_size - pos))
|
||||
size_to_copy = buf_size;
|
||||
else
|
||||
size_to_copy = param->response_size - pos;
|
||||
size_to_copy = (size_t) (param->response_size - pos);
|
||||
|
||||
memcpy (buf, param->response_data + pos, size_to_copy);
|
||||
|
||||
|
||||
@@ -520,8 +520,10 @@ post_iterator (void *cls,
|
||||
}
|
||||
if (0 == strcmp ("v1", key))
|
||||
{
|
||||
if (off >= sizeof(session->value_1) - 1)
|
||||
return MHD_YES; /* Discard extra data */
|
||||
if (size + off >= sizeof(session->value_1))
|
||||
size = sizeof (session->value_1) - off - 1;
|
||||
size = (size_t) (sizeof (session->value_1) - off - 1); /* crop extra data */
|
||||
memcpy (&session->value_1[off],
|
||||
data,
|
||||
size);
|
||||
@@ -530,8 +532,10 @@ post_iterator (void *cls,
|
||||
}
|
||||
if (0 == strcmp ("v2", key))
|
||||
{
|
||||
if (off >= sizeof(session->value_2) - 1)
|
||||
return MHD_YES; /* Discard extra data */
|
||||
if (size + off >= sizeof(session->value_2))
|
||||
size = sizeof (session->value_2) - off - 1;
|
||||
size = (size_t) (sizeof (session->value_2) - off - 1); /* crop extra data */
|
||||
memcpy (&session->value_2[off],
|
||||
data,
|
||||
size);
|
||||
|
||||
@@ -183,7 +183,8 @@ value_checker (void *cls,
|
||||
(mismatch (filename, expect->fname)) ||
|
||||
(mismatch (content_type, expect->cnt_type)) ||
|
||||
(mismatch (transfer_encoding, expect->tr_enc)) ||
|
||||
(mismatch2 (data, expect->data, off, size)))
|
||||
(strlen (expect->data) < off) ||
|
||||
(mismatch2 (data, expect->data, (size_t) off, size)))
|
||||
{
|
||||
*idxp = (unsigned int) -1;
|
||||
fprintf (stderr,
|
||||
@@ -208,7 +209,8 @@ value_checker (void *cls,
|
||||
(mismatch (filename, expect->fname)),
|
||||
(mismatch (content_type, expect->cnt_type)),
|
||||
(mismatch (transfer_encoding, expect->tr_enc)),
|
||||
(mismatch2 (data, expect->data, off, size)));
|
||||
(strlen (expect->data) < off)
|
||||
|| (mismatch2 (data, expect->data, (size_t) off, size)));
|
||||
return MHD_NO;
|
||||
}
|
||||
if ( ( (NULL == expect->data) &&
|
||||
|
||||
@@ -44,7 +44,15 @@
|
||||
/**
|
||||
* How many requests do we do in parallel?
|
||||
*/
|
||||
#define PAR (MHD_CPU_COUNT * 4)
|
||||
#if SIZEOF_SIZE_T >= 8 || MHD_CPU_COUNT < 8
|
||||
# define PAR (MHD_CPU_COUNT * 4)
|
||||
#elif MHD_CPU_COUNT < 16
|
||||
/* Limit load */
|
||||
# define PAR (MHD_CPU_COUNT * 2)
|
||||
#else
|
||||
/* Limit load */
|
||||
# define PAR (MHD_CPU_COUNT * 1)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Do we use HTTP 1.1?
|
||||
|
||||
Reference in New Issue
Block a user