]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Better handle dropped IMAP connections. (issue #9054 reported by bsmithurst)
authorJoshua Colp <jcolp@digium.com>
Wed, 21 Feb 2007 00:11:20 +0000 (00:11 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 21 Feb 2007 00:11:20 +0000 (00:11 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55741 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index fe231da4fef820292a389365d8a42387d0c8326f..941eb10fc0c9d84cc58be143171c0ad160889327 100644 (file)
@@ -2416,6 +2416,7 @@ static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, i
                fread(buf, len, 1, p);
                ((char *)buf)[len] = '\0';
                INIT(&str, mail_string, buf, len);
+               init_mailstream(vms, 0);
                imap_mailbox_name(mailbox, vms, 0, 1);
                if(!mail_append(vms->mailstream, mailbox, &str))
                        ast_log(LOG_ERROR, "Error while sending the message to %s\n", mailbox);
@@ -2530,8 +2531,7 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
                init_vm_state(vms_p);
                vmstate_insert(vms_p);
        }
-       if (!vms_p->mailstream)
-               ret = init_mailstream(vms_p, 0);
+       ret = init_mailstream(vms_p, 0);
        if (!vms_p->mailstream) {
                ast_log (LOG_ERROR,"IMAP mailstream is NULL\n");
                return -1;