Merged revisions 55741 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r55741 | file | 2007-02-20 19:11:20 -0500 (Tue, 20 Feb 2007) | 2 lines Better handle dropped IMAP connections. (issue #9054 reported by bsmithurst) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@55748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
22c1925696
commit
ee980f4350
1 changed files with 5 additions and 6 deletions
|
@ -2468,6 +2468,7 @@ static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, i
|
||||||
fread(buf, len, 1, p);
|
fread(buf, len, 1, p);
|
||||||
((char *)buf)[len] = '\0';
|
((char *)buf)[len] = '\0';
|
||||||
INIT(&str, mail_string, buf, len);
|
INIT(&str, mail_string, buf, len);
|
||||||
|
init_mailstream(vms, 0);
|
||||||
imap_mailbox_name(mailbox, vms, 0, 1);
|
imap_mailbox_name(mailbox, vms, 0, 1);
|
||||||
if(!mail_append(vms->mailstream, mailbox, &str))
|
if(!mail_append(vms->mailstream, mailbox, &str))
|
||||||
ast_log(LOG_ERROR, "Error while sending the message to %s\n", mailbox);
|
ast_log(LOG_ERROR, "Error while sending the message to %s\n", mailbox);
|
||||||
|
@ -2578,12 +2579,10 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If no mailstream exists yet and even after attempting to initialize it fails, bail out */
|
/* If no mailstream exists yet and even after attempting to initialize it fails, bail out */
|
||||||
if (!vms_p->mailstream) {
|
ret = init_mailstream(vms_p, 0);
|
||||||
ret = init_mailstream(vms_p, 0);
|
if (!vms_p->mailstream) {
|
||||||
if (!vms_p->mailstream) {
|
ast_log (LOG_ERROR,"Houston we have a problem - IMAP mailstream is NULL\n");
|
||||||
ast_log (LOG_ERROR,"Houston we have a problem - IMAP mailstream is NULL\n");
|
return -1;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ret && vms_p->updated == 1) {
|
if (!ret && vms_p->updated == 1) {
|
||||||
|
|
Loading…
Reference in a new issue