php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
fastcgi.c File Reference
#include "php.h"
#include "php_network.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <signal.h>
#include "fastcgi.h"

Go to the source code of this file.

Data Structures

struct  _fcgi_header
 
struct  _fcgi_begin_request
 
struct  _fcgi_begin_request_rec
 
struct  _fcgi_end_request
 
struct  _fcgi_end_request_rec
 
struct  _fcgi_hash_bucket
 
struct  _fcgi_hash_buckets
 
struct  _fcgi_data_seg
 
struct  _fcgi_hash
 
struct  _fcgi_req_hook
 
struct  _fcgi_request
 
union  _sa_t
 

Macros

#define INADDR_NONE   ((unsigned long) -1)
 
#define FCGI_LOCK(fd)
 
#define FCGI_UNLOCK(fd)
 

Typedefs

typedef unsigned int socklen_t
 
typedef struct _fcgi_header fcgi_header
 
typedef struct _fcgi_begin_request fcgi_begin_request
 
typedef struct _fcgi_begin_request_rec fcgi_begin_request_rec
 
typedef struct _fcgi_end_request fcgi_end_request
 
typedef struct _fcgi_end_request_rec fcgi_end_request_rec
 
typedef struct _fcgi_hash_bucket fcgi_hash_bucket
 
typedef struct _fcgi_hash_buckets fcgi_hash_buckets
 
typedef struct _fcgi_data_seg fcgi_data_seg
 
typedef struct _fcgi_hash fcgi_hash
 
typedef struct _fcgi_req_hook fcgi_req_hook
 
typedef union _sa_t sa_t
 

Functions

void fcgi_set_in_shutdown (int new_value)
 
int fcgi_in_shutdown (void)
 
void fcgi_terminate (void)
 
void fcgi_request_set_keep (fcgi_request *req, int new_value)
 
void fcgi_set_logger (fcgi_logger lg)
 
int fcgi_init (void)
 
int fcgi_is_fastcgi (void)
 
void fcgi_shutdown (void)
 
int fcgi_listen (const char *path, int backlog)
 
void fcgi_set_allowed_clients (char *ip)
 
fcgi_requestfcgi_init_request (int listen_socket, void(*on_accept)(void), void(*on_read)(void), void(*on_close)(void))
 
void fcgi_destroy_request (fcgi_request *req)
 
int fcgi_read (fcgi_request *req, char *str, int len)
 
void fcgi_close (fcgi_request *req, int force, int destroy)
 
int fcgi_is_closed (fcgi_request *req)
 
int fcgi_accept_request (fcgi_request *req)
 
int fcgi_flush (fcgi_request *req, int end)
 
int fcgi_write (fcgi_request *req, fcgi_request_type type, const char *str, int len)
 
int fcgi_end (fcgi_request *req)
 
int fcgi_finish_request (fcgi_request *req, int force_close)
 
int fcgi_has_env (fcgi_request *req)
 
char * fcgi_getenv (fcgi_request *req, const char *var, int var_len)
 
char * fcgi_quick_getenv (fcgi_request *req, const char *var, int var_len, unsigned int hash_value)
 
char * fcgi_putenv (fcgi_request *req, char *var, int var_len, char *val)
 
char * fcgi_quick_putenv (fcgi_request *req, char *var, int var_len, unsigned int hash_value, char *val)
 
void fcgi_loadenv (fcgi_request *req, fcgi_apply_func func, zval *array)
 
void fcgi_set_mgmt_var (const char *name, size_t name_len, const char *value, size_t value_len)
 
void fcgi_free_mgmt_var_cb (zval *zv)
 
const char * fcgi_get_last_client_ip (void)
 

Macro Definition Documentation

◆ FCGI_LOCK

#define FCGI_LOCK ( fd)

Definition at line 123 of file fastcgi.c.

◆ FCGI_UNLOCK

#define FCGI_UNLOCK ( fd)

Definition at line 124 of file fastcgi.c.

◆ INADDR_NONE

#define INADDR_NONE   ((unsigned long) -1)

Definition at line 83 of file fastcgi.c.

Typedef Documentation

◆ fcgi_begin_request

◆ fcgi_begin_request_rec

◆ fcgi_data_seg

typedef struct _fcgi_data_seg fcgi_data_seg

◆ fcgi_end_request

◆ fcgi_end_request_rec

◆ fcgi_hash

typedef struct _fcgi_hash fcgi_hash

◆ fcgi_hash_bucket

◆ fcgi_hash_buckets

◆ fcgi_header

typedef struct _fcgi_header fcgi_header

◆ fcgi_req_hook

typedef struct _fcgi_req_hook fcgi_req_hook

Definition at line 198 of file fastcgi.c.

