24 const char *request_method,
25 const char *request_target,
26 const char *request_cookie,
27 const char *request_headers,
28 const char *request_content_type,
29 const char *request_body,
30 int request_is_multipart,
31 const char *temp_body_path,
37 if (argc_out != NULL) {
40 if (app == NULL || argv_list == NULL || argc_out == NULL || argv_capacity == 0) {
50 (
push_argv_value(argv_list, argv_capacity, &argc,
"--build-dir") != 0 ||
53 (
push_argv_value(argv_list, argv_capacity, &argc,
"--state-path") != 0 ||
56 (
push_argv_value(argv_list, argv_capacity, &argc,
"--base-path") != 0 ||
61 (app->
debug != NULL && app->
debug[0] !=
'\0' &&
65 push_argv_value(argv_list, argv_capacity, &argc, (
char *)request_method) != 0 ||
66 push_argv_value(argv_list, argv_capacity, &argc, (
char *)request_target) != 0 ||
68 push_argv_value(argv_list, argv_capacity, &argc, (
char *)(request_cookie != NULL ? request_cookie :
"")) != 0 ||
70 push_argv_value(argv_list, argv_capacity, &argc, (
char *)(request_headers != NULL ? request_headers :
"")) != 0 ||
71 push_argv_value(argv_list, argv_capacity, &argc,
"--content-type") != 0 ||
72 push_argv_value(argv_list, argv_capacity, &argc, (
char *)(request_content_type != NULL ? request_content_type :
"application/x-www-form-urlencoded")) != 0) {
75 if (temp_body_path != NULL && temp_body_path[0] !=
'\0') {
76 if (
push_argv_value(argv_list, argv_capacity, &argc,
"--body-file") != 0 ||
77 push_argv_value(argv_list, argv_capacity, &argc, (
char *)temp_body_path) != 0) {
82 (void)request_is_multipart;
83 if (argc >= argv_capacity) {
86 argv_list[argc] = NULL;
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.