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

Declares temporary request-body file helpers. More...

#include <stddef.h>

Go to the source code of this file.

Functions

Temporary request-body helpers
int write_native_temp_body_file (const char *body, size_t body_len, char **temp_body_path_out)
 Writes a request body to a temporary file for multipart request execution.
void cleanup_native_temp_body_file (char **temp_body_path_io)
 Removes a temporary request-body file and clears its stored path.

Detailed Description

Declares temporary request-body file helpers.

Definition in file native_spawn_temp_body.h.

Function Documentation

◆ cleanup_native_temp_body_file()

void cleanup_native_temp_body_file ( char ** temp_body_path_io)

Removes a temporary request-body file and clears its stored path.

Parameters
temp_body_path_ioIn-out pointer to the owned temp file path string.

Definition at line 61 of file native_spawn_temp_body.c.

References pharos_spawn_temp_body_unlink.

Referenced by free_http_request_native(), and spawn_app_request().

◆ write_native_temp_body_file()

int write_native_temp_body_file ( const char * body,
size_t body_len,
char ** temp_body_path_out )

Writes a request body to a temporary file for multipart request execution.

Parameters
bodyRequest body bytes to persist.
body_lenNumber of bytes in body.
temp_body_path_outDestination for the allocated temp file path.
Returns
0 on success, or a non-zero status code on failure.

Definition at line 35 of file native_spawn_temp_body.c.

References pharos_spawn_temp_body_close, pharos_spawn_temp_body_strdup, pharos_spawn_temp_body_unlink, and pharos_spawn_temp_body_write.

Referenced by spawn_app_request().