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

« back to all changes in this revision

Viewing changes to src/smtpstone/qmqp-sink.c

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
/*      multi-threaded QMQP test server
6
6
/* SYNOPSIS
7
7
/* .fi
8
 
/*      \fBqmqp-sink\fR [\fB-cv\fR] [\fB-x \fItime\fR]
 
8
/*      \fBqmqp-sink\fR [\fB-46cv\fR] [\fB-x \fItime\fR]
9
9
/*      [\fBinet:\fR][\fIhost\fR]:\fIport\fR \fIbacklog\fR
10
10
/*
11
 
/*      \fBqmqp-sink\fR [\fB-cv\fR] [\fB-x \fItime\fR]
 
11
/*      \fBqmqp-sink\fR [\fB-46cv\fR] [\fB-x \fItime\fR]
12
12
/*      \fBunix:\fR\fIpathname\fR \fIbacklog\fR
13
13
/* DESCRIPTION
14
14
/*      \fBqmqp-sink\fR listens on the named host (or address) and port.
15
15
/*      It receives messages from the network and throws them away.
16
16
/*      The purpose is to measure QMQP client performance, not protocol
17
17
/*      compliance.
18
 
/*      Connections can be accepted on IPV4 endpoints or UNIX-domain sockets.
19
 
/*      IPV4 is the default.
 
18
/*      Connections can be accepted on IPv4 or IPv6 endpoints, or on
 
19
/*      UNIX-domain sockets.
 
20
/*      IPv4 and IPv6 are the default.
20
21
/*      This program is the complement of the \fBqmqp-source\fR(1) program.
 
22
/* .IP \fB-4\fR
 
23
/*      Support IPv4 only. This option has no effect when
 
24
/*      Postfix is built without IPv6 support.
 
25
/* .IP \fB-6\fR
 
26
/*      Support IPv6 only. This option is not available when
 
27
/*      Postfix is built without IPv6 support.
21
28
/* .IP \fB-c\fR
22
29
/*      Display a running counter that is updated whenever a delivery
23
30
/*      is completed.
65
72
#include <iostuff.h>
66
73
#include <msg_vstream.h>
67
74
#include <netstring.h>
 
75
#include <inet_proto.h>
68
76
 
69
77
/* Global library. */
70
78
 
235
243
    int     backlog;
236
244
    int     ch;
237
245
    int     ttl;
 
246
    const char *protocols = INET_PROTO_NAME_ALL;
 
247
    INET_PROTO_INFO *proto_info;
238
248
 
239
249
    /*
240
250
     * Initialize diagnostics.
244
254
    /*
245
255
     * Parse JCL.
246
256
     */
247
 
    while ((ch = GETOPT(argc, argv, "cvx:")) > 0) {
 
257
    while ((ch = GETOPT(argc, argv, "46cvx:")) > 0) {
248
258
        switch (ch) {
 
259
        case '4':
 
260
            protocols = INET_PROTO_NAME_IPV4;
 
261
            break;
 
262
        case '6':
 
263
            protocols = INET_PROTO_NAME_IPV6;
 
264
            break;
249
265
        case 'c':
250
266
            count++;
251
267
            break;
269
285
    /*
270
286
     * Initialize.
271
287
     */
 
288
    proto_info = inet_proto_init("protocols", protocols);
272
289
    buffer = vstring_alloc(1024);
273
290
    if (strncmp(argv[optind], "unix:", 5) == 0) {
274
291
        sock = unix_listen(argv[optind] + 5, backlog, BLOCKING);