]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to pass socket's ownership to http connection object
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2020 19:55:12 +0000 (20:55 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2020 19:55:12 +0000 (20:55 +0100)
src/libserver/http/http_connection.c
src/libserver/http/http_connection.h

index 4e880f2161e63c2933d49d6e89d189cf8e6880c5..050fb4285fccef09a3c09182102ece00be29b335 100644 (file)
@@ -2344,6 +2344,14 @@ rspamd_http_connection_set_key (struct rspamd_http_connection *conn,
        priv->local_key = rspamd_keypair_ref (key);
 }
 
+void
+rspamd_http_connection_own_socket (struct rspamd_http_connection *conn)
+{
+       struct rspamd_http_connection_private *priv = conn->priv;
+
+       priv->flags |= RSPAMD_HTTP_CONN_OWN_SOCKET;
+}
+
 const struct rspamd_cryptobox_pubkey*
 rspamd_http_connection_get_peer_key (struct rspamd_http_connection *conn)
 {
index 7c901fd2a0f287f0ddd8e233c6d823193af34e99..ada98d2503ce46735ba9b842b52703f8b07c94fe 100644 (file)
@@ -202,6 +202,12 @@ struct rspamd_http_connection *rspamd_http_connection_new_client_socket (
 void rspamd_http_connection_set_key (struct rspamd_http_connection *conn,
                                                                         struct rspamd_cryptobox_keypair *key);
 
+/**
+ * Transfer ownership on socket to an HTTP connection
+ * @param conn
+ */
+void rspamd_http_connection_own_socket (struct rspamd_http_connection *conn);
+
 /**
  * Get peer's public key
  * @param conn connection structure