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

« back to all changes in this revision

Viewing changes to src/global/rewrite_clnt.c

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
VSTRING *rewrite_clnt(const char *rule, const char *addr, VSTRING *result)
82
82
{
83
83
    VSTREAM *stream;
 
84
    int     server_flags;
84
85
 
85
86
    /*
86
87
     * One-entry cache.
135
136
                       ATTR_TYPE_END) != 0
136
137
            || vstream_fflush(stream)
137
138
            || attr_scan(stream, ATTR_FLAG_STRICT,
 
139
                         ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &server_flags,
138
140
                         ATTR_TYPE_STR, MAIL_ATTR_ADDR, result,
139
 
                         ATTR_TYPE_END) != 1) {
 
141
                         ATTR_TYPE_END) != 2) {
140
142
            if (msg_verbose || (errno != EPIPE && errno != ENOENT))
141
143
                msg_warn("problem talking to service %s: %m",
142
144
                         var_rewrite_service);
144
146
            if (msg_verbose)
145
147
                msg_info("rewrite_clnt: %s: %s -> %s",
146
148
                         rule, addr, vstring_str(result));
 
149
            /* Server-requested disconnect. */
 
150
            if (server_flags != 0)
 
151
                clnt_stream_recover(rewrite_clnt_stream);
147
152
            break;
148
153
        }
149
154
        sleep(1);                               /* XXX make configurable */