+ char *reason_phrase = NULL;
+ char *new_response_line;
+ char *p;
+ size_t length;
+ unsigned int major_version;
+ unsigned int minor_version;
+
+ /* Get the reason phrase which start after the second whitespace */
+ p = strchr(*header, ' ');
+ if (NULL != p)
+ {
+ p++;
+ reason_phrase = strchr(p, ' ');
+ if (reason_phrase != NULL)
+ {
+ reason_phrase++;
+ }
+ }
+
+ if ((reason_phrase == NULL) || (reason_phrase[0] == '\0') ||
+ (3 != sscanf(*header, "HTTP/%u.%u %u", &major_version,
+ &minor_version, &(csp->http->status))))
+ {
+ log_error(LOG_LEVEL_ERROR,
+ "Failed to parse the response line: %s", *header);
+ return JB_ERR_PARSE;
+ }
+