gsize plen = 0;
struct event_base *ev_base;
struct lua_tcp_cbdata *cbd;
- struct rspamd_dns_resolver *resolver;
+ struct rspamd_dns_resolver *resolver = NULL;
struct rspamd_async_session *session = NULL;
struct rspamd_task *task = NULL;
- struct rspamd_config *cfg;
+ struct rspamd_config *cfg = NULL;
struct iovec *iov = NULL;
guint niov = 0, total_out;
guint64 h;
return 1;
}
+ if (resolver == NULL && cfg == NULL && task == NULL) {
+ msg_err ("tcp request has bad params: one of {resolver,task,config} should be set");
+ lua_pushboolean (L, FALSE);
+
+ return 1;
+ }
+
cbd->task = task;
h = rspamd_random_uint64_fast ();
rspamd_snprintf (cbd->tag, sizeof (cbd->tag), "%uxL", h);