opts & RSPAMD_HTTP_CLIENT_SSL);
if (conn) {
+ struct rspamd_http_connection_private *priv;
+
+ priv = conn->priv;
+
+ if (priv->ssl) {
+ rspamd_ssl_connection_restore_handlers (priv->ssl,
+ rspamd_http_event_handler,
+ rspamd_http_ssl_err_handler,
+ conn);
+ }
+
return conn;
}
return TRUE;
}
+void
+rspamd_ssl_connection_restore_handlers (struct rspamd_ssl_connection *conn,
+ rspamd_ssl_handler_t handler,
+ rspamd_ssl_error_handler_t err_handler,
+ gpointer handler_data)
+{
+ conn->handler = handler;
+ conn->err_handler = err_handler;
+ conn->handler_data = handler_data;
+
+ rspamd_ev_watcher_stop (conn->event_loop, conn->ev);
+ rspamd_ev_watcher_init (conn->ev, conn->fd, EV_WRITE, rspamd_ssl_event_handler, conn);
+ rspamd_ev_watcher_start (conn->event_loop, conn->ev, conn->ev->timeout);
+}
+
gssize
rspamd_ssl_read (struct rspamd_ssl_connection *conn, gpointer buf,
gsize buflen)
rspamd_ssl_handler_t handler, rspamd_ssl_error_handler_t err_handler,
gpointer handler_data);
+/**
+ * Restores SSL handlers for the existing ssl connection (e.g. after keepalive)
+ * @param conn
+ * @param handler
+ * @param err_handler
+ * @param handler_data
+ */
+void rspamd_ssl_connection_restore_handlers (struct rspamd_ssl_connection *conn,
+ rspamd_ssl_handler_t handler,
+ rspamd_ssl_error_handler_t err_handler,
+ gpointer handler_data);
+
/**
* Perform async read from SSL socket
* @param conn