connection.c revision 8a4a0ef8264d95ffb2ba8f6f109f94ea7f3454e8
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi/* Copyright (c) 2013-2017 Dovecot authors, see the included COPYING file */
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomistatic void connection_idle_timeout(struct connection *conn)
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi conn->disconnect_reason = CONNECTION_DISCONNECT_IDLE_TIMEOUT;
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomistatic void connection_connect_timeout(struct connection *conn)
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi conn->disconnect_reason = CONNECTION_DISCONNECT_CONNECT_TIMEOUT;
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomivoid connection_input_default(struct connection *conn)
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi const char *line;
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi case 0: /* allow calling this function for buffered input */
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi while (!input->closed && (line = i_stream_next_line(input)) != NULL) {
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi conn->disconnect_reason = CONNECTION_DISCONNECT_DEINIT;
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomiint connection_verify_version(struct connection *conn,
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi const char *const *args)
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi /* VERSION <tab> service_name <tab> major version <tab> minor version */
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi i_error("%s didn't reply with a valid VERSION line",
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi if (strcmp(args[1], conn->list->set.service_name_in) != 0) {
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi if (recv_major_version != conn->list->set.major_version) {
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi "but we support only %u (mixed old and new binaries?)",
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomiint connection_input_line_default(struct connection *conn, const char *line)
f7060b8499ed07205734cf7af94ad5405fa687b5Aki Tuomi const char *const *args;
if (success)
if (!success) {
int fd;
i_unreached();
unsigned int msecs =
i_unreached();
return t_strdup_printf(
struct connection_list *
return list;