-const char parsers_rcs[] = "$Id: parsers.c,v 1.293 2014/10/18 11:24:34 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.296 2014/11/03 14:41:12 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
csp->flags |= CSP_FLAG_SERVER_KEEP_ALIVE_TIMEOUT_SET;
}
+ freez(*header);
+
return JB_ERR_OK;
}
*/
if ((csp->content_type & CT_TEXT) || (csp->action->flags & ACTION_FORCE_TEXT_MODE))
{
+ jb_err err;
freez(*header);
*header = strdup_or_die("Content-Type: ");
- string_append(header, csp->action->string[ACTION_STRING_CONTENT_TYPE]);
- if (header == NULL)
+ err = string_append(header, csp->action->string[ACTION_STRING_CONTENT_TYPE]);
+ if (JB_ERR_OK != err)
{
log_error(LOG_LEVEL_HEADER, "Insufficient memory to replace Content-Type!");
return JB_ERR_MEMORY;
reason_phrase="";
}
- if (3 != sscanf(*header, "HTTP/%u.%u %u", &major_version,
+ if (3 != sscanf(*header, "HTTP/%u.%u %d", &major_version,
&minor_version, &(csp->http->status)))
{
log_error(LOG_LEVEL_ERROR,
length = sizeof("HTTP/1.1 200 ") + strlen(reason_phrase) + 1;
new_response_line = malloc_or_die(length);
- snprintf(new_response_line, length, "HTTP/%u.%u %u %s",
+ snprintf(new_response_line, length, "HTTP/%u.%u %d %s",
major_version, minor_version, csp->http->status, reason_phrase);
if (0 != strcmp(*header, new_response_line))