~ubuntu-branches/ubuntu/trusty/postfix/trusty-updates

« back to all changes in this revision

Viewing changes to src/global/smtp_stream.c

Tags: upstream-2.3.1
ImportĀ upstreamĀ versionĀ 2.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
/*      int     smtp_get(vp, stream, maxlen)
24
24
/*      VSTRING *vp;
25
25
/*      VSTREAM *stream;
26
 
/*      int     maxlen;
 
26
/*      ssize_t maxlen;
27
27
/*
28
28
/*      void    smtp_fputs(str, len, stream)
29
29
/*      const char *str;
30
 
/*      int     len;
 
30
/*      ssize_t len;
31
31
/*      VSTREAM *stream;
32
32
/*
33
33
/*      void    smtp_fwrite(str, len, stream)
34
34
/*      const char *str;
35
 
/*      int     len;
 
35
/*      ssize_t len;
36
36
/*      VSTREAM *stream;
37
37
/*
38
38
/*      void    smtp_fputc(ch, stream)
95
95
/*      An I/O error happened, or the peer has disconnected unexpectedly.
96
96
/* .IP SMTP_ERR_TIME
97
97
/*      The time limit specified to smtp_timeout_setup() was exceeded.
 
98
/* .PP
 
99
/*      Additional error codes that may be used by applications:
 
100
/* .IP SMTP_ERR_QUIET
 
101
/*      Perform silent cleanup; the error was already reported by
 
102
/*      the application.
 
103
/*      This error is never generated by the smtp_stream(3) module, but
 
104
/*      is defined for application-specific use.
 
105
/* .IP SMTP_ERR_NONE
 
106
/*      A non-error code that makes setjmp()/longjmp() convenient
 
107
/*      to use.
98
108
/* BUGS
99
109
/*      The timeout deadline affects all I/O on the named stream, not
100
110
/*      just the I/O done on behalf of this module.
247
257
 
248
258
/* smtp_get - read one line from SMTP peer */
249
259
 
250
 
int     smtp_get(VSTRING *vp, VSTREAM *stream, int bound)
 
260
int     smtp_get(VSTRING *vp, VSTREAM *stream, ssize_t bound)
251
261
{
252
262
    int     last_char;
253
263
    int     next_char;
317
327
 
318
328
/* smtp_fputs - write one line to SMTP peer */
319
329
 
320
 
void    smtp_fputs(const char *cp, int todo, VSTREAM *stream)
 
330
void    smtp_fputs(const char *cp, ssize_t todo, VSTREAM *stream)
321
331
{
322
 
    unsigned err;
 
332
    ssize_t  err;
323
333
 
324
334
    if (todo < 0)
325
 
        msg_panic("smtp_fputs: negative todo %d", todo);
 
335
        msg_panic("smtp_fputs: negative todo %ld", (long) todo);
326
336
 
327
337
    /*
328
338
     * Do the I/O, protected against timeout.
344
354
 
345
355
/* smtp_fwrite - write one string to SMTP peer */
346
356
 
347
 
void    smtp_fwrite(const char *cp, int todo, VSTREAM *stream)
 
357
void    smtp_fwrite(const char *cp, ssize_t todo, VSTREAM *stream)
348
358
{
349
 
    unsigned err;
 
359
    ssize_t  err;
350
360
 
351
361
    if (todo < 0)
352
 
        msg_panic("smtp_fwrite: negative todo %d", todo);
 
362
        msg_panic("smtp_fwrite: negative todo %ld", (long) todo);
353
363
 
354
364
    /*
355
365
     * Do the I/O, protected against timeout.