msg = rspamd_http_new_message (HTTP_RESPONSE);
va_start (args, error_msg);
- msg->status = rspamd_fstring_sized_new (128);
+ msg->status = rspamd_fstring_new ();
rspamd_vprintf_fstring (&msg->status, error_msg, args);
va_end (args);
msg->date = time (NULL);
msg->code = code;
- msg->body = rspamd_fstring_sized_new (128);
+ msg->body = rspamd_fstring_new ();
rspamd_printf_fstring (&msg->body, "{\"error\":\"%V\"}", msg->status);
rspamd_http_connection_reset (session->conn);
rspamd_http_connection_write_message (session->conn,
msg = rspamd_http_new_message (HTTP_RESPONSE);
msg->date = time (NULL);
msg->code = 200;
+ msg->status = rspamd_fstring_new_init ("OK", 2);
msg->body = rspamd_fstring_sized_new (BUFSIZ);
rspamd_ucl_emit_fstring (obj, UCL_EMIT_JSON_COMPACT, &msg->body);
rspamd_http_connection_reset (session->conn);
msg = rspamd_http_new_message (HTTP_RESPONSE);
va_start (args, error_msg);
- msg->status = rspamd_fstring_sized_new (128);
+ msg->status = rspamd_fstring_new ();
rspamd_vprintf_fstring (&msg->status, error_msg, args);
va_end (args);
msg->date = time (NULL);
msg->code = code;
- msg->body = rspamd_fstring_sized_new (128);
+ msg->body = rspamd_fstring_new ();
rspamd_printf_fstring (&msg->body, "{\"error\":\"%V\"}", msg->status);
rspamd_http_connection_reset (entry->conn);
rspamd_http_connection_write_message (entry->conn,
msg = rspamd_http_new_message (HTTP_RESPONSE);
msg->date = time (NULL);
msg->code = 200;
+ msg->status = rspamd_fstring_new_init ("OK", 2);
msg->body = rspamd_fstring_new_init (str, strlen (str));
rspamd_http_connection_reset (entry->conn);
rspamd_http_connection_write_message (entry->conn,
msg = rspamd_http_new_message (HTTP_RESPONSE);
msg->date = time (NULL);
msg->code = 200;
+ msg->status = rspamd_fstring_new_init ("OK", 2);
msg->body = rspamd_fstring_sized_new (BUFSIZ);
rspamd_ucl_emit_fstring (obj, UCL_EMIT_JSON_COMPACT, &msg->body);
rspamd_http_connection_reset (entry->conn);