Skip to content

Commit

Permalink
lib: connection - Make providing a name for the connection optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbosch committed Mar 1, 2019
1 parent bb57571 commit b7181b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/lib/connection.c
Expand Up @@ -512,7 +512,6 @@ void connection_init_server(struct connection_list *list,
struct connection *conn, const char *name,
int fd_in, int fd_out)
{
i_assert(name != NULL);
i_assert(!list->set.client);

connection_init_full(list, conn, name, fd_in, fd_out);
Expand Down Expand Up @@ -548,7 +547,6 @@ void connection_init_client_fd(struct connection_list *list,
struct connection *conn, const char *name,
int fd_in, int fd_out)
{
i_assert(name != NULL);
i_assert(list->set.client);

connection_init_full(list, conn, name, fd_in, fd_out);
Expand Down Expand Up @@ -624,8 +622,6 @@ void connection_init_from_streams(struct connection_list *list,
struct connection *conn, const char *name,
struct istream *input, struct ostream *output)
{
i_assert(name != NULL);

connection_init_full(list, conn, name,
i_stream_get_fd(input), o_stream_get_fd(output));

Expand Down
12 changes: 7 additions & 5 deletions src/lib/connection.h
Expand Up @@ -167,12 +167,12 @@ void connection_init(struct connection_list *list, struct connection *conn,
const char *name) ATTR_NULL(3);
void connection_init_server(struct connection_list *list,
struct connection *conn, const char *name,
int fd_in, int fd_out);
int fd_in, int fd_out) ATTR_NULL(3);
void connection_init_server_ip(struct connection_list *list,
struct connection *conn, const char *name,
int fd_in, int fd_out,
const struct ip_addr *remote_ip,
in_port_t remote_port) ATTR_NULL(6);
in_port_t remote_port) ATTR_NULL(3, 6);
void connection_init_client_ip(struct connection_list *list,
struct connection *conn, const char *name,
const struct ip_addr *ip, in_port_t port)
Expand All @@ -184,10 +184,12 @@ void connection_init_client_ip_from(struct connection_list *list,
void connection_init_client_unix(struct connection_list *list,
struct connection *conn, const char *path);
void connection_init_client_fd(struct connection_list *list,
struct connection *conn, const char *name, int fd_int, int fd_out);
struct connection *conn, const char *name,
int fd_int, int fd_out) ATTR_NULL(3);
void connection_init_from_streams(struct connection_list *list,
struct connection *conn, const char *name,
struct istream *input, struct ostream *output);
struct connection *conn, const char *name,
struct istream *input,
struct ostream *output) ATTR_NULL(3);

int connection_client_connect(struct connection *conn);

Expand Down

0 comments on commit b7181b1

Please sign in to comment.