1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[http] cast

This commit is contained in:
Witold Filipczyk 2022-01-26 17:35:46 +01:00
parent 5fbead7f51
commit b0565cce64
5 changed files with 22 additions and 22 deletions

View File

@ -86,7 +86,7 @@ static char *
parse_data_protocol_header(struct connection *conn, int *base64)
{
struct uri *uri = conn->uri;
char *end = memchr(uri->data, ',', uri->datalen);
char *end = (char *)memchr(uri->data, ',', uri->datalen);
char *type = DEFAULT_DATA_MEDIATYPE;
int typelen = sizeof(DEFAULT_DATA_MEDIATYPE) - 1;

View File

@ -69,7 +69,7 @@ struct module cgi_protocol_module = struct_module(
static void
close_pipe_and_read(struct socket *data_socket)
{
struct connection *conn = data_socket->conn;
struct connection *conn = (struct connection *)data_socket->conn;
struct read_buffer *rb = alloc_read_buffer(conn->socket);
if (!rb) return;
@ -93,8 +93,8 @@ close_pipe_and_read(struct socket *data_socket)
static void
send_more_post_data(struct socket *socket)
{
struct connection *conn = socket->conn;
struct http_connection_info *http = conn->info;
struct connection *conn = (struct connection *)socket->conn;
struct http_connection_info *http = (struct http_connection_info *)conn->info;
char buffer[POST_BUFFER_SIZE];
int got;
struct connection_state error;
@ -115,7 +115,7 @@ send_more_post_data(struct socket *socket)
static void
send_post_data(struct connection *conn)
{
struct http_connection_info *http = conn->info;
struct http_connection_info *http = (struct http_connection_info *)conn->info;
char *post = conn->uri->post;
char *postend;
struct connection_state error;
@ -168,7 +168,7 @@ set_vars(struct connection *conn, char *script)
return -1;
}
http = conn->info;
http = (struct http_connection_info *)conn->info;
if (!open_http_post(&http->post, post, &error)) {
return -1;

View File

@ -214,7 +214,7 @@ static void
check_if_closed(struct socket *socket, struct read_buffer *rb)
{
if (socket->state == SOCKET_CLOSED) {
abort_connection(socket->conn, connection_state(S_OK));
abort_connection((struct connection *)socket->conn, connection_state(S_OK));
return;
}
http_got_header(socket, rb);

View File

@ -86,7 +86,7 @@ static const char *
http_code_to_string(int code)
{
const struct http_code *element
= bsearch((void *) (long) code, http_code,
= (const struct http_code *)bsearch((void *) (long) code, http_code,
sizeof_array(http_code),
sizeof(*element),
compare_http_codes);
@ -160,7 +160,7 @@ struct http_error_info {
static void
show_http_error_document(struct session *ses, void *data)
{
struct http_error_info *info = data;
struct http_error_info *info = (struct http_error_info *)data;
struct terminal *term = ses->tab->term;
struct cache_entry *cached = find_in_cache(info->uri);
struct cache_entry *cache = cached ? cached : get_cache_entry(info->uri);

View File

@ -309,7 +309,7 @@ subst_user_agent(char *fmt, char *version,
if (!list_empty(sessions)) {
char bs[4] = "";
int blen = 0;
struct session *ses = sessions.prev;
struct session *ses = (struct session *)sessions.prev;
int bars = ses->status.show_status_bar
+ ses->status.show_tabs_bar
+ ses->status.show_title_bar;
@ -492,7 +492,7 @@ http_end_request(struct connection *conn, struct connection_state state,
/* shutdown_connection_stream() should not change conn->info,
* but in case it does, read conn->info only after the call. */
http = conn->info;
http = (struct http_connection_info *)conn->info;
if (http)
done_http_post(&http->post);
@ -540,7 +540,7 @@ proxy_protocol_handler(struct connection *conn)
static void
done_http_connection(struct connection *conn)
{
struct http_connection_info *http = conn->info;
struct http_connection_info *http = (struct http_connection_info *)conn->info;
done_http_post(&http->post);
mem_free(http);
@ -631,8 +631,8 @@ accept_encoding_header(struct string *header)
static void
send_more_post_data(struct socket *socket)
{
struct connection *conn = socket->conn;
struct http_connection_info *http = conn->info;
struct connection *conn = (struct connection *)socket->conn;
struct http_connection_info *http = (struct http_connection_info *)conn->info;
char buffer[POST_BUFFER_SIZE];
int got;
struct connection_state error;
@ -663,7 +663,7 @@ send_more_post_data(struct socket *socket)
static void
http_send_header(struct socket *socket)
{
struct connection *conn = socket->conn;
struct connection *conn = (struct connection *)socket->conn;
struct http_connection_info *http;
int trace = get_opt_bool("protocol.http.trace", NULL);
struct string header;
@ -1117,7 +1117,7 @@ read_more_http_data(struct connection *conn, struct read_buffer *rb,
static void
read_http_data_done(struct connection *conn)
{
struct http_connection_info *http = conn->info;
struct http_connection_info *http = (struct http_connection_info *)conn->info;
/* There's no content but an error so just print
* that instead of nothing. */
@ -1145,7 +1145,7 @@ read_http_data_done(struct connection *conn)
static int
read_chunked_http_data(struct connection *conn, struct read_buffer *rb)
{
struct http_connection_info *http = conn->info;
struct http_connection_info *http = (struct http_connection_info *)conn->info;
int total_data_len = 0;
while (1) {
@ -1266,7 +1266,7 @@ read_chunked_http_data(struct connection *conn, struct read_buffer *rb)
static int
read_normal_http_data(struct connection *conn, struct read_buffer *rb)
{
struct http_connection_info *http = conn->info;
struct http_connection_info *http = (struct http_connection_info *)conn->info;
int data_len;
int len = rb->length;
@ -1315,8 +1315,8 @@ finish:
static void
read_http_data(struct socket *socket, struct read_buffer *rb)
{
struct connection *conn = socket->conn;
struct http_connection_info *http = conn->info;
struct connection *conn = (struct connection *)socket->conn;
struct http_connection_info *http = (struct http_connection_info *)conn->info;
int ret;
if (socket->state == SOCKET_CLOSED) {
@ -1446,8 +1446,8 @@ check_http_authentication(struct connection *conn, struct uri *uri,
void
http_got_header(struct socket *socket, struct read_buffer *rb)
{
struct connection *conn = socket->conn;
struct http_connection_info *http = conn->info;
struct connection *conn = (struct connection *)socket->conn;
struct http_connection_info *http = (struct http_connection_info *)conn->info;
char *head;
#ifdef CONFIG_COOKIES
char *cookie, *ch;