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

Implements native HTTP response writing helpers. More...

#include "native_http_response.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

int native_connection_printf (NativeConnection *connection, const char *format,...)
 Writes formatted bytes to a native connection.
void native_send_text_response (NativeConnection *connection, int status, const char *status_text, const char *body)
 Sends a plain-text HTTP response with explicit content length.

Detailed Description

Implements native HTTP response writing helpers.

Definition in file native_http_response.c.

Function Documentation

◆ native_connection_printf()

int native_connection_printf ( NativeConnection * connection,
const char * format,
... )

Writes formatted bytes to a native connection.

Parameters
connectionConnection to write to.
formatprintf-style format string.
...Format arguments.
Returns
Result of the underlying connection write, or -1 on formatting or allocation failure.

Definition at line 13 of file native_http_response.c.

References len, and native_connection_write().

Referenced by handle_action_route(), handle_page_route(), native_dynamic_media_serve_asset(), native_dynamic_runtime_handle_request(), native_send_text_response(), native_serve_static_file(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), write_html_response_with_headers_runtime(), write_json_error(), and write_proof_state_api_response().

◆ native_send_text_response()