|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
In-process dynamic-app request handler for the Pharos native runtime. More...
Go to the source code of this file.
Functions | |
Dynamic runtime entry points | |
| int | native_dynamic_runtime_handle_request (const AppRuntime *app, const HttpRequest *request, NativeConnection *connection) |
| Serves one dynamic-app request entirely in-process. | |
| const char * | native_dynamic_runtime_host_profile (void) |
| Returns the canonical host profile string that this module handles. | |
In-process dynamic-app request handler for the Pharos native runtime.
This module owns the primary entry point for serving dynamic-app requests directly inside the Pharos binary process. It replaces the earlier architecture where every dynamic-app request spawned a child process via spawn_app_request().
The handler is responsible for:
Definition in file native_dynamic_runtime.h.
| int native_dynamic_runtime_handle_request | ( | const AppRuntime * | app, |
| const HttpRequest * | request, | ||
| NativeConnection * | connection ) |
Serves one dynamic-app request entirely in-process.
This is the canonical entry point that replaces the former spawn_app_request() path for apps whose host_profile is "dynamic-app". The function reads the app's route fixture, resolves the appropriate handler, and writes the HTTP response directly to connection.
Static-only and non-dynamic host profiles continue to use their existing code paths; this function is called only for dynamic-app requests.
| app | Finalized app runtime metadata (artifact dir, state, etc.). |
| request | Parsed HTTP request record. |
| connection | Connection to write the response to. |
Definition at line 6494 of file native_dynamic_runtime.c.
References AppRuntime::app_id, AppRuntime::artifact_dir, HttpRequest::cookie, csrf_token_for_response(), extract_query(), handle_action_route(), handle_page_route(), is_business_availability_api_list_path_runtime(), is_business_availability_api_schema_path_runtime(), is_business_services_api_list_path_runtime(), is_business_services_api_schema_path_runtime(), NativeDynamicRouteMatch::kind, load_root_from_text_runtime(), MAX_QUERY_LEN, HttpRequest::method, native_connection_printf(), native_dynamic_dispatch_extract_param(), native_dynamic_dispatch_free_match(), native_dynamic_dispatch_match(), native_dynamic_dispatch_resolve_route_fixture(), native_dynamic_dispatch_response_file(), native_dynamic_media_is_static_path(), native_dynamic_media_serve_asset(), native_dynamic_relational_prepare_request_state(), native_dynamic_relational_request_sync_free(), native_dynamic_relational_sync_back_if_changed(), native_json_doc_free(), native_json_doc_load_file(), native_json_obj_get(), native_send_text_response(), path_exists(), read_file_text(), request_body_text_dup_runtime(), route_request_path_dup_runtime(), AppRuntime::state_path, streq(), HttpRequest::target, time_text_to_minutes_runtime(), valid_day_of_week_runtime(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), write_json_error(), write_proof_state_api_response(), yyjson_get_str(), yyjson_is_str(), yyjson_write(), and YYJSON_WRITE_NOFLAG.
Referenced by handle_app_or_runtime_request().
| const char * native_dynamic_runtime_host_profile | ( | void | ) |
Returns the canonical host profile string that this module handles.
Useful for callers that need to decide which request path to use without duplicating the profile name string.
Definition at line 6490 of file native_dynamic_runtime.c.
References DYNAMIC_HOST_PROFILE.