if (read_len == -1 &&
session->state == SESSION_DISCONNECTED) {
- g_warning ("sock_read: session disconnected\n");
+ g_warning ("sock_read: session disconnected");
if (session->io_tag > 0) {
g_source_remove(session->io_tag);
session->io_tag = 0;
}
if (read_len == 0) {
- g_warning("sock_read: received EOF\n");
+ g_warning("sock_read: received EOF");
session->state = SESSION_EOF;
return FALSE;
}
case EAGAIN:
return TRUE;
default:
- g_warning("sock_read: %s\n",
+ g_warning("sock_read: %s",
g_strerror(errno));
session->state = SESSION_ERROR;
return FALSE;
}
/* response code */
- if (msg[0] == '(' && (end = strchr(msg, ')'))) {
+ if (msg && msg[0] == '(' && (end = strchr(msg, ')'))) {
msg++;
*end++ = '\0';
result->code =
}
/* s2c octets */
- if (msg[0] == '{' && (end = strchr(msg, '}'))) {
+ if (msg && msg[0] == '{' && (end = strchr(msg, '}'))) {
msg++;
*end++ = '\0';
if (msg[0] == '0' && msg+1 == end) {
}
/* text */
- if (*msg) {
+ if (msg && *msg) {
unquote_inplace(msg);
result->description = msg;
} else {
{
session->state = SIEVE_CAPABILITIES;
session->authenticated = FALSE;
+#ifdef USE_GNUTLS
session->tls_init_done = FALSE;
+#endif
return session_connect(SESSION(session), session->host,
session->port);
}
session->current_cmd = NULL;
session->send_queue = NULL;
session->state = SIEVE_CAPABILITIES;
+#ifdef USE_GNUTLS
session->tls_init_done = FALSE;
+#endif
session->avail_auth_type = 0;
session->auth_type = 0;
session->config = config;