client->common.remote_port,
client_get_session_id(&client->common),
client->common.proxy_ttl - 1));
- client->common.proxy_state = POP3_PROXY_XCLIENT;
+ client->proxy_state = POP3_PROXY_XCLIENT;
} else {
- client->common.proxy_state = POP3_PROXY_LOGIN1;
+ client->proxy_state = POP3_PROXY_LOGIN1;
}
str = t_str_new(128);
o_stream_nsend(output, str_data(str), str_len(str));
proxy_free_password(&client->common);
- if (client->common.proxy_state != POP3_PROXY_XCLIENT)
- client->common.proxy_state = POP3_PROXY_LOGIN2;
+ if (client->proxy_state != POP3_PROXY_XCLIENT)
+ client->proxy_state = POP3_PROXY_LOGIN2;
return 0;
}
i_assert(!client->destroyed);
output = login_proxy_get_ostream(client->login_proxy);
- switch (client->proxy_state) {
+ switch (pop3_client->proxy_state) {
case POP3_PROXY_BANNER:
/* this is a banner */
if (strncmp(line, "+OK", 3) != 0) {
}
} else {
o_stream_nsend_str(output, "STLS\r\n");
- client->proxy_state = POP3_PROXY_STARTTLS;
+ pop3_client->proxy_state = POP3_PROXY_STARTTLS;
}
return 0;
case POP3_PROXY_STARTTLS:
client_proxy_failed(client, TRUE);
return -1;
}
- client->proxy_state = client->proxy_sasl_client == NULL ?
+ pop3_client->proxy_state = client->proxy_sasl_client == NULL ?
POP3_PROXY_LOGIN1 : POP3_PROXY_LOGIN2;
return 0;
case POP3_PROXY_LOGIN1:
o_stream_nsend_str(output, t_strdup_printf(
"PASS %s\r\n", client->proxy_password));
proxy_free_password(client);
- client->proxy_state = POP3_PROXY_LOGIN2;
+ pop3_client->proxy_state = POP3_PROXY_LOGIN2;
return 0;
case POP3_PROXY_LOGIN2:
if (strncmp(line, "+ ", 2) == 0 &&
void pop3_proxy_reset(struct client *client)
{
- client->proxy_state = POP3_PROXY_BANNER;
+ struct pop3_client *pop3_client = (struct pop3_client *)client;
+
+ pop3_client->proxy_state = POP3_PROXY_BANNER;
}
void pop3_proxy_error(struct client *client, const char *text)
const char *pop3_proxy_get_state(struct client *client)
{
- return pop3_proxy_state_names[client->proxy_state];
+ struct pop3_client *pop3_client = (struct pop3_client *)client;
+
+ return pop3_proxy_state_names[pop3_client->proxy_state];
}