~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-master/anvil-client.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2009-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2009-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "ioloop.h"
5
 
#include "network.h"
 
5
#include "net.h"
6
6
#include "istream.h"
7
7
#include "ostream.h"
8
8
#include "array.h"
24
24
        struct timeout *to_reconnect;
25
25
        time_t last_reconnect;
26
26
 
27
 
        ARRAY_DEFINE(queries_arr, struct anvil_query);
 
27
        ARRAY(struct anvil_query) queries_arr;
28
28
        struct aqueue *queries;
29
29
 
30
30
        bool (*reconnect_callback)(void);
140
140
        client->fd = fd;
141
141
        client->input = i_stream_create_fd(fd, ANVIL_INBUF_SIZE, FALSE);
142
142
        client->output = o_stream_create_fd(fd, (size_t)-1, FALSE);
 
143
        o_stream_set_no_error_handling(client->output, TRUE);
143
144
        client->io = io_add(fd, IO_READ, anvil_input, client);
144
 
        o_stream_send_str(client->output, ANVIL_HANDSHAKE);
 
145
        o_stream_nsend_str(client->output, ANVIL_HANDSHAKE);
145
146
        return 0;
146
147
}
147
148
 
185
186
        iov[0].iov_len = strlen(cmd);
186
187
        iov[1].iov_base = "\n";
187
188
        iov[1].iov_len = 1;
188
 
        o_stream_sendv(client->output, iov, 2);
 
189
        o_stream_nsendv(client->output, iov, 2);
189
190
        return 0;
190
191
}
191
192