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

« back to all changes in this revision

Viewing changes to camel/providers/nntp/camel-nntp-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
 *
96
95
                                        g_io_error_from_errno (errno),
97
96
                                        "%s", g_strerror (errno));
98
97
                        }
99
 
                        dd (printf ("NNTP_STREAM_FILL (ERROR): %d - '%s'\n", left, g_strerror (errno)));
100
98
                        return -1;
101
99
                }
102
100
        }
142
140
                                is->ptr = p + 3;
143
141
                                is->mode = CAMEL_NNTP_STREAM_EOD;
144
142
                                is->state = 0;
145
 
                                dd (printf ("NNTP_STREAM_READ (%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
146
143
                                return o - buffer;
147
144
                        }
148
145
                        p++;
175
172
        is->ptr = p;
176
173
        is->state = state;
177
174
 
178
 
        dd (printf ("NNTP_STREAM_READ (%d):\n%.*s\n", (gint)(o-buffer), (gint)(o-buffer), buffer));
179
 
 
180
175
        return o - buffer;
181
176
}
182
177
 
297
292
        p = is->ptr;
298
293
        e = is->end;
299
294
 
300
 
        /* Data mode, convert leading '..' to '.', and stop when we reach a solitary '.' */
 
295
        /* Data mode, convert leading '..' to '.',
 
296
         * and stop when we reach a solitary '.' */
301
297
        if (is->mode == CAMEL_NNTP_STREAM_DATA) {
302
298
                /* need at least 3 chars in buffer */
303
299
                while (e - p < 3) {
393
389
        *len = max;
394
390
        is->ptr += max;
395
391
 
396
 
        dd (printf ("NNTP_STREAM_GETS (%s,%d): '%.*s'\n", end==NULL?"more":"last", *len, (gint)*len, *start));
397
 
 
398
392
        return end == NULL ? 1 : 0;
399
393
}
400
394
 
458
452
                                        is->mode = CAMEL_NNTP_STREAM_EOD;
459
453
                                        is->state = 0;
460
454
 
461
 
                                        dd (printf ("NNTP_STREAM_GETD (%s,%d): '%.*s'\n", "last", *len, (gint)*len, *start));
462
 
 
463
455
                                        return 0;
464
456
                                }
465
457
 
466
 
                                /* If at start, just skip '.', else return data upto '.' but skip it */
 
458
                                /* If at start, just skip '.', else
 
459
                                 * return data upto '.' but skip it. */
467
460
                                if (p == s) {
468
461
                                        s++;
469
462
                                        p++;
473
466
                                        *start = s;
474
467
                                        is->state = 1;
475
468
 
476
 
                                        dd (printf ("NNTP_STREAM_GETD (%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
477
 
 
478
469
                                        return 1;
479
470
                                }
480
471
                        }
498
489
        *len = p-s;
499
490
        *start = s;
500
491
 
501
 
        dd (printf ("NNTP_STREAM_GETD (%s,%d): '%.*s'\n", "more", *len, (gint)*len, *start));
502
492
        return 1;
503
493
}
504
494