librb: remove socklen parameter from rb_connect_tcp

This commit is contained in:
Simon Arlott 2016-04-24 17:11:20 +01:00
parent d4214e9445
commit 5ad62c80ee
No known key found for this signature in database
GPG key ID: C8975F2043CA5D24
10 changed files with 15 additions and 19 deletions

View file

@ -324,7 +324,7 @@ ident_start(struct auth_client *auth)
rb_connect_tcp(query->F, (struct sockaddr *)&c_addr, rb_connect_tcp(query->F, (struct sockaddr *)&c_addr,
(struct sockaddr *)&l_addr, (struct sockaddr *)&l_addr,
GET_SS_LEN(&l_addr), ident_connected, ident_connected,
auth, ident_timeout); auth, ident_timeout);
set_provider_running(auth, SELF_PID); set_provider_running(auth, SELF_PID);

View file

@ -456,13 +456,11 @@ establish_connection(struct auth_client *auth, struct opm_proxy *proxy)
rb_connect_tcp(scan->F, rb_connect_tcp(scan->F,
(struct sockaddr *)&c_a, (struct sockaddr *)&c_a,
(struct sockaddr *)&l_a, (struct sockaddr *)&l_a,
GET_SS_LEN(&l_a),
opm_connected, scan, opm_timeout); opm_connected, scan, opm_timeout);
else else
rb_connect_tcp_ssl(scan->F, rb_connect_tcp_ssl(scan->F,
(struct sockaddr *)&c_a, (struct sockaddr *)&c_a,
(struct sockaddr *)&l_a, (struct sockaddr *)&l_a,
GET_SS_LEN(&l_a),
opm_connected, scan, opm_timeout); opm_connected, scan, opm_timeout);
} }

View file

@ -1155,7 +1155,6 @@ serv_connect(struct server_conf *server_p, struct Client *by)
rb_connect_tcp(client_p->localClient->F, rb_connect_tcp(client_p->localClient->F,
(struct sockaddr *)&sa_connect, (struct sockaddr *)&sa_connect,
GET_SS_FAMILY(&sa_bind) == AF_UNSPEC ? NULL : (struct sockaddr *)&sa_bind, GET_SS_FAMILY(&sa_bind) == AF_UNSPEC ? NULL : (struct sockaddr *)&sa_bind,
GET_SS_LEN(&sa_bind),
ServerConfSSL(server_p) ? serv_connect_ssl_callback : serv_connect_callback, ServerConfSSL(server_p) ? serv_connect_ssl_callback : serv_connect_callback,
client_p, ConfigFileEntry.connect_timeout); client_p, ConfigFileEntry.connect_timeout);
return 1; return 1;

View file

@ -34,7 +34,7 @@ int rb_get_random(void *buf, size_t length);
const char *rb_get_ssl_strerror(rb_fde_t *F); const char *rb_get_ssl_strerror(rb_fde_t *F);
void rb_ssl_start_accepted(rb_fde_t *new_F, ACCB * cb, void *data, int timeout); void rb_ssl_start_accepted(rb_fde_t *new_F, ACCB * cb, void *data, int timeout);
void rb_ssl_start_connected(rb_fde_t *F, CNCB * callback, void *data, int timeout); void rb_ssl_start_connected(rb_fde_t *F, CNCB * callback, void *data, int timeout);
void rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest, struct sockaddr *clocal, int socklen, void rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest, struct sockaddr *clocal,
CNCB * callback, void *data, int timeout); CNCB * callback, void *data, int timeout);
void rb_ssl_accept_setup(rb_fde_t *F, rb_fde_t *new_F, struct sockaddr *st, int addrlen); void rb_ssl_accept_setup(rb_fde_t *F, rb_fde_t *new_F, struct sockaddr *st, int addrlen);
void rb_ssl_shutdown(rb_fde_t *F); void rb_ssl_shutdown(rb_fde_t *F);

View file

@ -121,8 +121,8 @@ int rb_get_sockerr(rb_fde_t *);
void rb_settimeout(rb_fde_t *, time_t, PF *, void *); void rb_settimeout(rb_fde_t *, time_t, PF *, void *);
void rb_checktimeouts(void *); void rb_checktimeouts(void *);
void rb_connect_tcp(rb_fde_t *, struct sockaddr *, struct sockaddr *, int, CNCB *, void *, int); void rb_connect_tcp(rb_fde_t *, struct sockaddr *, struct sockaddr *, CNCB *, void *, int);
void rb_connect_tcp_ssl(rb_fde_t *, struct sockaddr *, struct sockaddr *, int, CNCB *, void *, int); void rb_connect_tcp_ssl(rb_fde_t *, struct sockaddr *, struct sockaddr *, CNCB *, void *, int);
int rb_connect_sockaddr(rb_fde_t *, struct sockaddr *addr, int len); int rb_connect_sockaddr(rb_fde_t *, struct sockaddr *addr, int len);
const char *rb_errstr(int status); const char *rb_errstr(int status);

View file

