Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
Loading...
Searching...
No Matches
native_static_serve.h File Reference

Declares native static artifact serving helpers. More...

Go to the source code of this file.

Functions

Native static serving helpers
int native_serve_static_file (NativeConnection *connection, const char *root, const char *path, const HttpRequest *request, const char *log_path)
 Serves one static artifact response from a root directory.

Detailed Description

Declares native static artifact serving helpers.

Definition in file native_static_serve.h.

Function Documentation

◆ native_serve_static_file()

int native_serve_static_file ( NativeConnection * connection,
const char * root,
const char * path,
const HttpRequest * request,
const char * log_path )

Serves one static artifact response from a root directory.

Parameters
connectionConnection receiving the response.
rootArtifact root directory.
pathRequest target path.
requestParsed request metadata.
log_pathLog path used for access and error logging.
Returns
Final HTTP status code, or a negative value on connection write failure.

Definition at line 24 of file native_static_serve.c.

References dup_range(), http_status_text_native(), HttpRequest::method, mime_type_for_path(), native_connection_printf(), native_connection_write(), native_dispatch_response_file_for_request(), native_send_text_response(), native_static_serve_strdup, native_write_access_log(), native_write_error_log(), path_exists(), path_is_directory(), path_join(), and starts_with().

Referenced by handle_app_or_runtime_request(), and serve_static_root().