php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
http_fopen_wrapper.c File Reference
#include "php.h"
#include "php_globals.h"
#include "php_streams.h"
#include "php_network.h"
#include "php_ini.h"
#include "ext/standard/basic_functions.h"
#include "zend_smart_str.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/param.h>
#include "php_standard.h"
#include <netinet/in.h>
#include <netdb.h>
#include "php_fopen_wrappers.h"

Go to the source code of this file.

Data Structures

struct  _php_stream_http_response_header_info
 

Macros

#define HTTP_HEADER_BLOCK_SIZE   1024
 
#define HTTP_HEADER_MAX_LOCATION_SIZE   8182 /* 8192 - 10 (size of "Location: ") */
 
#define PHP_URL_REDIRECT_MAX   20
 
#define HTTP_HEADER_USER_AGENT   1
 
#define HTTP_HEADER_HOST   2
 
#define HTTP_HEADER_AUTH   4
 
#define HTTP_HEADER_FROM   8
 
#define HTTP_HEADER_CONTENT_LENGTH   16
 
#define HTTP_HEADER_TYPE   32
 
#define HTTP_HEADER_CONNECTION   64
 
#define HTTP_WRAPPER_HEADER_INIT   1
 
#define HTTP_WRAPPER_REDIRECTED   2
 
#define HTTP_WRAPPER_KEEP_METHOD   4
 
#define _UA_HEADER   "User-Agent: %s\r\n"
 
#define CHECK_FOR_CNTRL_CHARS(val)
 

Typedefs

typedef struct _php_stream_http_response_header_info php_stream_http_response_header_info
 

Functions

php_streamphp_stream_url_wrap_http (php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC)
 

Variables

PHPAPI const php_stream_wrapper php_stream_http_wrapper
 

Macro Definition Documentation

◆ _UA_HEADER

#define _UA_HEADER   "User-Agent: %s\r\n"

◆ CHECK_FOR_CNTRL_CHARS

#define CHECK_FOR_CNTRL_CHARS ( val)
Value:
{ \
if (val) { \
unsigned char *s, *e; \
s = (unsigned char*)ZSTR_VAL(val); e = s + ZSTR_LEN(val); \
while (s < e) { \
if (iscntrl(*s)) { \
php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path); \
efree(new_path); \
goto out; \
} \
s++; \
} \
} \
}
char s[4]
Definition cdf.c:77
zval * val
Definition ffi.c:4262
PHPAPI size_t php_url_decode(char *str, size_t len)
Definition url.c:582
PHP_JSON_API size_t int options
Definition php_json.h:102
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
#define ZSTR_LEN(zstr)
Definition zend_string.h:69
out($f, $s)

◆ HTTP_HEADER_AUTH

#define HTTP_HEADER_AUTH   4

Definition at line 75 of file http_fopen_wrapper.c.

◆ HTTP_HEADER_BLOCK_SIZE

#define HTTP_HEADER_BLOCK_SIZE   1024

Definition at line 70 of file http_fopen_wrapper.c.

◆ HTTP_HEADER_CONNECTION

#define HTTP_HEADER_CONNECTION   64

Definition at line 79 of file http_fopen_wrapper.c.

◆ HTTP_HEADER_CONTENT_LENGTH

#define HTTP_HEADER_CONTENT_LENGTH   16

Definition at line 77 of file http_fopen_wrapper.c.

◆ HTTP_HEADER_FROM

#define HTTP_HEADER_FROM   8

Definition at line 76 of file http_fopen_wrapper.c.

◆ HTTP_HEADER_HOST

#define HTTP_HEADER_HOST   2

Definition at line 74 of file http_fopen_wrapper.c.

◆ HTTP_HEADER_MAX_LOCATION_SIZE

#define HTTP_HEADER_MAX_LOCATION_SIZE   8182 /* 8192 - 10 (size of "Location: ") */

Definition at line 71 of file http_fopen_wrapper.c.

◆ HTTP_HEADER_TYPE

#define HTTP_HEADER_TYPE   32

Definition at line 78 of file http_fopen_wrapper.c.

◆ HTTP_HEADER_USER_AGENT

#define HTTP_HEADER_USER_AGENT   1

Definition at line 73 of file http_fopen_wrapper.c.

◆ HTTP_WRAPPER_HEADER_INIT

#define HTTP_WRAPPER_HEADER_INIT   1

Definition at line 81 of file http_fopen_wrapper.c.

◆ HTTP_WRAPPER_KEEP_METHOD

#define HTTP_WRAPPER_KEEP_METHOD   4

Definition at line 83 of file http_fopen_wrapper.c.

◆ HTTP_WRAPPER_REDIRECTED

#define HTTP_WRAPPER_REDIRECTED   2

Definition at line 82 of file http_fopen_wrapper.c.

◆ PHP_URL_REDIRECT_MAX

#define PHP_URL_REDIRECT_MAX   20

Definition at line 72 of file http_fopen_wrapper.c.

Typedef Documentation

◆ php_stream_http_response_header_info

Function Documentation

◆ php_stream_url_wrap_http()

php_stream * php_stream_url_wrap_http ( php_stream_wrapper * wrapper,
const char * path,
const char * mode,
int options,
zend_string ** opened_path,
php_stream_context *context STREAMS_DC )

Definition at line 1187 of file http_fopen_wrapper.c.

Variable Documentation

◆ php_stream_http_wrapper

PHPAPI const php_stream_wrapper php_stream_http_wrapper
Initial value:
= {
&http_stream_wops,
1
}
#define NULL
Definition gdcache.h:45

Definition at line 1237 of file http_fopen_wrapper.c.