◆ sa_t

typedef union _sa_t sa_t

◆ socklen_t

typedef unsigned int socklen_t

Definition at line 87 of file fastcgi.c.

Function Documentation

◆ fcgi_accept_request()

int fcgi_accept_request ( fcgi_request * req)

Definition at line 1351 of file fastcgi.c.

◆ fcgi_close()

void fcgi_close ( fcgi_request * req,
int force,
int destroy )

Definition at line 1257 of file fastcgi.c.

◆ fcgi_destroy_request()

void fcgi_destroy_request ( fcgi_request * req)

Definition at line 905 of file fastcgi.c.

◆ fcgi_end()

int fcgi_end ( fcgi_request * req)

Definition at line 1648 of file fastcgi.c.

◆ fcgi_finish_request()

int fcgi_finish_request ( fcgi_request * req,
int force_close )

Definition at line 1657 of file fastcgi.c.

◆ fcgi_flush()

int fcgi_flush ( fcgi_request * req,
int end )

Definition at line 1510 of file fastcgi.c.

◆ fcgi_free_mgmt_var_cb()

void fcgi_free_mgmt_var_cb ( zval * zv)

Definition at line 1738 of file fastcgi.c.

◆ fcgi_get_last_client_ip()

const char * fcgi_get_last_client_ip ( void )

Definition at line 1743 of file fastcgi.c.

◆ fcgi_getenv()

char * fcgi_getenv ( fcgi_request * req,
const char * var,
int var_len )

Definition at line 1673 of file fastcgi.c.

◆ fcgi_has_env()

int fcgi_has_env ( fcgi_request * req)

Definition at line 1668 of file fastcgi.c.

◆ fcgi_in_shutdown()

int fcgi_in_shutdown ( void )

Definition at line 451 of file fastcgi.c.

◆ fcgi_init()

int fcgi_init ( void )

Definition at line 480 of file fastcgi.c.

◆ fcgi_init_request()

fcgi_request * fcgi_init_request ( int listen_socket,
void(* on_accept )(void),
void(* on_read )(void),
void(* on_close )(void) )

Definition at line 870 of file fastcgi.c.

◆ fcgi_is_closed()

int fcgi_is_closed ( fcgi_request * req)

Definition at line 1308 of file fastcgi.c.

◆ fcgi_is_fastcgi()

int fcgi_is_fastcgi ( void )

Definition at line 541 of file fastcgi.c.

◆ fcgi_listen()

int fcgi_listen ( const char * path,
int backlog )

Definition at line 642 of file fastcgi.c.

◆ fcgi_loadenv()

void fcgi_loadenv ( fcgi_request * req,
fcgi_apply_func func,
zval * array )

Definition at line 1710 of file fastcgi.c.

◆ fcgi_putenv()

char * fcgi_putenv ( fcgi_request * req,
char * var,
int var_len,
char * val )

Definition at line 1689 of file fastcgi.c.

◆ fcgi_quick_getenv()

char * fcgi_quick_getenv ( fcgi_request * req,
const char * var,
int var_len,
unsigned int hash_value )

Definition at line 1682 of file fastcgi.c.

◆ fcgi_quick_putenv()

char * fcgi_quick_putenv ( fcgi_request * req,
char * var,
int var_len,
unsigned int hash_value,
char * val )

Definition at line 1700 of file fastcgi.c.

◆ fcgi_read()

int fcgi_read ( fcgi_request * req,
char * str,
int len )

Definition at line 1204 of file fastcgi.c.

◆ fcgi_request_set_keep()

void fcgi_request_set_keep ( fcgi_request * req,
int new_value )

Definition at line 461 of file fastcgi.c.

◆ fcgi_set_allowed_clients()

void fcgi_set_allowed_clients ( char * ip)

Definition at line 821 of file fastcgi.c.

◆ fcgi_set_in_shutdown()

void fcgi_set_in_shutdown ( int new_value)

Definition at line 446 of file fastcgi.c.

◆ fcgi_set_logger()

void fcgi_set_logger ( fcgi_logger lg)

Definition at line 467 of file fastcgi.c.

◆ fcgi_set_mgmt_var()

void fcgi_set_mgmt_var ( const char * name,
size_t name_len,
const char * value,
size_t value_len )

Definition at line 1727 of file fastcgi.c.

◆ fcgi_shutdown()

void fcgi_shutdown ( void )

Definition at line 550 of file fastcgi.c.

◆ fcgi_terminate()

void fcgi_terminate ( void )

Definition at line 456 of file fastcgi.c.

◆ fcgi_write()

int fcgi_write ( fcgi_request * req,
fcgi_request_type type,
const char * str,
int len )

Definition at line 1540 of file fastcgi.c.