|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Declares HTTP logging and response formatting helpers. More...
Go to the source code of this file.
Functions | |
HTTP logging helpers | |
| char * | mime_type_for_path (const char *path) |
| Resolves the MIME type that should be used for a file path. | |
| char * | compact_log_text_native (const char *value) |
| Compacts free-form text into a single-line log-safe representation. | |
| char * | request_real_ip_native (const char *headers) |
| Extracts the best client IP address from request headers. | |
| char * | request_headers_with_client_ip_native (const char *headers, const char *client_ip) |
| Returns request headers with an explicit client IP header applied. | |
| const char * | http_status_text_native (int status_code) |
| Returns the canonical reason phrase for one HTTP status code. | |
| char * | http_status_line_from_response_native (const char *response) |
| Extracts the HTTP status line from a raw HTTP response payload. | |
| int | http_status_code_from_response_native (const char *response) |
| Extracts the numeric HTTP status code from a raw HTTP response payload. | |
Declares HTTP logging and response formatting helpers.
Definition in file native_http_log.h.
| char * compact_log_text_native | ( | const char * | value | ) |
Compacts free-form text into a single-line log-safe representation.
| value | Source text to compact. |
Definition at line 40 of file native_http_log.c.
References buffer_append(), buffer_free(), buffer_init(), Buffer::data, Buffer::len, and pharos_http_log_strdup.
Referenced by native_write_access_log(), and native_write_error_log().
| int http_status_code_from_response_native | ( | const char * | response | ) |
Extracts the numeric HTTP status code from a raw HTTP response payload.
| response | Raw HTTP response text. |
Definition at line 242 of file native_http_log.c.
Referenced by handle_app_or_runtime_request().
| char * http_status_line_from_response_native | ( | const char * | response | ) |
Extracts the HTTP status line from a raw HTTP response payload.
| response | Raw HTTP response text. |
Definition at line 221 of file native_http_log.c.
References dup_range(), and pharos_http_log_strdup.
Referenced by handle_app_or_runtime_request().
| const char * http_status_text_native | ( | int | status_code | ) |
Returns the canonical reason phrase for one HTTP status code.
| status_code | HTTP status code to translate. |
Definition at line 209 of file native_http_log.c.
Referenced by native_serve_static_file(), and native_write_access_log().
| char * mime_type_for_path | ( | const char * | path | ) |
Resolves the MIME type that should be used for a file path.
| path | File path whose extension should be inspected. |
Definition at line 25 of file native_http_log.c.
References pharos_http_log_strdup.
Referenced by native_dynamic_media_serve_asset(), and native_serve_static_file().
| char * request_headers_with_client_ip_native | ( | const char * | headers, |
| const char * | client_ip ) |
Returns request headers with an explicit client IP header applied.
| headers | Original normalized request headers. |
| client_ip | Client IP value to ensure is represented. |
Definition at line 147 of file native_http_log.c.
References buffer_append(), buffer_free(), buffer_init(), Buffer::data, pharos_http_log_strcasecmp, pharos_http_log_strdup, and trim_in_place().
Referenced by native_write_access_log(), and native_write_error_log().
| char * request_real_ip_native | ( | const char * | headers | ) |
Extracts the best client IP address from request headers.
| headers | Normalized request headers. |
Definition at line 75 of file native_http_log.c.
References pharos_http_log_strcasecmp, pharos_http_log_strdup, and trim_in_place().
Referenced by native_write_access_log(), native_write_error_log(), and write_error_report_native().