Commit 2e9847f3 authored by Niels Möller's avatar Niels Möller

* src/io.c (choose_address): Try creating a socket of the

appropriate type.
(address_info2sockaddr): Added argument for returning an
appropriate socket.
(address_info2sockaddr) [WITH_IPV6]: Pass on argument to choose_address.
(address_info2sockaddr) [!WITH_IPV6]: Create socket.
(io_connect): Added socket argument.
(io_listen): Likewise.
(io_listen_local): Updated for the io_listen change.
(io_connect_local): Updated for the io_connect change.

Rev: src/io.h:
parent 7d51bffc
......@@ -256,7 +256,7 @@ sockaddr2info(size_t addr_len,
struct sockaddr *
address_info2sockaddr(socklen_t *length,
struct address_info *a,
const int *preference,
int *socket,
int lookup);
/* Returns an exception, if anything went wrong */
......@@ -284,6 +284,7 @@ make_exc_finish_read_handler(struct lsh_fd *fd,
struct lsh_fd *
io_connect(struct io_backend *b,
int socket,
struct sockaddr *remote,
socklen_t remote_length,
struct command_continuation *c,
......@@ -291,6 +292,8 @@ io_connect(struct io_backend *b,
struct lsh_fd *
io_listen(struct io_backend *b,
/* Should be an open socket of the right type. */
int socket,
struct sockaddr *local,
socklen_t length,
struct io_callback *callback,
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment