{
const char *colon = NULL, *line = header;
zval array;
-
+
INIT_ZARR(array, headers);
+#define MORE_HEADERS (*(line-1) && !(*(line-1) == '\n' && (*line == '\n' || *line == '\r')))
do {
int value_len = 0;
callback_func(callback_data, &headers, &i TSRMLS_CC);
http_info_dtor(&i);
Z_ARRVAL(array) = headers;
- } else
-
- /* "header: value" pair */
- if (colon) {
-
+ } else if (colon) {
+ /* "header: value" pair */
/* skip empty key */
if (header != colon) {
zval **previous = NULL;
}
efree(key);
}
- } else {
+ } else if (MORE_HEADERS) {
return FAILURE;
}
colon = NULL;
}
break;
}
- } while (*(line-1) && !(*(line-1) == '\n' && (*line == '\n' || *line == '\r')));
+ } while (MORE_HEADERS);
return SUCCESS;
}