Stop shrinking memory buffer after preparing reply header or footers

This commit is contained in:
Evgeny Grin (Karlson2k)
2021-08-23 22:22:16 +03:00
parent 95d1725ce3
commit 7f33ea76e7
+4 -5
View File
@@ -1546,6 +1546,7 @@ connection_maximize_write_buffer (struct MHD_Connection *connection)
}
#if 0 /* disable unused function */
/**
* Shrink connection write buffer to the size of unsent data.
*
@@ -1578,6 +1579,9 @@ connection_shrink_write_buffer (struct MHD_Connection *connection)
}
#endif /* unused function */
/**
* Switch connection from recv mode to send mode.
*
@@ -2099,9 +2103,6 @@ build_header_response (struct MHD_Connection *connection)
buf[pos++] = '\n';
c->write_buffer_append_offset = pos;
/* TODO: remove shrink of the buffer,
* handle maximized buffer in other functions */
connection_shrink_write_buffer (c);
return MHD_YES;
}
@@ -2170,8 +2171,6 @@ build_connection_chunked_response_footer (struct MHD_Connection *connection)
c->write_buffer_append_offset += used_size;
mhd_assert (c->write_buffer_append_offset <= c->write_buffer_size);
/* TODO: remove shrink */
connection_shrink_write_buffer (c);
return MHD_YES;
}