X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fimap.c;h=63eae5a6c4fad9cde356079dc6ee51cc50770f64;hp=9bc7e86e3cad210ba9c4405532ff111cad89db73;hb=f404a0ca916be07049af51a3022baaaaab94def6;hpb=e96efa56257b45e9c3d1fb1b30071c57512cfe28 diff --git a/imap/imap.c b/imap/imap.c index 9bc7e86..63eae5a 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -20,6 +20,10 @@ /* Support for IMAP4rev1, with the occasional nod to IMAP 4. */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include "mutt.h" #include "mutt_curses.h" #include "mx.h" @@ -430,7 +434,7 @@ int imap_open_connection (IMAP_DATA* idata) { mutt_error (_("Could not negotiate TLS connection")); mutt_sleep (1); - goto bail; + goto err_close_conn; } else { @@ -460,6 +464,7 @@ int imap_open_connection (IMAP_DATA* idata) err_close_conn: mutt_socket_close (idata->conn); + idata->state = IMAP_DISCONNECTED; bail: FREE (&idata->capstr); return -1; @@ -793,12 +798,14 @@ void imap_logout (IMAP_DATA* idata) 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")); - /* 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..."); @@ -810,6 +817,7 @@ int imap_close_connection (CONTEXT *ctx) CTX_DATA->conn->data = NULL; return 0; } +*/ /* imap_set_flag: append str to flags if we currently have permission * according to aclbit */ @@ -818,7 +826,7 @@ static void imap_set_flag (IMAP_DATA* idata, int aclbit, int flag, { if (mutt_bit_isset (idata->rights, aclbit)) if (flag) - strncat (flags, str, flsize); + safe_strcat (flags, flsize, str); } /* imap_make_msg_set: make an IMAP4rev1 UID message set out of a set of