} *buf;
gboolean new_header;
gboolean encrypted;
+ gpointer peer_key;
struct rspamd_http_keypair *local_key;
struct rspamd_http_header *header;
struct http_parser parser;
priv->msg->body = g_string_sized_new (BUFSIZ);
}
+ priv->msg->body_buf.str = priv->msg->body->str;
priv->msg->method = parser->method;
priv->msg->code = parser->status_code;
m += crypto_box_ZEROBYTES;
dec_len -= crypto_box_ZEROBYTES;
+ priv->msg->body->str = m;
+ priv->msg->body->len = dec_len;
+
rspamd_http_connection_ref (conn);
ret = conn->body_handler (conn,
priv->msg,
/* Clear request */
if (msg != NULL) {
+ if (msg->peer_key) {
+ priv->peer_key = msg->peer_key;
+ }
rspamd_http_message_free (msg);
priv->msg = NULL;
}
conn->type == RSPAMD_HTTP_SERVER ? HTTP_REQUEST : HTTP_RESPONSE);
priv->msg = req;
+ if (priv->peer_key) {
+ priv->msg->peer_key = priv->peer_key;
+ priv->encrypted = TRUE;
+ }
+
if (timeout == NULL) {
priv->ptv = NULL;
}
new->headers = NULL;
new->date = 0;
new->body = NULL;
+ memset (&new->body_buf, 0, sizeof (new->body_buf));
new->status = NULL;
new->host = NULL;
new->port = 80;
g_slice_free1 (sizeof (struct rspamd_http_header), hdr);
}
if (msg->body != NULL) {
- g_string_free (msg->body, TRUE);
+ g_string_free (msg->body, FALSE);
+ g_free (msg->body_buf.str);
}
if (msg->url != NULL) {
g_string_free (msg->url, TRUE);