Revert "fixing #7772 exactly as suggested by reporter"

This reverts commit fabafbaaaf as the issue
was already fixed previously in a different way.
This commit is contained in:
Christian Grothoff
2023-09-03 19:38:21 +02:00
parent c690b40eb0
commit 602ad55136
2 changed files with 8 additions and 14 deletions
+6 -8
View File
@@ -1935,6 +1935,7 @@ connection_maximize_write_buffer (struct MHD_Connection *connection)
}
#if 0 /* disable unused function */
/**
* Shrink connection write buffer to the size of unsent data.
*
@@ -1954,8 +1955,7 @@ 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,9 +1965,7 @@ 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));
@@ -1979,6 +1977,9 @@ connection_shrink_write_buffer (struct MHD_Connection *connection)
}
#endif /* unused function */
/**
* Switch connection from recv mode to send mode.
*
@@ -6632,9 +6633,6 @@ 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 ==
+2 -6
View File
@@ -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 valid
* @param nonce_time The amount of time in seconds for a nonce to be invalid
* @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,11 +1786,7 @@ 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: