Changeset 1951

Show
Ignore:
Timestamp:
05/14/07 17:37:59
Author:
pvanhoof
Message:

Bugfix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r1950 r1951  
     12007-05-14  Philip Van Hoof  <pvanhoof@gnome.org> 
     2 
     3        * Waiting for the + continuation after IDLE 
     4        * Please watch this fix with different IMAP implementations 
     5 
    162007-05-14  Sergio Villar Senin  <svillar@igalia.com> 
    27 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c

    r1949 r1951  
    33893389idle_real_start (CamelImapStore *store) 
    33903390{ 
     3391        char *resp; 
     3392        CamelException ex = CAMEL_EXCEPTION_INITIALISER; 
     3393 
    33913394        idle_debug ("idle_real_start\n"); 
    33923395 
     
    33963399        camel_stream_printf (store->ostream, "%s IDLE\r\n", 
    33973400                store->idle_prefix); 
     3401 
     3402        resp = NULL; 
     3403        while (camel_imap_store_readline_nl (store, &resp, &ex) > 0) 
     3404        { 
     3405                gboolean tbreak = FALSE; 
     3406                if (!strncmp (resp, "+ ", 2)) 
     3407                        tbreak = TRUE; 
     3408                /* printf ("-> %s\n", resp); */ 
     3409                g_free (resp); resp=NULL; 
     3410                if (tbreak) 
     3411                        break; 
     3412        } 
     3413        if (resp) 
     3414                g_free (resp); 
     3415 
    33983416        g_mutex_unlock (store->stream_lock); 
    33993417 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c

    r1949 r1951  
    36423642 
    36433643ssize_t 
     3644camel_imap_store_readline_nl (CamelImapStore *store, char **dest, CamelException *ex) 
     3645{ 
     3646        CamelStreamBuffer *stream; 
     3647        char linebuf[1024] = {0}; 
     3648        GByteArray *ba; 
     3649        ssize_t nread; 
     3650         
     3651        g_return_val_if_fail (CAMEL_IS_IMAP_STORE (store), -1); 
     3652        g_return_val_if_fail (dest, -1); 
     3653         
     3654        *dest = NULL; 
     3655         
     3656        /* Check for connectedness. Failed (or cancelled) operations will 
     3657         * close the connection. We can't expect a read to have any 
     3658         * meaning if we reconnect, so always set an exception. 
     3659         */ 
     3660 
     3661        if (!camel_disco_store_check_online((CamelDiscoStore *)store, ex)) 
     3662                return -1; 
     3663 
     3664        camel_imap_store_restore_stream_buffer (store); 
     3665        stream = CAMEL_STREAM_BUFFER (store->istream); 
     3666 
     3667        ba = g_byte_array_new (); 
     3668        while ((nread = camel_stream_buffer_gets (stream, linebuf, sizeof (linebuf))) > 0) { 
     3669                g_byte_array_append (ba, (const guchar*) linebuf, nread); 
     3670                if (linebuf[nread - 1] == '\n') 
     3671                        break; 
     3672        } 
     3673 
     3674        if (nread <= 0) { 
     3675                if (errno == EINTR) 
     3676                { 
     3677                        CamelException mex = CAMEL_EXCEPTION_INITIALISER; 
     3678                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled")); 
     3679                        camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); 
     3680                        camel_service_connect (CAMEL_SERVICE (store), &mex); 
     3681                } else { 
     3682                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, 
     3683                                              _("Server unexpectedly disconnected: %s"), 
     3684                                              g_strerror (errno)); 
     3685                        camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); 
     3686                } 
     3687 
     3688                g_byte_array_free (ba, TRUE); 
     3689                return -1; 
     3690        } 
     3691         
     3692        if (camel_verbose_debug) { 
     3693                fprintf (stderr, "received: "); 
     3694                fwrite (ba->data, 1, ba->len, stderr); 
     3695        } 
     3696         
     3697        /* camel-imap-command.c:imap_read_untagged expects the CRLFs 
     3698           to be stripped off and be nul-terminated *sigh* */ 
     3699        nread = ba->len - 1; 
     3700        ba->data[nread] = '\0'; 
     3701        if (ba->data[nread - 1] == '\r') { 
     3702                ba->data[nread - 1] = '\0'; 
     3703                nread--; 
     3704        } 
     3705         
     3706        *dest = (char *) ba->data; 
     3707        g_byte_array_free (ba, FALSE); 
     3708         
     3709        return nread; 
     3710} 
     3711 
     3712ssize_t 
    36443713camel_imap_store_readline_nb (CamelImapStore *store, char **dest, CamelException *ex) 
    36453714{ 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.h

    r1949 r1951  
    175175gboolean camel_imap_store_connected (CamelImapStore *store, CamelException *ex); 
    176176 
     177ssize_t camel_imap_store_readline_nl (CamelImapStore *store, char **dest, CamelException *ex); 
    177178ssize_t camel_imap_store_readline_nb (CamelImapStore *store, char **dest, CamelException *ex); 
    178179ssize_t camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *ex); 
  • trunk/po/Makefile.in.in

    r1945 r1951  
    2626prefix = @prefix@ 
    2727exec_prefix = @exec_prefix@ 
     28datarootdir = @datarootdir@ 
    2829datadir = @datadir@ 
    2930libdir = @libdir@ 
     
    4142GMSGFMT = @GMSGFMT@ 
    4243MSGFMT = @MSGFMT@ 
     44MSGFMT_OPTS = @MSGFMT_OPTS@ 
    4345XGETTEXT = @XGETTEXT@ 
    4446MSGMERGE = msgmerge 
     
    7981.po.gmo: 
    8082        file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ 
    81           && rm -f $$file && $(GMSGFMT) -c -o $$file $< 
     83          && rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -o $$file $< 
    8284 
    8385.po.cat: 
  • trunk/tests/functional

    • Property svn:ignore changed from anything msg-sender msg-transfer folder-transfer folder-lister-async tags Makefile.in folder-lister .svnignore stamp-h1 config.h .libs .deps Makefile folder-transfer to account-refresh anything msg-sender msg-transfer folder-transfer folder-lister-async tags Makefile.in folder-lister .svnignore stamp-h1 config.h .libs .deps Makefile folder-transfer
  • trunk/tests/functional/.svnignore

    r1797 r1951  
     1account-refresh 
    12anything 
    23msg-sender