diff --git a/include/libhttp.h b/include/libhttp.h index 5a330f1b..2681a507 100644 --- a/include/libhttp.h +++ b/include/libhttp.h @@ -152,7 +152,7 @@ struct lh_con_t; /* Handle for the individual connection */ /************************************************************************************************/ /* */ /* This structure contains information about the HTTP request. */ -struct httplib_request_info { /* */ +struct lh_rqi_t { /* */ const char * request_method; /* "GET", "POST", etc */ const char * request_uri; /* URL-decoded URI (absolute or relative, as in the request) */ const char * local_uri; /* URL-decoded URI (relative). Can be NULL if request_uri is not a resource at the server host */ @@ -176,7 +176,7 @@ struct httplib_request_info { /* */ /************************************************************************************************/ -/* Client certificate information (part of httplib_request_info) */ +/* Client certificate information (part of lh_rqi_t) */ struct client_cert { const char *subject; const char *issuer; @@ -300,7 +300,7 @@ LIBHTTP_API int httplib_modify_passwords_file(const char *passwords_file_name, c /* Return information associated with the request. */ -LIBHTTP_API const struct httplib_request_info *httplib_get_request_info( const struct lh_con_t *conn ); +LIBHTTP_API const struct lh_rqi_t *httplib_get_request_info( const struct lh_con_t *conn ); /* Send data to the client. diff --git a/src/httplib_get_header.c b/src/httplib_get_header.c index 2bdc60fe..72cfcb3b 100644 --- a/src/httplib_get_header.c +++ b/src/httplib_get_header.c @@ -28,7 +28,7 @@ #include "httplib_main.h" /* Return HTTP header value, or NULL if not found. */ -const char *XX_httplib_get_header( const struct httplib_request_info *ri, const char *name ) { +const char *XX_httplib_get_header( const struct lh_rqi_t *ri, const char *name ) { int i; diff --git a/src/httplib_get_request_handler.c b/src/httplib_get_request_handler.c index 6ef48c36..c55d0872 100644 --- a/src/httplib_get_request_handler.c +++ b/src/httplib_get_request_handler.c @@ -37,7 +37,7 @@ int XX_httplib_get_request_handler( struct lh_ctx_t *ctx, struct lh_con_t *conn, int handler_type, httplib_request_handler *handler, httplib_websocket_connect_handler *connect_handler, httplib_websocket_ready_handler *ready_handler, httplib_websocket_data_handler *data_handler, httplib_websocket_close_handler *close_handler, httplib_authorization_handler *auth_handler, void **cbdata ) { - const struct httplib_request_info *request_info; + const struct lh_rqi_t *request_info; const char *uri; size_t urilen; struct httplib_handler_info *tmp_rh; diff --git a/src/httplib_get_request_info.c b/src/httplib_get_request_info.c index f0ab8c84..d042c0d9 100644 --- a/src/httplib_get_request_info.c +++ b/src/httplib_get_request_info.c @@ -27,7 +27,7 @@ #include "httplib_main.h" -const struct httplib_request_info *httplib_get_request_info( const struct lh_con_t *conn ) { +const struct lh_rqi_t *httplib_get_request_info( const struct lh_con_t *conn ) { if ( conn == NULL ) return NULL; diff --git a/src/httplib_handle_cgi_request.c b/src/httplib_handle_cgi_request.c index f9a11532..0fd9afe4 100644 --- a/src/httplib_handle_cgi_request.c +++ b/src/httplib_handle_cgi_request.c @@ -56,7 +56,7 @@ void XX_httplib_handle_cgi_request( const struct lh_ctx_t *ctx, struct lh_con_t char error_string[ERROR_STRING_LEN]; char *ptr; const char *cptr; - struct httplib_request_info ri; + struct lh_rqi_t ri; struct cgi_environment blk; FILE *in; FILE *out; diff --git a/src/httplib_handle_form_request.c b/src/httplib_handle_form_request.c index cb317915..7a222a18 100644 --- a/src/httplib_handle_form_request.c +++ b/src/httplib_handle_form_request.c @@ -524,7 +524,7 @@ int httplib_handle_form_request( const struct lh_ctx_t *ctx, struct lh_con_t *co const char *boundary; size_t bl; ptrdiff_t used; - struct httplib_request_info part_header; + struct lh_rqi_t part_header; char *hbuf; char *hend; char *fbeg; diff --git a/src/httplib_handle_request.c b/src/httplib_handle_request.c index e19f8bb7..57a62c9a 100644 --- a/src/httplib_handle_request.c +++ b/src/httplib_handle_request.c @@ -40,7 +40,7 @@ void XX_httplib_handle_request( struct lh_ctx_t *ctx, struct lh_con_t *conn ) { - struct httplib_request_info *ri; + struct lh_rqi_t *ri; char path[PATH_MAX]; int uri_len; int ssl_index; diff --git a/src/httplib_log_access.c b/src/httplib_log_access.c index 47a84901..401c488f 100644 --- a/src/httplib_log_access.c +++ b/src/httplib_log_access.c @@ -39,7 +39,7 @@ static const char *header_val( const struct lh_con_t *conn, const char *header ) void XX_httplib_log_access( const struct lh_ctx_t *ctx, const struct lh_con_t *conn ) { - const struct httplib_request_info *ri; + const struct lh_rqi_t *ri; struct file fi; char date[64]; char src_addr[IP_ADDR_STR_LEN]; diff --git a/src/httplib_main.h b/src/httplib_main.h index 06056063..8ea00d8c 100644 --- a/src/httplib_main.h +++ b/src/httplib_main.h @@ -616,7 +616,7 @@ struct lh_ctx_t { /****************************************************************************************/ struct lh_con_t { /* */ - struct httplib_request_info request_info; /* The request info of the connection */ + struct lh_rqi_t request_info; /* The request info of the connection */ SSL * ssl; /* SSL descriptor */ SSL_CTX * client_ssl_ctx; /* SSL context for client connections */ struct socket client; /* Connected client */ @@ -811,7 +811,7 @@ bool XX_httplib_fopen( const struct lh_ctx_t *ctx, const struct lh_con_t *conn bool XX_httplib_forward_body_data( const struct lh_ctx_t *ctx, struct lh_con_t *conn, FILE *fp, SOCKET sock, SSL *ssl ); void XX_httplib_free_config_options( struct lh_ctx_t *ctx ); void XX_httplib_free_context( struct lh_ctx_t *ctx ); -const char * XX_httplib_get_header( const struct httplib_request_info *ri, const char *name ); +const char * XX_httplib_get_header( const struct lh_rqi_t *ri, const char *name ); void XX_httplib_get_mime_type( const struct lh_ctx_t *ctx, const char *path, struct vec *vec ); const char * XX_httplib_get_rel_url_at_current_server( const struct lh_ctx_t *ctx, const char *uri, const struct lh_con_t *conn ); uint32_t XX_httplib_get_remote_ip( const struct lh_con_t *conn ); @@ -852,8 +852,8 @@ bool XX_httplib_option_value_to_bool( const char *value, bool *config ); bool XX_httplib_option_value_to_int( const char *value, int *config ); int XX_httplib_parse_auth_header( const struct lh_ctx_t *ctx, struct lh_con_t *conn, char *buf, size_t buf_size, struct ah *ah ); time_t XX_httplib_parse_date_string( const char *datetime ); -int XX_httplib_parse_http_headers( char **buf, struct httplib_request_info *ri ); -int XX_httplib_parse_http_message( char *buf, int len, struct httplib_request_info *ri ); +int XX_httplib_parse_http_headers( char **buf, struct lh_rqi_t *ri ); +int XX_httplib_parse_http_message( char *buf, int len, struct lh_rqi_t *ri ); int XX_httplib_parse_net( const char *spec, uint32_t *net, uint32_t *mask ); int XX_httplib_parse_range_header( const char *header, int64_t *a, int64_t *b ); void XX_httplib_path_to_unicode( const char *path, wchar_t *wbuf, size_t wbuf_len ); diff --git a/src/httplib_parse_http_headers.c b/src/httplib_parse_http_headers.c index 68cfccb2..12704426 100644 --- a/src/httplib_parse_http_headers.c +++ b/src/httplib_parse_http_headers.c @@ -28,7 +28,7 @@ #include "httplib_main.h" /* - * int XX_httplib_parse_http_headers( char **buf, struct httplib_request_info *ri ); + * int XX_httplib_parse_http_headers( char **buf, struct lh_rqi_t *ri ); * * The function XX_httplib_parse_http_headers() parses the HTTP headers from * the given buffer. The buf pointer is advanced to the point where parsing @@ -36,7 +36,7 @@ * headers read is returned, or a negative value if an error occured. */ -int XX_httplib_parse_http_headers( char **buf, struct httplib_request_info *ri ) { +int XX_httplib_parse_http_headers( char **buf, struct lh_rqi_t *ri ) { int i; diff --git a/src/httplib_parse_http_message.c b/src/httplib_parse_http_message.c index aacebd2e..ce60cfab 100644 --- a/src/httplib_parse_http_message.c +++ b/src/httplib_parse_http_message.c @@ -28,21 +28,21 @@ #include "httplib_main.h" /* - * int XX_httplib_parse_http_message( char *buf, int len, struct httplib_request_info *ri ); + * int XX_httplib_parse_http_message( char *buf, int len, struct lh_rqi_t *ri ); * * The function XX_httplib_parse_http_message() parses an HTTP request and - * fills in the httplib_request_info structure. This function modifies the buffer by + * fills in the lh_rqi_t structure. This function modifies the buffer by * NUL terminating HTTP request components, header names and header values. * Parameters: * buf (in/out) pointer to the HTTP header to parse and split * len (in) length of the HTTP header buffer - * ri (out) parsed header as a httplib_request_info structure + * ri (out) parsed header as a lh_rqi_t structure * The parameters buf and ri must be valid pointers (not NULL) with a length * larger than zero. On error the function return a negative value, otherwise * the length of the request is returned. */ -int XX_httplib_parse_http_message( char *buf, int len, struct httplib_request_info *ri ) { +int XX_httplib_parse_http_message( char *buf, int len, struct lh_rqi_t *ri ) { int is_request; int request_length; diff --git a/src/httplib_process_new_connection.c b/src/httplib_process_new_connection.c index 7ca6cfec..b7dae948 100644 --- a/src/httplib_process_new_connection.c +++ b/src/httplib_process_new_connection.c @@ -37,7 +37,7 @@ void XX_httplib_process_new_connection( struct lh_ctx_t *ctx, struct lh_con_t *conn ) { - struct httplib_request_info *ri; + struct lh_rqi_t *ri; int keep_alive; int discard_len; bool was_error;