~ubuntu-branches/ubuntu/saucy/evolution-data-server/saucy

« back to all changes in this revision

Viewing changes to camel/providers/imap/camel-imap-command.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-10-08 12:58:16 UTC
  • mfrom: (181.1.7 quantal)
  • Revision ID: package-import@ubuntu.com-20121008125816-i3n76e8c0m64e7xp
Tags: 3.6.0-0ubuntu2
* Fix LP: #1038047 part 1 - Don't abort in e_source_registry_new* when a
  problem occurs connecting to the Dbus service
  - add debian/patches/dont-abort-in-e_source_registry_new.patch
  - update debian/patches/series
* Fix LP: #1038047 part 2 - libedataserver depends on
  evolution-data-server-common to ensure that the GSettings schemas are
  present
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
356
356
 
357
357
        service = CAMEL_SERVICE (store);
358
358
        session = camel_service_get_session (service);
359
 
        settings = camel_service_get_settings (service);
 
359
 
 
360
        settings = camel_service_ref_settings (service);
360
361
 
361
362
        network_settings = CAMEL_NETWORK_SETTINGS (settings);
362
363
        host = camel_network_settings_dup_host (network_settings);
363
364
        user = camel_network_settings_dup_user (network_settings);
364
365
 
 
366
        g_object_unref (settings);
 
367
 
365
368
        if (camel_imap_store_readline (store, &respbuf, cancellable, error) < 0) {
366
369
                g_static_rec_mutex_unlock (&store->command_and_response_lock);
367
370
                type = CAMEL_IMAP_RESPONSE_ERROR;
373
376
                if (!g_ascii_strncasecmp (respbuf, "* BYE", 5)) {
374
377
                        const gchar *err = NULL;
375
378
 
376
 
                        if (respbuf [5] && g_ascii_strncasecmp (respbuf + 6, "[ALERT] ", 8) == 0)
 
379
                        if (respbuf[5] && g_ascii_strncasecmp (respbuf + 6, "[ALERT] ", 8) == 0)
377
380
                                err = respbuf + 14;
378
381
 
379
382
                        if (!err || !*err)
499
502
        /* We should never get BAD, or anything else but +, OK, or NO
500
503
         * for that matter.  Well, we could get BAD, treat as NO.
501
504
         */
502
 
        if (!p || (g_ascii_strncasecmp(p, " NO", 3) != 0 && g_ascii_strncasecmp(p, " BAD", 4)) ) {
503
 
                g_warning ("Unexpected response from IMAP server: %s",
504
 
                           respbuf);
 
505
        if (!p || (g_ascii_strncasecmp (p, " NO", 3) != 0 && g_ascii_strncasecmp (p, " BAD", 4)) ) {
 
506
                g_warning (
 
507
                        "Unexpected response from IMAP server: %s",
 
508
                        respbuf);
505
509
                g_set_error (
506
510
                        error, CAMEL_SERVICE_ERROR,
507
511
                        CAMEL_SERVICE_ERROR_UNAVAILABLE,
611
615
                }
612
616
                str->str[length + 1] = '\0';
613
617
 
614
 
                if (camel_debug("imap")) {
615
 
                        printf("Literal: -->");
 
618
                if (camel_debug ("imap")) {
 
619
                        printf ("Literal: -->");
616
620
                        fwrite (str->str + 1, 1, length, stdout);
617
 
                        printf("<--\n");
 
621
                        printf ("<--\n");
618
622
                }
619
623
 
620
624
                /* Fix up the literal, turning CRLFs into LF. Also, if
664
668
                        /* MAJOR HACK ALERT, gropuwise sometimes sends an extra blank line after literals, check that here
665
669
                         * But only do it if we're inside an sexpression */
666
670
                        if (line[0] == 0 && sexp > 0)
667
 
                                g_warning("Server sent empty line after a literal, assuming in error");
 
671
                                g_warning ("Server sent empty line after a literal, assuming in error");
668
672
                } while (line[0] == 0 && sexp > 0);
669
673
        }
670
674
 
715
719
                        if (!g_ascii_strcasecmp (p, " EXISTS")) {
716
720
                                exists = number;
717
721
                        } else if (!g_ascii_strcasecmp (p, " EXPUNGE")
718
 
                                   || !g_ascii_strcasecmp(p, " XGWMOVE")) {
 
722
                                   || !g_ascii_strcasecmp (p, " XGWMOVE")) {
719
723
                                /* XGWMOVE response is the same as an EXPUNGE response */
720
724
                                if (!expunged) {
721
 
                                        expunged = g_array_new (FALSE, FALSE,
722
 
                                                                sizeof (gint));
 
725
                                        expunged = g_array_new (
 
726
                                                FALSE, FALSE, sizeof (gint));
723
727
                                }
724
728
                                g_array_append_val (expunged, number);
725
729
                        }
816
820
                        error, CAMEL_SERVICE_ERROR,
817
821
                        CAMEL_SERVICE_ERROR_UNAVAILABLE,
818
822
                        _("IMAP server response did not "
819
 
                          "contain %s information"), type);
 
823
                        "contain %s information"), type);
820
824
        }
821
825
 
822
826
        camel_imap_response_free (store, response);
926
930
                        start = p;
927
931
                        break;
928
932
                default:
929
 
                        g_warning ("camel-imap-command is not printf. I don't "
930
 
                                   "know what '%%%c' means.", *p);
 
933
                        g_warning (
 
934
                                "camel-imap-command is not printf. "
 
935
                                "I don't know what '%%%c' means.", *p);
931
936
                        start = *p ? p + 1 : p;
932
937
                        break;
933
938
                }