mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[network] cast
This commit is contained in:
parent
3ca726ac98
commit
7d3cff0655
@ -242,28 +242,28 @@ static void
|
||||
set_connection_socket_state(struct socket *socket, struct connection_state state)
|
||||
{
|
||||
assert(socket);
|
||||
set_connection_state(socket->conn, state);
|
||||
set_connection_state((struct connection *)socket->conn, state);
|
||||
}
|
||||
|
||||
static void
|
||||
set_connection_socket_timeout(struct socket *socket, struct connection_state state)
|
||||
{
|
||||
assert(socket);
|
||||
set_connection_timeout(socket->conn);
|
||||
set_connection_timeout((struct connection *)socket->conn);
|
||||
}
|
||||
|
||||
static void
|
||||
retry_connection_socket(struct socket *socket, struct connection_state state)
|
||||
{
|
||||
assert(socket);
|
||||
retry_connection(socket->conn, state);
|
||||
retry_connection((struct connection *)socket->conn, state);
|
||||
}
|
||||
|
||||
static void
|
||||
done_connection_socket(struct socket *socket, struct connection_state state)
|
||||
{
|
||||
assert(socket);
|
||||
abort_connection(socket->conn, state);
|
||||
abort_connection((struct connection *)socket->conn, state);
|
||||
}
|
||||
|
||||
static struct connection *
|
||||
@ -348,7 +348,7 @@ stat_timer(struct connection *conn)
|
||||
static void
|
||||
upload_stat_timer(struct connection *conn)
|
||||
{
|
||||
struct http_connection_info *http = conn->info;
|
||||
struct http_connection_info *http = (struct http_connection_info *)conn->info;
|
||||
|
||||
assert(conn->http_upload_progress);
|
||||
assert(http);
|
||||
@ -684,7 +684,7 @@ check_keepalive_connections(void)
|
||||
for (; p > MAX_KEEPALIVE_CONNECTIONS; p--) {
|
||||
assertm(!list_empty(keepalive_connections), "keepalive list empty");
|
||||
if_assert_failed return;
|
||||
done_keepalive_connection(keepalive_connections.prev);
|
||||
done_keepalive_connection((struct keepalive_connection *)keepalive_connections.prev);
|
||||
}
|
||||
|
||||
if (!list_empty(keepalive_connections))
|
||||
@ -696,7 +696,7 @@ static inline void
|
||||
abort_all_keepalive_connections(void)
|
||||
{
|
||||
while (!list_empty(keepalive_connections))
|
||||
done_keepalive_connection(keepalive_connections.next);
|
||||
done_keepalive_connection((struct keepalive_connection *)keepalive_connections.next);
|
||||
|
||||
check_keepalive_connections();
|
||||
}
|
||||
@ -839,7 +839,7 @@ check_queue(void)
|
||||
int max_conns = get_opt_int("connection.max_connections", NULL);
|
||||
|
||||
again:
|
||||
conn = connection_queue.next;
|
||||
conn = (struct connection *)connection_queue.next;
|
||||
check_queue_bugs();
|
||||
check_keepalive_connections();
|
||||
|
||||
@ -1219,7 +1219,7 @@ void
|
||||
abort_all_connections(void)
|
||||
{
|
||||
while (!list_empty(connection_queue)) {
|
||||
abort_connection(connection_queue.next,
|
||||
abort_connection((struct connection *)connection_queue.next,
|
||||
connection_state(S_INTERRUPTED));
|
||||
}
|
||||
|
||||
|
@ -529,7 +529,7 @@ find_host(char *name, void **queryref,
|
||||
void
|
||||
kill_dns_request(void **queryref)
|
||||
{
|
||||
struct dnsquery *query = *queryref;
|
||||
struct dnsquery *query = (struct dnsquery *)*queryref;
|
||||
|
||||
assert(query);
|
||||
|
||||
|
@ -50,7 +50,7 @@ done_progress(struct progress *progress)
|
||||
static void
|
||||
progress_timeout(void *progress_voidptr)
|
||||
{
|
||||
struct progress *const progress = progress_voidptr;
|
||||
struct progress *const progress = (struct progress *const)progress_voidptr;
|
||||
|
||||
progress->timer = TIMER_ID_UNDEF;
|
||||
/* The expired timer ID has now been erased. */
|
||||
|
@ -804,7 +804,7 @@ generic_write(struct socket *socket, char *data, int len)
|
||||
static void
|
||||
write_select(struct socket *socket)
|
||||
{
|
||||
struct write_buffer *wb = socket->write_buffer;
|
||||
struct write_buffer *wb = (struct write_buffer *)socket->write_buffer;
|
||||
int wr;
|
||||
|
||||
assertm(wb != NULL, "write socket has no buffer");
|
||||
|
@ -57,7 +57,7 @@ match_hostname_pattern(const char *hostname,
|
||||
size_t literal_length;
|
||||
|
||||
++pattern;
|
||||
next_wildcard = memchr(pattern, '*',
|
||||
next_wildcard = (const char *)memchr(pattern, '*',
|
||||
pattern_end - pattern);
|
||||
if (next_wildcard == NULL)
|
||||
literal_length = pattern_end - pattern;
|
||||
|
@ -56,9 +56,9 @@
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
|
||||
#define ssl_do_connect(socket) SSL_get_error(socket->ssl, SSL_connect(socket->ssl))
|
||||
#define ssl_do_write(socket, data, len) SSL_write(socket->ssl, data, len)
|
||||
#define ssl_do_read(socket, data, len) SSL_read(socket->ssl, data, len)
|
||||
#define ssl_do_connect(socket) SSL_get_error((SSL *)socket->ssl, SSL_connect((SSL *)socket->ssl))
|
||||
#define ssl_do_write(socket, data, len) SSL_write((SSL *)socket->ssl, data, len)
|
||||
#define ssl_do_read(socket, data, len) SSL_read((SSL *)socket->ssl, data, len)
|
||||
#define ssl_do_close(socket) /* Hmh? No idea.. */
|
||||
|
||||
#elif defined(CONFIG_GNUTLS)
|
||||
@ -316,9 +316,9 @@ verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
|
||||
return preverify_ok;
|
||||
|
||||
cert = X509_STORE_CTX_get_current_cert(ctx);
|
||||
ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
|
||||
socket = SSL_get_ex_data(ssl, socket_SSL_ex_data_idx);
|
||||
conn = socket->conn;
|
||||
ssl = (SSL *)X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
|
||||
socket = (struct socket *)SSL_get_ex_data(ssl, socket_SSL_ex_data_idx);
|
||||
conn = (struct connection *)socket->conn;
|
||||
host_in_uri = get_uri_string(conn->proxied_uri, URI_DNS_HOST);
|
||||
if (!host_in_uri)
|
||||
return 0;
|
||||
@ -326,7 +326,7 @@ verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
|
||||
/* RFC 5280 section 4.2.1.6 describes the subjectAltName extension.
|
||||
* RFC 2818 section 3.1 says Common Name must not be used
|
||||
* if dNSName is present. */
|
||||
alts = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL);
|
||||
alts = (GENERAL_NAMES *)X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL);
|
||||
if (alts != NULL) {
|
||||
int alt_count;
|
||||
int alt_pos;
|
||||
@ -421,7 +421,7 @@ ssl_connect(struct socket *socket)
|
||||
{
|
||||
int ret;
|
||||
char *server_name;
|
||||
struct connection *conn = socket->conn;
|
||||
struct connection *conn = (struct connection *)socket->conn;
|
||||
|
||||
/* TODO: Recode server_name to UTF-8. */
|
||||
server_name = get_uri_string(conn->proxied_uri, URI_HOST);
|
||||
@ -447,10 +447,10 @@ ssl_connect(struct socket *socket)
|
||||
ssl_set_no_tls(socket);
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
SSL_set_fd(socket->ssl, socket->fd);
|
||||
SSL_set_fd((SSL *)socket->ssl, socket->fd);
|
||||
|
||||
if (socket->verify && get_opt_bool("connection.ssl.cert_verify", NULL))
|
||||
SSL_set_verify(socket->ssl, SSL_VERIFY_PEER
|
||||
SSL_set_verify((SSL *)socket->ssl, SSL_VERIFY_PEER
|
||||
| SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
|
||||
verify_callback);
|
||||
|
||||
@ -538,7 +538,7 @@ ssl_write(struct socket *socket, char *data, int len)
|
||||
|
||||
if (wr <= 0) {
|
||||
#ifdef USE_OPENSSL
|
||||
int err = SSL_get_error(socket->ssl, wr);
|
||||
int err = SSL_get_error((SSL *)socket->ssl, wr);
|
||||
#elif defined(CONFIG_GNUTLS)
|
||||
int err = wr;
|
||||
#endif
|
||||
@ -567,7 +567,7 @@ ssl_read(struct socket *socket, char *data, int len)
|
||||
|
||||
if (rd <= 0) {
|
||||
#ifdef USE_OPENSSL
|
||||
int err = SSL_get_error(socket->ssl, rd);
|
||||
int err = SSL_get_error((SSL *)socket->ssl, rd);
|
||||
#elif defined(CONFIG_GNUTLS)
|
||||
int err = rd;
|
||||
#endif
|
||||
|
@ -72,7 +72,7 @@ socket_SSL_ex_data_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
|
||||
*
|
||||
* i.e., from_d always points to a pointer, even though
|
||||
* it is just a void * in the prototype. */
|
||||
struct socket *socket = *(void **) from_d;
|
||||
struct socket *socket = (struct socket *)*(void **)from_d;
|
||||
|
||||
assert(idx == socket_SSL_ex_data_idx);
|
||||
if_assert_failed return 0;
|
||||
@ -358,8 +358,8 @@ init_ssl_connection(struct socket *socket,
|
||||
socket->ssl = SSL_new(context);
|
||||
if (!socket->ssl) return S_SSL_ERROR;
|
||||
|
||||
if (!SSL_set_ex_data(socket->ssl, socket_SSL_ex_data_idx, socket)) {
|
||||
SSL_free(socket->ssl);
|
||||
if (!SSL_set_ex_data((SSL *)socket->ssl, socket_SSL_ex_data_idx, socket)) {
|
||||
SSL_free((SSL *)socket->ssl);
|
||||
socket->ssl = NULL;
|
||||
return S_SSL_ERROR;
|
||||
}
|
||||
@ -370,8 +370,8 @@ init_ssl_connection(struct socket *socket,
|
||||
* documented. The source shows that it returns 1 if
|
||||
* successful; on error, it calls SSLerr and returns 0. */
|
||||
if (server_name
|
||||
&& !SSL_set_tlsext_host_name(socket->ssl, server_name)) {
|
||||
SSL_free(socket->ssl);
|
||||
&& !SSL_set_tlsext_host_name((SSL *)socket->ssl, server_name)) {
|
||||
SSL_free((SSL *)socket->ssl);
|
||||
socket->ssl = NULL;
|
||||
return S_SSL_ERROR;
|
||||
}
|
||||
@ -451,7 +451,7 @@ init_ssl_connection(struct socket *socket,
|
||||
void
|
||||
done_ssl_connection(struct socket *socket)
|
||||
{
|
||||
ssl_t *ssl = socket->ssl;
|
||||
ssl_t *ssl = (SSL *)socket->ssl;
|
||||
|
||||
if (!ssl) return;
|
||||
#ifdef USE_OPENSSL
|
||||
@ -466,7 +466,7 @@ done_ssl_connection(struct socket *socket)
|
||||
char *
|
||||
get_ssl_connection_cipher(struct socket *socket)
|
||||
{
|
||||
ssl_t *ssl = socket->ssl;
|
||||
ssl_t *ssl = (SSL *)socket->ssl;
|
||||
struct string str;
|
||||
|
||||
if (!init_string(&str)) return NULL;
|
||||
|
@ -121,7 +121,7 @@ handle_mouse(int cons, void (*fn)(void *, char *, int),
|
||||
void
|
||||
unhandle_mouse(void *h)
|
||||
{
|
||||
struct gpm_mouse_spec *gms = h;
|
||||
struct gpm_mouse_spec *gms = (struct gpm_mouse_spec *)h;
|
||||
|
||||
if (!gms) return;
|
||||
|
||||
@ -133,7 +133,7 @@ unhandle_mouse(void *h)
|
||||
void
|
||||
suspend_mouse(void *h)
|
||||
{
|
||||
struct gpm_mouse_spec *gms = h;
|
||||
struct gpm_mouse_spec *gms = (struct gpm_mouse_spec *)h;
|
||||
|
||||
if (!gms) return;
|
||||
|
||||
@ -146,7 +146,7 @@ suspend_mouse(void *h)
|
||||
void
|
||||
resume_mouse(void *h)
|
||||
{
|
||||
struct gpm_mouse_spec *gms = h;
|
||||
struct gpm_mouse_spec *gms = (struct gpm_mouse_spec *)h;
|
||||
|
||||
if (!gms) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user