rspamd_inet_addr_t *client_addr;
struct rspamd_http_connection *client_conn;
gpointer map;
+ gchar *fname;
gpointer shmem_ref;
struct rspamd_proxy_backend_connection *master_conn;
struct rspamd_http_message *client_message;
{
const rspamd_ftok_t *tok, *key_tok;
rspamd_ftok_t srch;
- const gchar *file_str;
+ gchar *file_str;
GHashTable *query_args;
GHashTableIter it;
gpointer k, v;
}
/* Remove header after processing */
rspamd_http_message_remove_header (msg, "File");
+ session->fname = file_str;
}
else {
/* Need to parse query URL */
rspamd_fstring_free (msg->url);
msg->url = new_url;
+ session->fname = file_str;
}
g_hash_table_unref (query_args);
if (m->local ||
rspamd_inet_address_is_local (rspamd_upstream_addr (bk_conn->up))) {
+
+ if (session->fname) {
+ rspamd_http_message_add_header (msg, "File", session->fname);
+ }
+
rspamd_http_connection_write_message_shared (bk_conn->backend_conn,
msg, NULL, NULL, bk_conn,
bk_conn->backend_sock,
bk_conn->io_tv, session->ctx->ev_base);
}
else {
+ if (session->fname) {
+ rspamd_http_message_set_body (msg, session->map, session->map_len);
+ }
+
rspamd_http_connection_write_message (bk_conn->backend_conn,
msg, NULL, NULL, bk_conn,
bk_conn->backend_sock,
if (backend->local ||
rspamd_inet_address_is_local (
rspamd_upstream_addr (session->master_conn->up))) {
+
+ if (session->fname) {
+ rspamd_http_message_add_header (msg, "File", session->fname);
+ }
+
rspamd_http_connection_write_message_shared (
session->master_conn->backend_conn,
msg, NULL, NULL, session->master_conn,
session->master_conn->io_tv, session->ctx->ev_base);
}
else {
+ if (session->fname) {
+ rspamd_http_message_set_body (msg, session->map, session->map_len);
+ }
+
rspamd_http_connection_write_message (
session->master_conn->backend_conn,
msg, NULL, NULL, session->master_conn,