mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[http] cast
This commit is contained in:
parent
5fbead7f51
commit
b0565cce64
@ -86,7 +86,7 @@ static char *
|
|||||||
parse_data_protocol_header(struct connection *conn, int *base64)
|
parse_data_protocol_header(struct connection *conn, int *base64)
|
||||||
{
|
{
|
||||||
struct uri *uri = conn->uri;
|
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;
|
char *type = DEFAULT_DATA_MEDIATYPE;
|
||||||
int typelen = sizeof(DEFAULT_DATA_MEDIATYPE) - 1;
|
int typelen = sizeof(DEFAULT_DATA_MEDIATYPE) - 1;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ struct module cgi_protocol_module = struct_module(
|
|||||||
static void
|
static void
|
||||||
close_pipe_and_read(struct socket *data_socket)
|
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);
|
struct read_buffer *rb = alloc_read_buffer(conn->socket);
|
||||||
|
|
||||||
if (!rb) return;
|
if (!rb) return;
|
||||||
@ -93,8 +93,8 @@ close_pipe_and_read(struct socket *data_socket)
|
|||||||
static void
|
static void
|
||||||
send_more_post_data(struct socket *socket)
|
send_more_post_data(struct socket *socket)
|
||||||
{
|
{
|
||||||
struct connection *conn = socket->conn;
|
struct connection *conn = (struct connection *)socket->conn;
|
||||||
struct http_connection_info *http = conn->info;
|
struct http_connection_info *http = (struct http_connection_info *)conn->info;
|
||||||
char buffer[POST_BUFFER_SIZE];
|
char buffer[POST_BUFFER_SIZE];
|
||||||
int got;
|
int got;
|
||||||
struct connection_state error;
|
struct connection_state error;
|
||||||
@ -115,7 +115,7 @@ send_more_post_data(struct socket *socket)
|
|||||||
static void
|
static void
|
||||||
send_post_data(struct connection *conn)
|
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 *post = conn->uri->post;
|
||||||
char *postend;
|
char *postend;
|
||||||
struct connection_state error;
|
struct connection_state error;
|
||||||
@ -168,7 +168,7 @@ set_vars(struct connection *conn, char *script)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
http = conn->info;
|
http = (struct http_connection_info *)conn->info;
|
||||||
|
|
||||||
if (!open_http_post(&http->post, post, &error)) {
|
if (!open_http_post(&http->post, post, &error)) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -214,7 +214,7 @@ static void
|
|||||||
check_if_closed(struct socket *socket, struct read_buffer *rb)
|
check_if_closed(struct socket *socket, struct read_buffer *rb)
|
||||||
{
|
{
|
||||||
if (socket->state == SOCKET_CLOSED) {
|
if (socket->state == SOCKET_CLOSED) {
|
||||||
abort_connection(socket->conn, connection_state(S_OK));
|
abort_connection((struct connection *)socket->conn, connection_state(S_OK));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
http_got_header(socket, rb);
|
http_got_header(socket, rb);
|
||||||
|
@ -86,7 +86,7 @@ static const char *
|
|||||||
http_code_to_string(int code)
|
http_code_to_string(int code)
|
||||||
{
|
{
|
||||||
const struct http_code *element
|
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_array(http_code),
|
||||||
sizeof(*element),
|
sizeof(*element),
|
||||||
compare_http_codes);
|
compare_http_codes);
|
||||||
@ -160,7 +160,7 @@ struct http_error_info {
|
|||||||
static void
|
static void
|
||||||
show_http_error_document(struct session *ses, void *data)
|
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 terminal *term = ses->tab->term;
|
||||||
struct cache_entry *cached = find_in_cache(info->uri);
|
struct cache_entry *cached = find_in_cache(info->uri);
|
||||||
struct cache_entry *cache = cached ? cached : get_cache_entry(info->uri);
|
struct cache_entry *cache = cached ? cached : get_cache_entry(info->uri);
|
||||||
|
@ -309,7 +309,7 @@ subst_user_agent(char *fmt, char *version,
|
|||||||
if (!list_empty(sessions)) {
|
if (!list_empty(sessions)) {
|
||||||
char bs[4] = "";
|
char bs[4] = "";
|
||||||
int blen = 0;
|
int blen = 0;
|
||||||
struct session *ses = sessions.prev;
|
struct session *ses = (struct session *)sessions.prev;
|
||||||
int bars = ses->status.show_status_bar
|
int bars = ses->status.show_status_bar
|
||||||
+ ses->status.show_tabs_bar
|
+ ses->status.show_tabs_bar
|
||||||
+ ses->status.show_title_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,
|
/* shutdown_connection_stream() should not change conn->info,
|
||||||
* but in case it does, read conn->info only after the call. */
|
* but in case it does, read conn->info only after the call. */
|
||||||
http = conn->info;
|
http = (struct http_connection_info *)conn->info;
|
||||||
if (http)
|
if (http)
|
||||||
done_http_post(&http->post);
|
done_http_post(&http->post);
|
||||||
|
|
||||||
@ -540,7 +540,7 @@ proxy_protocol_handler(struct connection *conn)
|
|||||||
static void
|
static void
|
||||||
done_http_connection(struct connection *conn)
|
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);
|
done_http_post(&http->post);
|
||||||
mem_free(http);
|
mem_free(http);
|
||||||
@ -631,8 +631,8 @@ accept_encoding_header(struct string *header)
|
|||||||
static void
|
static void
|
||||||
send_more_post_data(struct socket *socket)
|
send_more_post_data(struct socket *socket)
|
||||||
{
|
{
|
||||||
struct connection *conn = socket->conn;
|
struct connection *conn = (struct connection *)socket->conn;
|
||||||
struct http_connection_info *http = conn->info;
|
struct http_connection_info *http = (struct http_connection_info *)conn->info;
|
||||||
char buffer[POST_BUFFER_SIZE];
|
char buffer[POST_BUFFER_SIZE];
|
||||||
int got;
|
int got;
|
||||||
struct connection_state error;
|
struct connection_state error;
|
||||||
@ -663,7 +663,7 @@ send_more_post_data(struct socket *socket)
|
|||||||
static void
|
static void
|
||||||
http_send_header(struct socket *socket)
|
http_send_header(struct socket *socket)
|
||||||
{
|
{
|
||||||
struct connection *conn = socket->conn;
|
struct connection *conn = (struct connection *)socket->conn;
|
||||||
struct http_connection_info *http;
|
struct http_connection_info *http;
|
||||||
int trace = get_opt_bool("protocol.http.trace", NULL);
|
int trace = get_opt_bool("protocol.http.trace", NULL);
|
||||||
struct string header;
|
struct string header;
|
||||||
@ -1117,7 +1117,7 @@ read_more_http_data(struct connection *conn, struct read_buffer *rb,
|
|||||||
static void
|
static void
|
||||||
read_http_data_done(struct connection *conn)
|
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
|
/* There's no content but an error so just print
|
||||||
* that instead of nothing. */
|
* that instead of nothing. */
|
||||||
@ -1145,7 +1145,7 @@ read_http_data_done(struct connection *conn)
|
|||||||
static int
|
static int
|
||||||
read_chunked_http_data(struct connection *conn, struct read_buffer *rb)
|
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;
|
int total_data_len = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -1266,7 +1266,7 @@ read_chunked_http_data(struct connection *conn, struct read_buffer *rb)
|
|||||||
static int
|
static int
|
||||||
read_normal_http_data(struct connection *conn, struct read_buffer *rb)
|
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 data_len;
|
||||||
int len = rb->length;
|
int len = rb->length;
|
||||||
|
|
||||||
@ -1315,8 +1315,8 @@ finish:
|
|||||||
static void
|
static void
|
||||||
read_http_data(struct socket *socket, struct read_buffer *rb)
|
read_http_data(struct socket *socket, struct read_buffer *rb)
|
||||||
{
|
{
|
||||||
struct connection *conn = socket->conn;
|
struct connection *conn = (struct connection *)socket->conn;
|
||||||
struct http_connection_info *http = conn->info;
|
struct http_connection_info *http = (struct http_connection_info *)conn->info;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (socket->state == SOCKET_CLOSED) {
|
if (socket->state == SOCKET_CLOSED) {
|
||||||
@ -1446,8 +1446,8 @@ check_http_authentication(struct connection *conn, struct uri *uri,
|
|||||||
void
|
void
|
||||||
http_got_header(struct socket *socket, struct read_buffer *rb)
|
http_got_header(struct socket *socket, struct read_buffer *rb)
|
||||||
{
|
{
|
||||||
struct connection *conn = socket->conn;
|
struct connection *conn = (struct connection *)socket->conn;
|
||||||
struct http_connection_info *http = conn->info;
|
struct http_connection_info *http = (struct http_connection_info *)conn->info;
|
||||||
char *head;
|
char *head;
|
||||||
#ifdef CONFIG_COOKIES
|
#ifdef CONFIG_COOKIES
|
||||||
char *cookie, *ch;
|
char *cookie, *ch;
|
||||||
|
Loading…
Reference in New Issue
Block a user