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

« back to all changes in this revision

Viewing changes to camel/camel-mime-part.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:
534
534
        gssize count;
535
535
        gint errnosav;
536
536
 
537
 
        d(printf("mime_part::write_to_stream\n"));
 
537
        d (printf ("mime_part::write_to_stream\n"));
538
538
 
539
539
        /* FIXME: something needs to be done about this ... */
540
540
        /* TODO: content-languages header? */
542
542
        if (mp->headers) {
543
543
                struct _camel_header_raw *h = mp->headers;
544
544
                gchar *val;
545
 
                gssize          (*writefn)      (CamelStream *stream,
546
 
                                                 const gchar *name,
547
 
                                                 const gchar *value,
548
 
                                                 GCancellable *cancellable,
549
 
                                                 GError **error);
 
545
                gssize (*writefn)       (CamelStream *stream,
 
546
                                         const gchar *name,
 
547
                                         const gchar *value,
 
548
                                         GCancellable *cancellable,
 
549
                                         GError **error);
550
550
 
551
551
                /* fold/write the headers.   But dont fold headers that are already formatted
552
552
                 * (e.g. ones with parameter-lists, that we know about, and have created) */
553
553
                while (h) {
554
554
                        val = h->value;
555
555
                        if (val == NULL) {
556
 
                                g_warning("h->value is NULL here for %s", h->name);
 
556
                                g_warning ("h->value is NULL here for %s", h->name);
557
557
                                count = 0;
558
558
                        } else if ((writefn = g_hash_table_lookup (header_formatted_table, h->name)) == NULL) {
559
559
                                val = camel_header_fold (val, strlen (h->name));
647
647
 
648
648
                        /* we only re-do crlf on encoded blocks */
649
649
                        if (filter && camel_content_type_is (dw->mime_type, "text", "*")) {
650
 
                                CamelMimeFilter *crlf = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE,
651
 
                                                                                   CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
 
650
                                CamelMimeFilter *crlf = camel_mime_filter_crlf_new (
 
651
                                        CAMEL_MIME_FILTER_CRLF_ENCODE,
 
652
                                        CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
652
653
 
653
654
                                camel_stream_filter_add (
654
655
                                        CAMEL_STREAM_FILTER (filter_stream), crlf);
693
694
                        total += count;
694
695
                }
695
696
        } else {
696
 
                g_warning("No content for medium, nothing to write");
 
697
                g_warning ("No content for medium, nothing to write");
697
698
        }
698
699
 
699
700
        return total;
708
709
        CamelMimeParser *parser;
709
710
        gboolean success;
710
711
 
711
 
        d(printf("mime_part::construct_from_stream()\n"));
 
712
        d (printf ("mime_part::construct_from_stream()\n"));
712
713
 
713
714
        parser = camel_mime_parser_new ();
714
715
        if (camel_mime_parser_init_with_stream (parser, stream, error) == -1) {
748
749
                headers = camel_mime_parser_headers_raw (parser);
749
750
 
750
751
                /* if content-type exists, process it first, set for fallback charset in headers */
751
 
                content = camel_header_raw_find(&headers, "content-type", NULL);
 
752
                content = camel_header_raw_find (&headers, "content-type", NULL);
752
753
                if (content)
753
 
                        mime_part_process_header((CamelMedium *)dw, "content-type", content);
 
754
                        mime_part_process_header ((CamelMedium *) dw, "content-type", content);
754
755
 
755
756
                while (headers) {
756
 
                        if (g_ascii_strcasecmp(headers->name, "content-type") == 0
 
757
                        if (g_ascii_strcasecmp (headers->name, "content-type") == 0
757
758
                            && headers->value != content)
758
 
                                camel_medium_add_header((CamelMedium *)dw, "X-Invalid-Content-Type", headers->value);
 
759
                                camel_medium_add_header ((CamelMedium *) dw, "X-Invalid-Content-Type", headers->value);
759
760
                        else
760
761
                                camel_medium_add_header ((CamelMedium *) dw, headers->name, headers->value);
761
762
                        headers = headers->next;
765
766
                        mime_part, parser, cancellable, error);
766
767
                break;
767
768
        default:
768
 
                g_warning("Invalid state encountered???: %u", camel_mime_parser_state(parser));
 
769
                g_warning ("Invalid state encountered???: %u", camel_mime_parser_state (parser));
769
770
        }
770
771
 
771
772
        err = camel_mime_parser_errno (parser);
1381
1382
 
1382
1383
        if (mime_part->priv->disposition == NULL)
1383
1384
                mime_part->priv->disposition =
1384
 
                        camel_content_disposition_decode("attachment");
 
1385
                        camel_content_disposition_decode ("attachment");
1385
1386
 
1386
1387
        camel_header_set_param (
1387
1388
                &mime_part->priv->disposition->params, "filename", filename);