projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Andreas Krennmair:
[apps/madmutt.git]
/
imap
/
imap.c
diff --git
a/imap/imap.c
b/imap/imap.c
index
0ad54d1
..
20c3960
100644
(file)
--- a/
imap/imap.c
+++ b/
imap/imap.c
@@
-430,7
+430,7
@@
int imap_open_connection (IMAP_DATA* idata)
{
mutt_error (_("Could not negotiate TLS connection"));
mutt_sleep (1);
{
mutt_error (_("Could not negotiate TLS connection"));
mutt_sleep (1);
- goto
bail
;
+ goto
err_close_conn
;
}
else
{
}
else
{
@@
-460,6
+460,7
@@
int imap_open_connection (IMAP_DATA* idata)
err_close_conn:
mutt_socket_close (idata->conn);
err_close_conn:
mutt_socket_close (idata->conn);
+ idata->state = IMAP_DISCONNECTED;
bail:
FREE (&idata->capstr);
return -1;
bail:
FREE (&idata->capstr);
return -1;
@@
-793,12
+794,14
@@
void imap_logout (IMAP_DATA* idata)
imap_cmd_start (idata, "LOGOUT");
while (imap_cmd_step (idata) == IMAP_CMD_CONTINUE)
;
imap_cmd_start (idata, "LOGOUT");
while (imap_cmd_step (idata) == IMAP_CMD_CONTINUE)
;
+ FREE(& idata->cmd.buf);
+ FREE(& idata);
}
}
+/*
int imap_close_connection (CONTEXT *ctx)
{
dprint (1, (debugfile, "imap_close_connection(): closing connection\n"));
int imap_close_connection (CONTEXT *ctx)
{
dprint (1, (debugfile, "imap_close_connection(): closing connection\n"));
- /* if the server didn't shut down on us, close the connection gracefully */
if (CTX_DATA->status != IMAP_BYE)
{
mutt_message _("Closing connection to IMAP server...");
if (CTX_DATA->status != IMAP_BYE)
{
mutt_message _("Closing connection to IMAP server...");
@@
-810,6
+813,7
@@
int imap_close_connection (CONTEXT *ctx)
CTX_DATA->conn->data = NULL;
return 0;
}
CTX_DATA->conn->data = NULL;
return 0;
}
+*/
/* imap_set_flag: append str to flags if we currently have permission
* according to aclbit */
/* imap_set_flag: append str to flags if we currently have permission
* according to aclbit */
@@
-818,7
+822,7
@@
static void imap_set_flag (IMAP_DATA* idata, int aclbit, int flag,
{
if (mutt_bit_isset (idata->rights, aclbit))
if (flag)
{
if (mutt_bit_isset (idata->rights, aclbit))
if (flag)
- s
trncat (flags, str, flsize
);
+ s
afe_strcat (flags, flsize, str
);
}
/* imap_make_msg_set: make an IMAP4rev1 UID message set out of a set of
}
/* imap_make_msg_set: make an IMAP4rev1 UID message set out of a set of
@@
-1485,20
+1489,19
@@
int imap_complete(char* dest, size_t dlen, char* path) {
return -1;
}
return -1;
}
-/* reconnect
and verify indexes
if connection was lost */
+/* reconnect if connection was lost */
int imap_reconnect(CONTEXT* ctx) {
IMAP_DATA* imap_data = (IMAP_DATA *)ctx->data;
int imap_reconnect(CONTEXT* ctx) {
IMAP_DATA* imap_data = (IMAP_DATA *)ctx->data;
- if (imap_data->status == IMAP_CONNECTED)
- return -1;
- if (imap_data->status == IMAP_BYE)
- return 0;
-
- mutt_socket_close(imap_data->conn);
+ if (imap_data) {
+ if (imap_data->status == IMAP_CONNECTED)
+ return -1;
+ }
if (query_quadoption(OPT_IMAPRECONNECT,_("Connection lost. Reconnect to IMAP server?")) != M_YES)
return -1;
if (query_quadoption(OPT_IMAPRECONNECT,_("Connection lost. Reconnect to IMAP server?")) != M_YES)
return -1;
- return imap_open_mailbox(ctx);
+ mx_open_mailbox(ctx->path,0,ctx);
+ return 0;
}
}