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

« back to all changes in this revision

Viewing changes to camel/providers/pop3/camel-pop3-stream.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:
1
 
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
2
 
 *
 
1
/*
3
2
 * Author:
4
3
 *  Michael Zucchi <notzed@ximian.com>
5
4
 *
83
82
                        CAMEL_POP3_STREAM_SIZE - (is->end - is->buf),
84
83
                        cancellable, &local_error);
85
84
                if (local_error) {
86
 
                        dd (printf ("POP3_STREAM_FILL: Failed to read bytes: %s\n", local_error->message));
87
85
                        g_propagate_error (error, local_error);
88
86
                }
89
87
 
136
134
                                is->ptr = p + 3;
137
135
                                is->mode = CAMEL_POP3_STREAM_EOD;
138
136
                                is->state = 0;
139
 
                                dd (printf ("POP3_STREAM_READ (%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
140
137
                                return o - buffer;
141
138
                        }
142
139
                        p++;
169
166
        is->ptr = p;
170
167
        is->state = state;
171
168
 
172
 
        dd (printf ("POP3_STREAM_READ (%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
173
 
 
174
169
        return o - buffer;
175
170
}
176
171
 
184
179
        CamelPOP3Stream *is = (CamelPOP3Stream *) stream;
185
180
 
186
181
        if (strncmp (buffer, "PASS ", 5) != 0)
187
 
                dd (printf ("POP3_STREAM_WRITE (%d):\n%.*s\n", (gint)n, (gint)n, buffer));
 
182
                dd (printf ("POP3_STREAM_WRITE (%d):\n%.*s\n", (gint) n, (gint) n, buffer));
188
183
        else
189
 
                dd (printf ("POP3_STREAM_WRITE (%d):\nPASS xxxxxxxx\n", (gint)n));
 
184
                dd (printf ("POP3_STREAM_WRITE (%d):\nPASS xxxxxxxx\n", (gint) n));
190
185
 
191
186
        return camel_stream_write (is->source, buffer, n, cancellable, error);
192
187
}
292
287
        p = is->ptr;
293
288
        e = is->end;
294
289
 
295
 
        /* Data mode, convert leading '..' to '.', and stop when we reach a solitary '.' */
 
290
        /* Data mode, convert leading '..' to '.',
 
291
         * and stop when we reach a solitary '.' */
296
292
        if (is->mode == CAMEL_POP3_STREAM_DATA) {
297
293
                /* need at least 3 chars in buffer */
298
294
                while (e - p < 3) {
412
408
                                        is->mode = CAMEL_POP3_STREAM_EOD;
413
409
                                        is->state = 0;
414
410
 
415
 
                                        dd (printf ("POP3_STREAM_GETD (%s,%d): '%.*s'\n", "last", *len, (gint)*len, *start));
416
 
 
417
411
                                        return 0;
418
412
                                }
419
413
 
420
 
                                /* If at start, just skip '.', else return data upto '.' but skip it */
 
414
                                /* If at start, just skip '.', else
 
415
                                 * return data upto '.' but skip it. */
421
416
                                if (p == s) {
422
417
                                        s++;
423
418
                                        p++;
427
422
                                        *start = s;
428
423
                                        is->state = 1;
429
424
 
430
 
                                        dd (printf ("POP3_STREAM_GETD (%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
431
 
 
432
425
                                        return 1;
433
426
                                }
434
427
                        }
452
445
        *len = p-s;
453
446
        *start = s;
454
447
 
455
 
        dd (printf ("POP3_STREAM_GETD (%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
456
 
 
457
448
        return 1;
458
449
}