@ -410,10 +410,10 @@ rb_accept_tcp(rb_fde_t *F, ACPRE * precb, ACCB * callback, void *data)
/* /*
* void rb_connect_tcp(rb_platform_fd_t fd, struct sockaddr *dest, * void rb_connect_tcp(rb_platform_fd_t fd, struct sockaddr *dest,
* struct sockaddr *clocal, int socklen, * struct sockaddr *clocal,
* CNCB *callback, void *data, int timeout) * CNCB *callback, void *data, int timeout)
* Input: An fd to connect with, a host and port to connect to, * Input: An fd to connect with, a host and port to connect to,
* a local sockaddr to connect from + length(or NULL to use the * a local sockaddr to connect from (or NULL to use the
* default), a callback, the data to pass into the callback, the * default), a callback, the data to pass into the callback, the
* address family. * address family.
* Output: None. * Output: None.
@ -423,7 +423,7 @@ rb_accept_tcp(rb_fde_t *F, ACPRE * precb, ACCB * callback, void *data)
*/ */
void void
rb_connect_tcp(rb_fde_t *F, struct sockaddr *dest, rb_connect_tcp(rb_fde_t *F, struct sockaddr *dest,
struct sockaddr *clocal, int socklen, CNCB * callback, void *data, int timeout) struct sockaddr *clocal, CNCB * callback, void *data, int timeout)
{ {
if(F == NULL) if(F == NULL)
return; return;
@ -442,7 +442,7 @@ rb_connect_tcp(rb_fde_t *F, struct sockaddr *dest,
* virtual host IP, for completeness. * virtual host IP, for completeness.
* -- adrian * -- adrian
*/ */
if((clocal != NULL) && (bind(F->fd, clocal, socklen) < 0)) if((clocal != NULL) && (bind(F->fd, clocal, GET_SS_LEN(clocal)) < 0))
{ {
/* Failure, call the callback with RB_ERR_BIND */ /* Failure, call the callback with RB_ERR_BIND */
rb_connect_callback(F, RB_ERR_BIND); rb_connect_callback(F, RB_ERR_BIND);

View file

@ -526,7 +526,7 @@ rb_ssl_tryconn(rb_fde_t *F, int status, void *data)
void void
rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest, rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest,
struct sockaddr *clocal, int socklen, CNCB * callback, void *data, int timeout) struct sockaddr *clocal, CNCB * callback, void *data, int timeout)
{ {
struct ssl_connect *sconn; struct ssl_connect *sconn;
if(F == NULL) if(F == NULL)
@ -536,7 +536,7 @@ rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest,
sconn->data = data; sconn->data = data;
sconn->callback = callback; sconn->callback = callback;
sconn->timeout = timeout; sconn->timeout = timeout;
rb_connect_tcp(F, dest, clocal, socklen, rb_ssl_tryconn, sconn, timeout); rb_connect_tcp(F, dest, clocal, rb_ssl_tryconn, sconn, timeout);
} }

View file

@ -474,7 +474,7 @@ rb_ssl_tryconn(rb_fde_t *F, int status, void *data)
void void
rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest, rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest,
struct sockaddr *clocal, int socklen, CNCB * callback, void *data, int timeout) struct sockaddr *clocal, CNCB * callback, void *data, int timeout)
{ {
struct ssl_connect *sconn; struct ssl_connect *sconn;
if(F == NULL) if(F == NULL)
@ -484,7 +484,7 @@ rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest,
sconn->data = data; sconn->data = data;
sconn->callback = callback; sconn->callback = callback;
sconn->timeout = timeout; sconn->timeout = timeout;
rb_connect_tcp(F, dest, clocal, socklen, rb_ssl_tryconn, sconn, timeout); rb_connect_tcp(F, dest, clocal, rb_ssl_tryconn, sconn, timeout);
} }
void void

View file

@ -112,7 +112,7 @@ rb_ssl_start_connected(rb_fde_t *F, CNCB * callback, void *data, int timeout)
void void
rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest, rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest,
struct sockaddr *clocal, int socklen, CNCB * callback, void *data, int timeout) struct sockaddr *clocal, CNCB * callback, void *data, int timeout)
{ {
return; return;
} }

View file

@ -575,7 +575,7 @@ rb_ssl_tryconn(rb_fde_t *F, int status, void *data)
void void
rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest, rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest,
struct sockaddr *clocal, int socklen, CNCB * callback, void *data, int timeout) struct sockaddr *clocal, CNCB * callback, void *data, int timeout)
{ {
struct ssl_connect *sconn; struct ssl_connect *sconn;
if(F == NULL) if(F == NULL)
@ -585,8 +585,7 @@ rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest,
sconn->data = data; sconn->data = data;
sconn->callback = callback; sconn->callback = callback;
sconn->timeout = timeout; sconn->timeout = timeout;
rb_connect_tcp(F, dest, clocal, socklen, rb_ssl_tryconn, sconn, timeout); rb_connect_tcp(F, dest, clocal, rb_ssl_tryconn, sconn, timeout);
} }
void void