return;
}
memset(client, 0, sizeof(*client));
- int res = io_create(master->loop, (uv_handle_t *)client, SOCK_STREAM, 0);
+ int res = io_create(master->loop, (uv_handle_t *)client, SOCK_STREAM, AF_UNSPEC);
if (res) {
if (res == UV_EMFILE) {
worker->too_many_open = true;
int tcp_bindfd(uv_tcp_t *handle, int fd);
int tcp_bindfd_tls(uv_tcp_t *handle, int fd);
-/** Initialize the handle, incl. ->data = struct session * instance. type = SOCK_* */
+/** Initialize the handle, incl. ->data = struct session * instance.
+ * \param type = SOCK_*
+ * \param family = AF_* */
int io_create(uv_loop_t *loop, uv_handle_t *handle, int type, unsigned family);
void io_deinit(uv_handle_t *handle);
void io_free(uv_handle_t *handle);
} else {
free(buf);
errno = ENOMEM;
- ret = -1;
+ return -1;
}
/* Perform an asynchronous write with a callback */
return client_paramlist_entry_free(entry);
}
-int tls_client_params_clear(map_t *tls_client_paramlist, const char *addr, uint16_t port)
-{
- if (!tls_client_paramlist || !addr) {
- return kr_error(EINVAL);
- }
-
- /* Parameters are OK */
-
- char key[INET6_ADDRSTRLEN + 6];
- size_t keylen = sizeof(key);
- if (kr_straddr_join(addr, port, key, &keylen) != kr_ok()) {
- return kr_error(EINVAL);
- }
-
- struct tls_client_paramlist_entry *entry = map_get(tls_client_paramlist, key);
- if (entry != NULL) {
- client_paramlist_entry_unref(entry);
- map_del(tls_client_paramlist, key);
- }
-
- return kr_ok();
-}
-
int tls_client_params_set(map_t *tls_client_paramlist,
const char *addr, uint16_t port,
const char *param, tls_client_param_t param_type)
struct tls_client_paramlist_entry *tls_client_try_upgrade(map_t *tls_client_paramlist,
const struct sockaddr *addr);
-/*! Clear (remove) TLS parameters for given address. */
-int tls_client_params_clear(map_t *tls_client_paramlist, const char *addr, uint16_t port);
-
/*! Set TLS authentication parameters for given address.
* Note: hostnames must be imported before ca files,
* otherwise ca files will not be imported at all.