~ubuntu-branches/ubuntu/raring/postfix/raring

« back to all changes in this revision

Viewing changes to src/global/smtp_stream.c

Tags: upstream-2.2.6
ImportĀ upstreamĀ versionĀ 2.2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
/*      void    smtp_flush(stream)
18
18
/*      VSTREAM *stream;
19
19
/*
 
20
/*      int     smtp_fgetc(stream)
 
21
/*      VSTREAM *stream;
 
22
/*
20
23
/*      int     smtp_get(vp, stream, maxlen)
21
24
/*      VSTRING *vp;
22
25
/*      VSTREAM *stream;
61
64
/*
62
65
/*      smtp_flush() flushes the named stream.
63
66
/*
 
67
/*      smtp_fgetc() reads one character from the named stream.
 
68
/*
64
69
/*      smtp_get() reads the named stream up to and including
65
70
/*      the next LF character and strips the trailing CR LF. The
66
71
/*      \fImaxlen\fR argument limits the length of a line of text,
216
221
    va_end(ap);
217
222
}
218
223
 
 
224
/* smtp_fgetc - read one character from SMTP peer */
 
225
 
 
226
int     smtp_fgetc(VSTREAM *stream)
 
227
{
 
228
    int     ch;
 
229
 
 
230
    /*
 
231
     * Do the I/O, protected against timeout.
 
232
     */
 
233
    smtp_timeout_reset(stream);
 
234
    ch = VSTREAM_GETC(stream);
 
235
    smtp_timeout_detect(stream);
 
236
 
 
237
    /*
 
238
     * See if there was a problem.
 
239
     */
 
240
    if (vstream_feof(stream) || vstream_ferror(stream)) {
 
241
        if (msg_verbose)
 
242
            msg_info("smtp_fgetc: EOF");
 
243
        vstream_longjmp(stream, SMTP_ERR_EOF);
 
244
    }
 
245
    return (ch);
 
246
}
 
247
 
219
248
/* smtp_get - read one line from SMTP peer */
220
249
 
221
250
int     smtp_get(VSTRING *vp, VSTREAM *stream, int bound)