[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] branch master updated: Partial revert of 82abaee62f000d3
From: |
gnunet |
Subject: |
[libmicrohttpd] branch master updated: Partial revert of 82abaee62f000d379646ee412af45a1f8a1ddc87 |
Date: |
Tue, 07 Jun 2022 18:51:33 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
The following commit(s) were added to refs/heads/master by this push:
new c375e5aa Partial revert of 82abaee62f000d379646ee412af45a1f8a1ddc87
c375e5aa is described below
commit c375e5aa1cb4e5976b98470e840d8ebc99bf5d14
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Jun 7 19:51:20 2022 +0300
Partial revert of 82abaee62f000d379646ee412af45a1f8a1ddc87
No need to process part of code if some variables length are zeros.
Non-NULL pointers can point to zero-length strings, but if pointer is
NULL the length is always zero.
For example 'req_body' could be not be NULL, but as long as
'req_body_size' is zero, no chunk must be added.
---
src/microhttpd/test_set_panic.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/microhttpd/test_set_panic.c b/src/microhttpd/test_set_panic.c
index 554155fb..1777dc0f 100644
--- a/src/microhttpd/test_set_panic.c
+++ b/src/microhttpd/test_set_panic.c
@@ -553,11 +553,9 @@ _MHD_dumbClient_create (uint16_t port, const char *method,
const char *url,
": chunked\r\n");
}
}
- if (NULL != add_headers)
+ if (0 != add_hdrs_size)
{
- memcpy (send_buf + clnt->req_size,
- add_headers,
- add_hdrs_size);
+ memcpy (send_buf + clnt->req_size, add_headers, add_hdrs_size);
clnt->req_size += add_hdrs_size;
}
/* Terminate header */
@@ -567,7 +565,7 @@ _MHD_dumbClient_create (uint16_t port, const char *method,
const char *url,
/* Add body (if any) */
if (! chunked)
{
- if (NULL != req_body)
+ if (0 != req_body_size)
{
memcpy (send_buf + clnt->req_size, req_body, req_body_size);
clnt->req_size += req_body_size;
@@ -575,7 +573,7 @@ _MHD_dumbClient_create (uint16_t port, const char *method,
const char *url,
}
else
{
- if (NULL != req_body)
+ if (0 != req_body_size)
{
int prn_size;
prn_size = snprintf (send_buf + clnt->req_size,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libmicrohttpd] branch master updated: Partial revert of 82abaee62f000d379646ee412af45a1f8a1ddc87,
gnunet <=