[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] branch master updated: fixing #7772 exactly as suggested
From: |
gnunet |
Subject: |
[libmicrohttpd] branch master updated: fixing #7772 exactly as suggested by reporter |
Date: |
Sun, 03 Sep 2023 00:49:54 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libmicrohttpd.
The following commit(s) were added to refs/heads/master by this push:
new fabafbaa fixing #7772 exactly as suggested by reporter
fabafbaa is described below
commit fabafbaaafe2c6f8154d4f429f47f296639ff9ca
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Sun Sep 3 00:49:49 2023 +0200
fixing #7772 exactly as suggested by reporter
---
src/microhttpd/connection.c | 14 ++++++++------
src/microhttpd/digestauth.c | 8 ++++++--
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index b7a9a31a..a785f7c0 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1935,7 +1935,6 @@ connection_maximize_write_buffer (struct MHD_Connection
*connection)
}
-#if 0 /* disable unused function */
/**
* Shrink connection write buffer to the size of unsent data.
*
@@ -1955,7 +1954,8 @@ connection_shrink_write_buffer (struct MHD_Connection
*connection)
mhd_assert (c->write_buffer_append_offset >= c->write_buffer_send_offset);
mhd_assert (c->write_buffer_size >= c->write_buffer_append_offset);
- if ( (NULL == c->write_buffer) || (0 == c->write_buffer_size))
+ if ( (NULL == c->write_buffer) ||
+ (0 == c->write_buffer_size) )
{
mhd_assert (0 == c->write_buffer_append_offset);
mhd_assert (0 == c->write_buffer_send_offset);
@@ -1965,7 +1965,9 @@ connection_shrink_write_buffer (struct MHD_Connection
*connection)
if (c->write_buffer_append_offset == c->write_buffer_size)
return;
- new_buf = MHD_pool_reallocate (pool, c->write_buffer, c->write_buffer_size,
+ new_buf = MHD_pool_reallocate (pool,
+ c->write_buffer,
+ c->write_buffer_size,
c->write_buffer_append_offset);
mhd_assert ((c->write_buffer == new_buf) || \
(0 == c->write_buffer_append_offset));
@@ -1977,9 +1979,6 @@ connection_shrink_write_buffer (struct MHD_Connection
*connection)
}
-#endif /* unused function */
-
-
/**
* Switch connection from recv mode to send mode.
*
@@ -6626,6 +6625,9 @@ MHD_connection_handle_idle (struct MHD_Connection
*connection)
#ifdef UPGRADE_SUPPORT
if (NULL != connection->rp.response->upgrade_handler)
{
+ /* We may start to read again after the header,
+ so shrink the write buffer again */
+ connection_shrink_write_buffer (connection);
connection->state = MHD_CONNECTION_UPGRADE;
/* This connection is "upgraded". Pass socket to application. */
if (MHD_NO ==
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index ed2610c2..87623750 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -1459,7 +1459,7 @@ MHD_digest_auth_get_username (struct MHD_Connection
*connection)
* The current format of the nonce is ...
* H(timestamp:random data:various parameters) + Hex(timestamp)
*
- * @param nonce_time The amount of time in seconds for a nonce to be invalid
+ * @param nonce_time The amount of time in seconds for a nonce to be valid
* @param mthd_e HTTP method as enum value
* @param method HTTP method as a string
* @param rnd the pointer to a character array for the random seed
@@ -1786,7 +1786,11 @@ calculate_add_nonce_with_retry (struct MHD_Connection
*const connection,
"are predictable.\n"));
#endif
- if (! calculate_add_nonce (connection, timestamp1, realm, realm_len, da,
+ if (! calculate_add_nonce (connection,
+ timestamp1,
+ realm,
+ realm_len,
+ da,
nonce))
{
/* Either:
--
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: fixing #7772 exactly as suggested by reporter,
gnunet <=