On Thu, Aug 4, 2016 at 12:58 AM, <[email protected]> wrote:
> Author: wrowe
> Date: Wed Aug 3 22:58:10 2016
> New Revision: 1755124
>
> URL: http://svn.apache.org/viewvc?rev=1755124&view=rev
> Log:
> Reformat for indentation following r1755123, Whitespace Only
>
> Modified:
> httpd/httpd/trunk/server/protocol.c
We could save yet another level of indentation with:
Index: server/protocol.c
===================================================================
--- server/protocol.c (revision 1755347)
+++ server/protocol.c (working copy)
@@ -788,7 +788,7 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_
* Read header lines until we get the empty separator line, a read error,
* the connection closes (EOF), reach the server limit, or we timeout.
*/
- while(1) {
+ do {
apr_status_t rv;
field = NULL;
@@ -903,8 +903,16 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_
*/
continue;
}
- else if (last_field != NULL) {
+ if (last_field == NULL) {
+ /* Keep track of this first header line so that we can extend it
+ * across any obs-fold or parse it on the next loop iteration.
+ */
+ last_field = field;
+ last_len = len;
+ continue;
+ }
+
/* Process the previous last_field header line with all obs-folded
* segments already concatinated (this is not operating on the
* most recently read input line).
@@ -986,25 +994,14 @@ AP_DECLARE(void) ap_get_mime_headers_core(request_
apr_table_addn(r->headers_in, last_field, value);
- /* This last_field header is now stored in headers_in,
- * resume processing of the current input line.
- */
- }
-
- /* Found the terminating empty end-of-headers line, stop. */
- if (len == 0) {
- break;
- }
-
- /* Keep track of this new header line so that we can extend it across
- * any obs-fold or parse it on the next loop iteration. We referenced
- * our previously allocated buffer in r->headers_in,
- * so allocate a fresh buffer if required.
+ /* This last_field header is now stored in headers_in,
+ * resume processing of the current input line, so
+ * allocate a fresh buffer if required.
*/
alloc_len = 0;
last_field = field;
last_len = len;
- }
+ } while (last_len);
/* Combine multiple message-header fields with the same
* field-name, following RFC 2616, 4.2.
_
and then reindent the block left shifted above (in a second whitespace
only commit).
Not sure this old shared/participatory code deserves so much mangling,
that's no functional change, just readability improvement (maybe)...
WDYT?