mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-14 00:40:55 +08:00
732 lines
25 KiB
C
732 lines
25 KiB
C
|
#ifndef __LIB_HTTP_INCLUDE_H__
|
|||
|
#define __LIB_HTTP_INCLUDE_H__
|
|||
|
|
|||
|
#include "lib_http_status.h"
|
|||
|
#include "lib_http_struct.h"
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
extern "C" {
|
|||
|
#endif
|
|||
|
|
|||
|
/*---------------------------- ͨ<><CDA8> HTTP ͷ<><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> --------------------------*/
|
|||
|
/* in http_hdr.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>HTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD>Ľṹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param size {size_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>С, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> HTTP_HDR_REQ <EFBFBD><EFBFBD> HTTP_HDR_RES <EFBFBD>ijߴ<EFBFBD>
|
|||
|
* @return {HTTP_HDR*} !NULL: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>HTTP_HDR<EFBFBD>ṹָ<EFBFBD><EFBFBD>; NULL: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR *http_hdr_new(size_t size);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ԴHTTPͨ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>HTTPͨ<EFBFBD><EFBFBD>ͷ<EFBFBD>ṹ<EFBFBD><EFBFBD>
|
|||
|
* @param src {const HTTP_HDR*} ԴHTTPͨ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param dst {HTTP_HDR*} Ŀ<EFBFBD><EFBFBD>HTTPͨ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_clone(const HTTP_HDR *src, HTTP_HDR *dst);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>ͷ<EFBFBD>һ<EFBFBD><EFBFBD>HTTP_HDR<EFBFBD>ṹ<EFBFBD>ڴ<EFBFBD>
|
|||
|
* @param hh {HTTP_HDR*} <EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_free(HTTP_HDR *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>HTTPͨ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>keep-alive<EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hh {HTTP_HDR*} HTTPͨ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_reset(HTTP_HDR *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD> HTTP_HDR ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ
|
|||
|
* @param hh {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param entry {HTTP_HDR_ENTRY*} HTTPͷ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ṹָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_append_entry(HTTP_HDR *hh, HTTP_HDR_ENTRY *entry);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>/<EFBFBD>ΰ汾<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD>ṹ<EFBFBD><EFBFBD>
|
|||
|
* @param hh {HTTP_HDR*} <EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param data {const char*} <EFBFBD><EFBFBD><EFBFBD>ݸ<EFBFBD>ʽ<EFBFBD><EFBFBD>Ϊ: HTTP/1.0
|
|||
|
* @return {int} 0: OK; < 0: error.
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_parse_version(HTTP_HDR *hh, const char *data);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ͨ<EFBFBD><EFBFBD>HTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD> hh <EFBFBD>ṹ<EFBFBD><EFBFBD>
|
|||
|
* @param hh {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {int} 0: ok; < 0: error
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_parse(HTTP_HDR *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>ɴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> name, value <EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> HTTP_HDR_ENTRY <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param value {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|||
|
* @return {HTTP_HDR_ENTRY*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_ENTRY *http_hdr_entry_build(const char *name, const char *value);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD>з<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> HTTP_HDR_ENTRY
|
|||
|
* @param data {const char*} HTTP Э<EFBFBD><EFBFBD>ͷ<EFBFBD>е<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>: Content-Length: 200
|
|||
|
* @return {HTTP_HDR_ENTRY*} !NULL: ok; NULL: err.
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_ENTRY *http_hdr_entry_new(const char *data);
|
|||
|
HTTP_API HTTP_HDR_ENTRY *http_hdr_entry_head(char *data);
|
|||
|
HTTP_API HTTP_HDR_ENTRY *http_hdr_entry_new2(char *data);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ȡһ<EFBFBD><EFBFBD> HTTP_HDR_ENTRY <EFBFBD><EFBFBD>Ŀ
|
|||
|
* @param hh {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD> HTTP_HDR_ENTRY <EFBFBD><EFBFBD>Ŀ<EFBFBD>ı<EFBFBD>ʶ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>. <EFBFBD><EFBFBD>: Content-Length.
|
|||
|
* @return ret {HTTP_HDR_ENTRY *} ret != NULL: ok; ret == NULL: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_ENTRY *http_hdr_entry(const HTTP_HDR *hh, const char *name);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ȡHTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>ͷ<EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD>ͷΪ<EFBFBD><EFBFBD>Host: www.test.com
|
|||
|
* Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Host <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>øú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD> www.test.com
|
|||
|
* @param hh {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD> HTTP_HDR_ENTRY <EFBFBD><EFBFBD>Ŀ<EFBFBD>ı<EFBFBD>ʶ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>. <EFBFBD><EFBFBD>: Content-Length
|
|||
|
* @return ret {char*} ret != NULL: ok; ret == NULL: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
*/
|
|||
|
HTTP_API char *http_hdr_entry_value(const HTTP_HDR *hh, const char *name);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD> HTTP ͷ<EFBFBD>е<EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ֶν<EFBFBD><EFBFBD><EFBFBD><EFBFBD>滻, <EFBFBD>ù<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD> keep-alive <EFBFBD>ֶε<EFBFBD><EFBFBD>滻
|
|||
|
* @param hh {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD> HTTP_HDR_ENTRY <EFBFBD><EFBFBD>Ŀ<EFBFBD>ı<EFBFBD>ʶ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>. <EFBFBD><EFBFBD>: Content-Length
|
|||
|
* @param value {const char*} <EFBFBD><EFBFBD> name <EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>ֵ
|
|||
|
* @param force {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>滻<EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD>ԭʼHTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ﲻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>ǿ<EFBFBD>в<EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD> entry <EFBFBD>ֶβ<EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵΪ<EFBFBD><EFBFBD>0ֵʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>name<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ﲻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>滻<EFBFBD>ɹ<EFBFBD>; < 0 <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> name <EFBFBD>ֶ<EFBFBD><EFBFBD>ڸ<EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ﲻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_entry_replace(HTTP_HDR *hh, const char *name, const char *value, int force);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD> HTTP ͷ<EFBFBD>е<EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD>а<EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>滻, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD>滻
|
|||
|
* @param hh {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD> HTTP_HDR_ENTRY <EFBFBD><EFBFBD>Ŀ<EFBFBD>ı<EFBFBD>ʶ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>. <EFBFBD><EFBFBD>: Cookie
|
|||
|
* @param from {const char*} <EFBFBD>滻ʱ<EFBFBD><EFBFBD>Դ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param to {const char*} <EFBFBD>滻ʱ<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param ignore_case {int} <EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>滻ʱ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>Сд
|
|||
|
* @return {int} 0: <EFBFBD><EFBFBD>ʾδ<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD>滻, > 0: <EFBFBD><EFBFBD>ʾ<EFBFBD>滻<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_entry_replace2(HTTP_HDR *hh, const char *name,
|
|||
|
const char *from, const char *to, int ignore_case);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ֹHTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD>е<EFBFBD>ij<EFBFBD><EFBFBD>
|
|||
|
* @param hh {HTTP_HDR* } ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD> HTTP_HDR_ENTRY <EFBFBD><EFBFBD>Ŀ<EFBFBD>ı<EFBFBD>ʶ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>. <EFBFBD><EFBFBD>: Content-Length
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_entry_off(HTTP_HDR *hh, const char *name);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
|
|||
|
* @param hh {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param msg {const char*} <EFBFBD>û<EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_print(const HTTP_HDR *hh, const char *msg);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
|
|||
|
* @param fp {ACL_VSTREAM*} ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᶨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>)
|
|||
|
* @param hh {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param msg {const char*} <EFBFBD>û<EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_fprint(ACL_VSTREAM *fp, const HTTP_HDR *hh, const char *msg);
|
|||
|
|
|||
|
/*-------------------------------- HTTP <20><><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -----------------------*/
|
|||
|
/* in http_hdr_req.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @return {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_REQ *http_hdr_req_new(void);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD>汾<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param url {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD>磺
|
|||
|
* http://www.test.com/path/proc?name=value
|
|||
|
* http://www.test.com/path/proc
|
|||
|
* http://www.test.com/
|
|||
|
* @param method {const char*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮һ<EFBFBD><EFBFBD>
|
|||
|
* GET, POST, CONNECT, HEAD, <EFBFBD><EFBFBD>Ҫע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>붼Ϊ<EFBFBD><EFBFBD>д
|
|||
|
* @param version {const char *} HTTP<EFBFBD>汾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮һ<EFBFBD><EFBFBD>
|
|||
|
* HTTP/1.0, HTTP/1.1
|
|||
|
* @return {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_REQ *http_hdr_req_create(const char *url,
|
|||
|
const char *method, const char *version);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>¡һ<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> chat_ctx, chat_free_ctx_fn
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hdr_req {const HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @return {HTTP_HDR_REQ*} <EFBFBD><EFBFBD>¡<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_REQ *http_hdr_req_clone(const HTTP_HDR_REQ* hdr_req);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ
|
|||
|
* @param hh {const HTTP_HDR_REQ*} <EFBFBD>ϴε<EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param url {const char *} <EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> http[s]:// ǰ<C7B0><D7BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD> Host <EFBFBD>ֶν<EFBFBD><EFBFBD>ɸ<EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD>ԴHTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD> Host <EFBFBD>ֶ<EFBFBD>
|
|||
|
* @return {HTTP_HDR_REQ*} <EFBFBD>²<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_REQ *http_hdr_req_rewrite(const HTTP_HDR_REQ *hh, const char *url);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ø<EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
* @param hh {const HTTP_HDR_REQ*} <EFBFBD>ϴε<EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param url {const char *} <EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> http[s]:// ǰ<C7B0><D7BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD> Host <EFBFBD>ֶν<EFBFBD><EFBFBD>ɸ<EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD>ԴHTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD> Host <EFBFBD>ֶ<EFBFBD>
|
|||
|
* @return {int} 0: ok; < 0: error
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_req_rewrite2(HTTP_HDR_REQ *hh, const char *url);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>ͷ<EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_req_free(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷŲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>³<EFBFBD>ʼ<EFBFBD><EFBFBD>
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_req_reset(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>cookies
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {int} 0: ok; -1: err.
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_req_cookies_parse(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD>: GET /cgi-bin/test.cgi?name=value&name2=value2 HTTP/1.0)
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD>(GET)-->hdr_request_method
|
|||
|
* URL<EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(name=value)-->hdr_request_table
|
|||
|
* HTTPЭ<EFBFBD><EFBFBD><EFBFBD>汾<EFBFBD><EFBFBD>(HTTP/1.0)-->hdr_request_proto
|
|||
|
* URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(/cgi-bin/test.cgi)-->hdr_request_url
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {int} 0: ok; -1: err.
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_req_line_parse(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷЭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> http_hdr_req_line_parse, http_hdr_req_cookies_parse
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {int} 0: ok; -1: err.
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_req_parse(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷЭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> http_hdr_req_line_parse, http_hdr_req_cookies_parse
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> parse_params <EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD> url <EFBFBD>еIJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> parse_cookie <EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> cookie <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param parse_params {int} <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> url <EFBFBD>еIJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param parse_cookie {int} <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> cookie <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @return {int} 0: ok; -1: err.
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_req_parse3(HTTP_HDR_REQ *hh, int parse_params, int parse_cookie);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>л<EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>cookieֵ
|
|||
|
* @param hh {HTTP_HDR_REQ*) HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} ij<EFBFBD><EFBFBD>cookie<EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {const char*} !NULL: <EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>cookie; NULL: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>cookie<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API const char *http_hdr_req_cookie_get(HTTP_HDR_REQ *hh, const char *name);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>: POST, GET, CONNECT
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>. NULL: error; !NULL: OK.
|
|||
|
*/
|
|||
|
HTTP_API const char *http_hdr_req_method(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>л<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶε<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
|||
|
* <EFBFBD><EFBFBD>ȡ: /cgi-bin/test.cgi?n1=v1&n2=v2 <EFBFBD>е<EFBFBD> n2<EFBFBD><EFBFBD>ֵv2
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @return {const char*} !NULL: ok, <EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ָ<EFBFBD><EFBFBD>; NULL: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
*/
|
|||
|
HTTP_API const char *http_hdr_req_param(HTTP_HDR_REQ *hh, const char *name);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>л<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еķ<EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
* <EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:
|
|||
|
* GET /cgi-bin/test.cgi?n1=v1&n2=v2 HTTP/1.1
|
|||
|
* or
|
|||
|
* GET http://www.test.com[:80]/cgi-bin/test.cgi?n1=v1&n2=v2 HTTP/1.1
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:
|
|||
|
* /cgi-bin/test.cgi?n1=v1&n2=v2
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {const char*} <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>URL. !NULL: OK; NULL: error.
|
|||
|
*/
|
|||
|
HTTP_API const char *http_hdr_req_url_part(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>л<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еķ<EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
* <EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:
|
|||
|
* GET /cgi-bin/test.cgi?n1=v1&n2=v2 HTTP/1.1
|
|||
|
* or
|
|||
|
* GET http://www.test.com[:80]/cgi-bin/test.cgi?n1=v1&n2=v2 HTTP/1.1
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:
|
|||
|
* /cgi-bin/test.cgi
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {const char*} <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>URL. !NULL: OK; NULL: error.
|
|||
|
*/
|
|||
|
HTTP_API const char *http_hdr_req_url_path(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>ͷ<EFBFBD>л<EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽΪ<EFBFBD><EFBFBD>IP|domain[:PORT]
|
|||
|
* <EFBFBD><EFBFBD>: 192.168.0.22:80, or www.test.com:8088
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. !NULL: ok; NULL: error.
|
|||
|
*/
|
|||
|
HTTP_API const char *http_hdr_req_host(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷЭ<EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD>ԭHTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷΪ:
|
|||
|
* GET /cgi-bin/test.cgi?n1=v1&n2=v2 HTTP/1.1
|
|||
|
* HOST: www.test.com
|
|||
|
* <EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
|||
|
* http://www.test.com/cgi-bin/test.cgi?n1=v1&n2=v2
|
|||
|
* @param hh {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @return {const char*} <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>URL. !NULL: OK; NULL: error.
|
|||
|
* @example:
|
|||
|
* void test(HTTP_HDR_REQ *hh)
|
|||
|
* {
|
|||
|
* const char *url = http_hdr_req_url(hh);
|
|||
|
* printf(">>> url: %s\r\n", url ? url : "null");
|
|||
|
* }
|
|||
|
* ע<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>Ϊ http_hdr_req_url <EFBFBD>ڲ<EFBFBD>ʹ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ֲ߳̾<EFBFBD><EFBFBD><EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>.
|
|||
|
* void test(HTTP_HDR_REQ *hh1, HTTP_HDR_REQ *hh2)
|
|||
|
* {
|
|||
|
* const char *url1 = http_hdr_req_url(hh1);
|
|||
|
* const char *url2 = http_hdr_req_url(hh2);
|
|||
|
* printf(">>> url1: %s, url2: %s\n", url1, url2);
|
|||
|
* }
|
|||
|
* <EFBFBD><EFBFBD>Ϊ url1, url2 ʵ<EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬһ<EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յĽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> url1, url2
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ. <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD><EFBFBD>:
|
|||
|
* void test(HTTP_HDR_REQ *hh1, HTTP_HDR_REQ *hh2)
|
|||
|
* {
|
|||
|
* const char *ptr;
|
|||
|
* static char dummy[1];
|
|||
|
* char *url1 = dummy, *url2 = dummy;
|
|||
|
* ptr = http_hdr_req_url(hh1);
|
|||
|
* if (ptr)
|
|||
|
* url1 = acl_mystrdup(ptr);
|
|||
|
* ptr = http_hdr_req_url(hh2);
|
|||
|
* if (ptr)
|
|||
|
* url2 = acl_mystrdup(ptr);
|
|||
|
* printf(">>> url1: %s, url2: %s\n", url1, url2);
|
|||
|
* if (url1 != dummy)
|
|||
|
* acl_myfree(url1);
|
|||
|
* if (url2 != dummy)
|
|||
|
* acl_myfree(url2);
|
|||
|
* }
|
|||
|
*/
|
|||
|
HTTP_API const char *http_hdr_req_url(HTTP_HDR_REQ *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>е<EFBFBD> Range <EFBFBD>ֶ<EFBFBD>
|
|||
|
* @param hdr_req {HTTP_HDR_REQ*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPЭ<EFBFBD><EFBFBD>ͷ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param range_from {http_off_t*} <EFBFBD>洢ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼλ<EFBFBD><EFBFBD>
|
|||
|
* @param range_to {http_off_t*} <EFBFBD>洢ƫ<EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>
|
|||
|
* ע<EFBFBD><EFBFBD> * {range_from}, {range_to} <EFBFBD>±<EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD>ʼ
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Range <EFBFBD><EFBFBD>ʽ:
|
|||
|
* Range: bytes={range_from}-, bytes={range_from}-{range_to}
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_req_range(HTTP_HDR_REQ *hdr_req, http_off_t *range_from,
|
|||
|
http_off_t *range_to);
|
|||
|
|
|||
|
/*---------------------------- HTTP <20><>Ӧͷ<D3A6><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---------------------------*/
|
|||
|
/* in http_hdr_res.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD>е<EFBFBD>״̬<EFBFBD><EFBFBD>
|
|||
|
*@param hh {HTTP_HDR_RES*} HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
*@param dbuf {const char*} ״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>: HTTP/1.0 200 OK<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
*@return {int} 0: ok; < 0: error<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD> hh <EFBFBD>ṹ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_res_status_parse(HTTP_HDR_RES *hh, const char *dbuf);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
* @return {HTTP_HDR_RES*}
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_RES *http_hdr_res_new(void);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>¡һ<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
* @param hdr_res {const HTTP_HDR_RES*} ԴHTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
* @return {HTTP_HDR_RES *} <EFBFBD>²<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_RES *http_hdr_res_clone(const HTTP_HDR_RES *hdr_res);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>ͷ<EFBFBD>һ<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
* @param hh {HTTP_HDR_RES*} HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_res_free(HTTP_HDR_RES *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD><EFBFBD>³<EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>еij<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hh {HTTP_HDR_RES*} HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_res_reset(HTTP_HDR_RES *hh);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hdr_res {HTTP_HDR_RES*} HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_res_parse(HTTP_HDR_RES *hdr_res);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD>е<EFBFBD> Range <EFBFBD>ֶ<EFBFBD>
|
|||
|
* @param hdr_res {HTTP_HDR_RES*} <EFBFBD><EFBFBD>ӦHTTPЭ<EFBFBD><EFBFBD>ͷ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param range_from {http_off_t*} <EFBFBD>洢ƫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼλ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param range_to {http_off_t*} <EFBFBD>洢ƫ<EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param total_length {http_off_t*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* ע<EFBFBD><EFBFBD> * {range_from}, {range_to} <EFBFBD>±<EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD>ʼ
|
|||
|
* <EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD> Range <EFBFBD><EFBFBD>ʽ:
|
|||
|
* Content-Range: bytes {range_from}-{range_to}/{total_length}
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_res_range(HTTP_HDR_RES *hdr_res, http_off_t *range_from,
|
|||
|
http_off_t *range_to, http_off_t *total_length);
|
|||
|
|
|||
|
/* in http_rfc1123.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ֵת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>RFC1123<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD>ʽ
|
|||
|
* @param buf {char*} <EFBFBD>洢<EFBFBD>ռ<EFBFBD>
|
|||
|
* @param size {size_t} buf <EFBFBD>Ŀռ<EFBFBD><EFBFBD><EFBFBD>С
|
|||
|
* @param t {time_t} ʱ<EFBFBD><EFBFBD>ֵ
|
|||
|
*/
|
|||
|
HTTP_API const char *http_mkrfc1123(char *buf, size_t size, time_t t);
|
|||
|
|
|||
|
/*----------------------- HTTP <20>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> --------------------------------*/
|
|||
|
/* in http_chat_async.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>첽<EFBFBD><EFBFBD>ȡһ<EFBFBD><EFBFBD>HTTP REQUESTЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD>hdr<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ắ<EFBFBD><EFBFBD> notify
|
|||
|
* @param hdr {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>ͽṹָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param astream {ACL_ASTREAM*} <EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param notify {HTTP_HDR_NOTIFY} <EFBFBD><EFBFBD>HTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ắ<EFBFBD><EFBFBD>
|
|||
|
* @param arg {void*} notify <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<EFBFBD><EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_req_get_async(HTTP_HDR_REQ *hdr, ACL_ASTREAM *astream,
|
|||
|
HTTP_HDR_NOTIFY notify, void *arg, int timeout);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>첽<EFBFBD><EFBFBD>ȡһ<EFBFBD><EFBFBD>HTTP RESPONDЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD>hdr<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ắ<EFBFBD><EFBFBD> notify
|
|||
|
* @param hdr {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD><EFBFBD>ͽṹָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param astream {ACL_ASTREAM*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param notify {HTTP_HDR_NOTIFY} <EFBFBD><EFBFBD>HTTPЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ắ<EFBFBD><EFBFBD>
|
|||
|
* @param arg {void*} notify <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<EFBFBD><EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_res_get_async(HTTP_HDR_RES *hdr, ACL_ASTREAM *astream,
|
|||
|
HTTP_HDR_NOTIFY notify, void *arg, int timeout);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>첽<EFBFBD>ӿͻ<EFBFBD><EFBFBD>˶<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BODYЭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD>ڽ<EFBFBD><EFBFBD>չ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>б߽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD> notify
|
|||
|
* <EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> notify <EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD>ֵ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD>ټ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param request {HTTP_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> request->hdr Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param astream {ACL_ASTREAM*} <EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param notify {HTTP_BODY_NOTIFY} <EFBFBD><EFBFBD><EFBFBD>տͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>лص<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ắ<EFBFBD><EFBFBD>
|
|||
|
* @param arg {void*} notify <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<EFBFBD><EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_req_body_get_async(HTTP_REQ *request, ACL_ASTREAM *astream,
|
|||
|
HTTP_BODY_NOTIFY notify, void *arg, int timeout);
|
|||
|
/*
|
|||
|
* <EFBFBD>첽<EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>ȡ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>BODYЭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD>ڽ<EFBFBD><EFBFBD>չ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* notify <EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> notify <EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD>ֵ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD>ټ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param respond {HTTP_RES*} HTTP<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>,<EFBFBD><EFBFBD> respond->hdr <EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param astream {ACL_ASTREAM*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param notify {HTTP_BODY_NOTIFY} <EFBFBD><EFBFBD><EFBFBD>շ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>лص<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ắ<EFBFBD><EFBFBD>
|
|||
|
* @param arg {void*} notify <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<EFBFBD><EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_res_body_get_async(HTTP_RES *respond, ACL_ASTREAM *astream,
|
|||
|
HTTP_BODY_NOTIFY notify, void *arg, int timeout);
|
|||
|
|
|||
|
/*----------------------- HTTP ͬ<><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> --------------------------------*/
|
|||
|
/* in http_chat_sync.c */
|
|||
|
|
|||
|
/**
|
|||
|
* ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡһ<EFBFBD><EFBFBD>HTTP REQUESTЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD>hdr<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ắ<EFBFBD><EFBFBD> notify
|
|||
|
* @param hdr {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>ͽṹָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param stream {ACL_VSTREAM*} <EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<EFBFBD><EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>
|
|||
|
* @return {int} 0: <EFBFBD>ɹ<EFBFBD>; < 0: ʧ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_req_get_sync(HTTP_HDR_REQ *hdr,
|
|||
|
ACL_VSTREAM *stream, int timeout);
|
|||
|
|
|||
|
/**
|
|||
|
* ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡһ<EFBFBD><EFBFBD>HTTP RESPONDЭ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD>hdr<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ắ<EFBFBD><EFBFBD> notify
|
|||
|
* @param hdr {HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD><EFBFBD>ͽṹָ<EFBFBD>룬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param stream {ACL_VSTREAM*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<EFBFBD><EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>
|
|||
|
* @return {int} 0: <EFBFBD>ɹ<EFBFBD>; < 0: ʧ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_res_get_sync(HTTP_HDR_RES *hdr,
|
|||
|
ACL_VSTREAM *stream, int timeout);
|
|||
|
|
|||
|
/**
|
|||
|
* ͬ<EFBFBD><EFBFBD><EFBFBD>ӿͻ<EFBFBD><EFBFBD>˶<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BODYЭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param request {HTTP_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> request->hdr Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param stream {ACL_VSTREAM*} <EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param buf {void *} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿռ<EFBFBD>
|
|||
|
* @param size {int} buf <EFBFBD>Ŀռ<EFBFBD><EFBFBD><EFBFBD>С
|
|||
|
* @return ret {http_off_t} <EFBFBD><EFBFBD><EFBFBD>ζ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* 0: <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD>ر<EFBFBD>;
|
|||
|
* < 0: <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>رջ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
|||
|
* > 0: <EFBFBD><EFBFBD>ʾδ<EFBFBD><EFBFBD><EFBFBD>꣬Ŀǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ret <EFBFBD><EFBFBD><EFBFBD>ֽڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API http_off_t http_req_body_get_sync(HTTP_REQ *request, ACL_VSTREAM *stream,
|
|||
|
void *buf, int size);
|
|||
|
#define http_req_body_get_sync2 http_req_body_get_sync
|
|||
|
|
|||
|
/**
|
|||
|
* ͬ<EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>ȡ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD>BODYЭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param respond {HTTP_RES*} HTTP<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> respond->hdr Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param stream {ACL_VSTREAM*} <EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param buf {void *} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿռ<EFBFBD>
|
|||
|
* @param size {int} buf <EFBFBD>Ŀռ<EFBFBD><EFBFBD><EFBFBD>С
|
|||
|
* @return ret {http_off_t} <EFBFBD><EFBFBD><EFBFBD>ζ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* 0: <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD>ر<EFBFBD>;
|
|||
|
* < 0: <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>رջ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
|||
|
* > 0: <EFBFBD><EFBFBD>ʾδ<EFBFBD><EFBFBD><EFBFBD>꣬Ŀǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ret <EFBFBD><EFBFBD><EFBFBD>ֽڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API http_off_t http_res_body_get_sync(HTTP_RES *respond, ACL_VSTREAM *stream,
|
|||
|
void *buf, int size);
|
|||
|
#define http_res_body_get_sync2 http_res_body_get_sync
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD>Ʊ<EFBFBD>־λ
|
|||
|
* @param request {HTTP_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> request->hdr Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param name {int} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λΪ HTTP_CHAT_SYNC_CTL_END ʱ
|
|||
|
* <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_chat_sync_reqctl(HTTP_REQ *request, int name, ...);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӦЭ<EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD>Ʊ<EFBFBD>־λ
|
|||
|
* @param respond {HTTP_RES*} HTTP<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> respond->hdr Ϊ<EFBFBD><EFBFBD>
|
|||
|
* @param name {int} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λΪ HTTP_CHAT_SYNC_CTL_END ʱ
|
|||
|
* <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_chat_sync_resctl(HTTP_RES *respond, int name, ...);
|
|||
|
#define HTTP_CHAT_SYNC_CTL_END 0 /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λ */
|
|||
|
#define HTTP_CHAT_CTL_BUFF_ONOFF 1 /**< <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD>ʱ<EFBFBD><CAB1>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
|||
|
/*------------------------ HTTP <20><><EFBFBD><EFBFBD><EFBFBD>幹<EFBFBD>켰<EFBFBD>ͷź<CDB7><C5BA><EFBFBD> ------------------------*/
|
|||
|
/* in http_req.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hdr_req {HTTP_HDR_REQ*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @return {HTTP_REQ*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API HTTP_REQ *http_req_new(HTTP_HDR_REQ *hdr_req);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param request {HTTP_REQ*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_req_free(HTTP_REQ *request);
|
|||
|
|
|||
|
/*------------------------ HTTP <20><>Ӧ<EFBFBD>幹<EFBFBD>켰<EFBFBD>ͷź<CDB7><C5BA><EFBFBD> ------------------------*/
|
|||
|
/* in http_res.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hdr_res {HTTP_HDR_RES*} <EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @return {HTTP_RES*} <EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API HTTP_RES *http_res_new(HTTP_HDR_RES *hdr_res);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param respond {HTTP_RES*} <EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_res_free(HTTP_RES *respond);
|
|||
|
|
|||
|
/*------------------------------ HTTP ͷ<><CDB7><EFBFBD>캯<EFBFBD><ECBAAF> -----------------------------*/
|
|||
|
/* in http_hdr_build.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hdr {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Accept-Encoding: deflate, gzip <EFBFBD>е<EFBFBD> Accept-Encoding
|
|||
|
* @param value {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Accept-Encoding: deflate, gzip <EFBFBD>е<EFBFBD> deflate, gzip
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_put_str(HTTP_HDR *hdr, const char *name, const char *value);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hdr {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Content-Length: 1024 <EFBFBD>е<EFBFBD> Conteng-Length
|
|||
|
* @param value {const int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Content-Length: 1024 <EFBFBD>е<EFBFBD> 1024
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_put_int(HTTP_HDR *hdr, const char *name, int value);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hdr {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Accept-Encoding: deflate, gzip <EFBFBD>е<EFBFBD> Accept-Encoding
|
|||
|
* @param fmt {const char*} <EFBFBD><EFBFBD><EFBFBD>θ<EFBFBD>ʽ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
#ifdef WIN32
|
|||
|
HTTP_API void http_hdr_put_fmt(HTTP_HDR *hdr, const char *name, const char *fmt, ...);
|
|||
|
#else
|
|||
|
HTTP_API void __attribute__((format(printf,3,4)))
|
|||
|
http_hdr_put_fmt(HTTP_HDR *hdr, const char *name, const char *fmt, ...);
|
|||
|
#endif
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param hdr {HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param name {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param t {time_t} ʱ<EFBFBD><EFBFBD>ֵ
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_put_time(HTTP_HDR *hdr, const char *name, time_t t);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><EFBFBD>ֳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD>
|
|||
|
* @param req {const HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ
|
|||
|
* @param res {HTTP_HDR_RES*} HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API int http_hdr_set_keepalive(const HTTP_HDR_REQ *req, HTTP_HDR_RES *res);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD>״̬(1xx, 2xx, 3xx, 4xx, 5xx) <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
* @param hdr_res {HTTP_HDR_RES*} HTTP<EFBFBD><EFBFBD>Ӧͷ<EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param status {int} ״̬<EFBFBD>ţ<EFBFBD>nxx(1xx, 2xx, 3xx, 4xx, 5xx)
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_res_init(HTTP_HDR_RES *hdr_res, int status);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD>״̬(nxx)<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
* @param status {int} ״̬<EFBFBD>ţ<EFBFBD>nxx(1xx, 2xx, 3xx, 4xx, 5xx)
|
|||
|
* @return {HTTP_HDR_RES*} <EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_RES *http_hdr_res_static(int status);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD>״̬(nxx)<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
* @param status {int} ״̬<EFBFBD>ţ<EFBFBD>nxx(4xx, 5xx)
|
|||
|
* @return {HTTP_HDR_RES*} <EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧͷ
|
|||
|
*/
|
|||
|
HTTP_API HTTP_HDR_RES *http_hdr_res_error(int status);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTPͨ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BUF<EFBFBD><EFBFBD>
|
|||
|
* @param hdr {const HTTP_HDR*} ͨ<EFBFBD><EFBFBD>HTTPͷ
|
|||
|
* @param strbuf {ACL_VSTRING*} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_build(const HTTP_HDR *hdr, ACL_VSTRING *strbuf);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BUF<EFBFBD><EFBFBD>
|
|||
|
* @param hdr_req {const HTTP_HDR_REQ*} HTTP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ
|
|||
|
* @param strbuf {ACL_VSTRING*} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_build_request(const HTTP_HDR_REQ *hdr_req, ACL_VSTRING *strbuf);
|
|||
|
|
|||
|
/*----------------------------- HTTP <20><>Ӧ״̬<D7B4><CCAC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD> ------------------------*/
|
|||
|
/* in http_status.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD>(nxx)<EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @param status {int} ״̬<EFBFBD>ţ<EFBFBD>nxx(1xx, 2xx, 3xx, 4xx, 5xx)
|
|||
|
* @return {const char*} <EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
*/
|
|||
|
HTTP_API const char *http_status_line(int status);
|
|||
|
|
|||
|
/*---------------------------- HTTP HTML ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ------------------------*/
|
|||
|
/* in http_tmpl.c */
|
|||
|
|
|||
|
/**
|
|||
|
* װ<EFBFBD><EFBFBD>HTTP<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HTMLģ<EFBFBD><EFBFBD>
|
|||
|
* @param tmpl_path {const char*} HTMLģ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>·<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_tmpl_load(const char *tmpl_path);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ӦHTTP<EFBFBD><EFBFBD>Ӧ״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
* @param status {int} HTTP ״̬<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD>
|
|||
|
* @return {const ACL_VSTRING*} <EFBFBD><EFBFBD>ӦHTTP<EFBFBD><EFBFBD>Ӧ״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
*/
|
|||
|
HTTP_API const ACL_VSTRING *http_tmpl_get(int status);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ӦHTTP<EFBFBD><EFBFBD>Ӧ״̬<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>Ϣ
|
|||
|
* @param status {int} HTTP ״̬<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD>
|
|||
|
* @return {const char*} <EFBFBD><EFBFBD>ӦHTTP<EFBFBD><EFBFBD>Ӧ״̬<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>Ϣ
|
|||
|
*/
|
|||
|
HTTP_API const char *http_tmpl_title(int status);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӦHTTP<EFBFBD><EFBFBD>Ӧ״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>Ϣ<EFBFBD>ij<EFBFBD><EFBFBD>ȴ<EFBFBD>С
|
|||
|
* @param status {int} HTTP ״̬<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD>
|
|||
|
* @return {int} ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>Ϣ<EFBFBD>ij<EFBFBD><EFBFBD>ȴ<EFBFBD>С
|
|||
|
*/
|
|||
|
HTTP_API int http_tmpl_size(int status);
|
|||
|
|
|||
|
/*---------------------------- HTTP HTML ģ<><C4A3><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------*/
|
|||
|
/* in http_init.c */
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>HTTPӦ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
|||
|
* @param tmpl_path {const char*} ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ļ<EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_init(const char *tmpl_path);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD>Ƿ<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>屻<EFBFBD>ͷŵ<EFBFBD> HTTP ͷ<EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>ʹ<EFBFBD><EFBFBD>, <EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
|
|||
|
* ʱֻ<EFBFBD>ܱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>
|
|||
|
* @param max {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ > 0 ʱ<EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HTTP ͷ<EFBFBD><EFBFBD><EFBFBD>幦<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
HTTP_API void http_hdr_cache(int max);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD> HTTP Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|||
|
* @param size {http_off_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|||
|
*/
|
|||
|
HTTP_API void http_buf_size_set(http_off_t size);
|
|||
|
|
|||
|
/**
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD> HTTP Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|||
|
* @return {http_off_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|||
|
*/
|
|||
|
HTTP_API http_off_t http_buf_size_get(void);
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
#endif
|
|||
|
|