struct pop3c_client {
pool_t pool;
+ struct event *event;
struct pop3c_client_settings set;
struct ssl_iostream_context *ssl_ctx;
struct ip_addr ip;
static void pop3c_client_input(struct pop3c_client *client);
struct pop3c_client *
-pop3c_client_init(const struct pop3c_client_settings *set)
+pop3c_client_init(const struct pop3c_client_settings *set,
+ struct event *event_parent)
{
struct pop3c_client *client;
const char *error;
pool = pool_alloconly_create("pop3c client", 1024);
client = p_new(pool, struct pop3c_client, 1);
client->pool = pool;
+ client->event = event_create(event_parent);
client->fd = -1;
p_array_init(&client->commands, pool, 16);
pop3c_client_disconnect(client);
if (client->ssl_ctx != NULL)
ssl_iostream_context_unref(&client->ssl_ctx);
+ event_unref(&client->event);
pool_unref(&client->pool);
}
const char *reply, void *context);
struct pop3c_client *
-pop3c_client_init(const struct pop3c_client_settings *set);
+pop3c_client_init(const struct pop3c_client_settings *set,
+ struct event *event_parent);
void pop3c_client_deinit(struct pop3c_client **client);
void pop3c_client_login(struct pop3c_client *client,
client_set.ssl_mode = POP3C_CLIENT_SSL_MODE_STARTTLS;
else
client_set.ssl_mode = POP3C_CLIENT_SSL_MODE_NONE;
- return pop3c_client_init(&client_set);
+ return pop3c_client_init(&client_set, storage->event);
}
static void