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

Builds the argv vector used to launch an app entrypoint for an incoming HTTP request. More...

#include "native_spawn_argv.h"
#include <stddef.h>

Go to the source code of this file.

Functions

static int push_argv_value (char *argv_list[], size_t argv_capacity, size_t *argc_io, char *value)
int build_native_app_request_argv (const AppRuntime *app, const char *request_method, const char *request_target, const char *request_cookie, const char *request_headers, const char *request_content_type, const char *request_body, int request_is_multipart, const char *temp_body_path, char *argv_list[], size_t argv_capacity, size_t *argc_out)
 Builds the argv vector used to execute one compiled app request.

Detailed Description

Builds the argv vector used to launch an app entrypoint for an incoming HTTP request.

Definition in file native_spawn_argv.c.

Function Documentation

◆ build_native_app_request_argv()

int build_native_app_request_argv ( const AppRuntime * app,
const char * request_method,
const char * request_target,
const char * request_cookie,
const char * request_headers,
const char * request_content_type,
const char * request_body,
int request_is_multipart,
const char * temp_body_path,
char * argv_list[],
size_t argv_capacity,
size_t * argc_out )

Builds the argv vector used to execute one compiled app request.

Parameters
appFinalized app runtime that will handle the request.
request_methodHTTP request method.
request_targetHTTP request target.
request_cookieCookie header value.
request_headersNormalized request headers.
request_content_typeRequest content type.
request_bodyRequest body text when passed inline.
request_is_multipartNon-zero when the request uses multipart form data.
temp_body_pathOptional temporary body file path for multipart requests.
argv_listDestination argv array to populate.
argv_capacityCapacity of argv_list in entries.
argc_outDestination for the populated argv length.
Returns
0 on success, or a non-zero status code when the argv cannot be constructed.

Definition at line 22 of file native_spawn_argv.c.

References AppRuntime::base_path, AppRuntime::build_dir, AppRuntime::compiled_entrypoint, AppRuntime::debug, AppRuntime::log_path, push_argv_value(), and AppRuntime::state_path.

Referenced by spawn_app_request().

◆ push_argv_value()

int push_argv_value ( char * argv_list[],
size_t argv_capacity,
size_t * argc_io,
char * value )
static

Definition at line 10 of file native_spawn_argv.c.

Referenced by build_native_app_request_argv().