xrtHttp1ServerConfigInit

XRT_API void xrtHttp1ServerConfigInit( xhttp1serverconfig* pConfig );

;
返回:XRT_API void xrtHttp1ServerConfigInit( xhttp1serverconfig* pConfig );

示例已编译验证

http1serverconfiginit obj;
xrtHttp1ServerConfigInit(&obj);

xrtHttp1ServerExchangeCreate

创建不拥有 Socket、线程或 Timer 的串行 Server Exchange。

xhttp1serverexchange* xrtHttp1ServerExchangeCreate( const xhttp1serverconfig* pConfig, const xhttp1serverevents* pEvents );
参数说明
const xhttp1serverconfig* pConfig配置结构
const xhttp1serverevents* pEvents事件回调表
返回:创建不拥有 Socket、线程或 Timer 的串行 Server Exchange。

示例已编译验证

/* 创建不拥有 Socket、线程或 Timer 的串行 Server Exchange。 */
xhandle* h = xrtHttp1ServerExchangeCreate();

xrtHttp1ServerExchangeDestroy

销毁当前请求、临时解析存储和终态错误。

void xrtHttp1ServerExchangeDestroy( xhttp1serverexchange* pExchange );
参数说明
xhttp1serverexchange* pExchange交换对象
返回:销毁当前请求、临时解析存储和终态错误。

示例已编译验证

xrtHttp1ServerExchangeDestroy(pExchange);

xrtHttp1ServerExchangeFeed

XRT_API xhttp1serverfeedstatus xrtHttp1ServerExchangeFeed( xhttp1serverexchange* pExchange, xbytesview Input, bool bEnd, size_t* pAccepted );

;
返回:XRT_API xhttp1serverfeedstatus xrtHttp1ServerExchangeFeed( xhttp1serverexchange* pExchange, xbytesview Input, bool bEnd, size_t* pAccepted );

示例已编译验证

/* XRT_API xhttp1serverfeedstatus xrtHttp1ServerExchangeFeed( xhttp1serverexchange* pExchange, xbytesview Input, bool bEnd, size_t* pAccepted ); */
result = xrtHttp1ServerExchangeFeed();

xrtHttp1ServerExchangePause

XRT_API bool xrtHttp1ServerExchangePause( xhttp1serverexchange* pExchange );

;
返回:XRT_API bool xrtHttp1ServerExchangePause( xhttp1serverexchange* pExchange );

示例已编译验证

/* XRT_API bool xrtHttp1ServerExchangePause( xhttp1serverexchange* pExchange ); */
result = xrtHttp1ServerExchangePause();

xrtHttp1ServerExchangeResume

恢复正文消费;调用方随后以尚未接受的输入再次 Feed。

bool xrtHttp1ServerExchangeResume( xhttp1serverexchange* pExchange );
参数说明
xhttp1serverexchange* pExchange交换对象
返回:恢复正文消费;调用方随后以尚未接受的输入再次 Feed。

示例已编译验证

/* 恢复正文消费;调用方随后以尚未接受的输入再次 Feed。 */
result = xrtHttp1ServerExchangeResume(pExchange);

xrtHttp1ServerExchangeSetBodyLimit

XRT_API bool xrtHttp1ServerExchangeSetBodyLimit( xhttp1serverexchange* pExchange, uint64 iMaxBody );

;
返回:XRT_API bool xrtHttp1ServerExchangeSetBodyLimit( xhttp1serverexchange* pExchange, uint64 iMaxBody );

示例已编译验证

/* XRT_API bool xrtHttp1ServerExchangeSetBodyLimit( xhttp1serverexchange* pExchange, uint64 iMaxBody ); */
result = xrtHttp1ServerExchangeSetBodyLimit();

xrtHttp1ServerExchangeNext

XRT_API bool xrtHttp1ServerExchangeNext( xhttp1serverexchange* pExchange );

;
返回:XRT_API bool xrtHttp1ServerExchangeNext( xhttp1serverexchange* pExchange );

示例已编译验证

/* XRT_API bool xrtHttp1ServerExchangeNext( xhttp1serverexchange* pExchange ); */
result = xrtHttp1ServerExchangeNext();

xrtHttp1ServerExchangeRequest

返回当前拥有型请求的借用指针,尚未完成 Header 时为空。

const xhttpserverrequest* xrtHttp1ServerExchangeRequest( const xhttp1serverexchange* pExchange );
参数说明
const xhttp1serverexchange* pExchange交换对象
返回:返回当前拥有型请求的借用指针,尚未完成 Header 时为空。

示例已编译验证

/* 返回当前拥有型请求的借用指针,尚未完成 Header 时为空。 */
result = xrtHttp1ServerExchangeRequest(pExchange);

xrtHttp1ServerExchangeError

返回稳定终态错误;非失败状态返回空指针。

const xerror* xrtHttp1ServerExchangeError( const xhttp1serverexchange* pExchange );
参数说明
const xhttp1serverexchange* pExchange交换对象
返回:返回稳定终态错误;非失败状态返回空指针。

示例已编译验证

/* 返回稳定终态错误;非失败状态返回空指针。 */
result = xrtHttp1ServerExchangeError(pExchange);

xrtHttp1ServerExchangeComplete

判断当前请求是否已经完整交付 Header、正文和 Trailer。

bool xrtHttp1ServerExchangeComplete( const xhttp1serverexchange* pExchange );
参数说明
const xhttp1serverexchange* pExchange交换对象
返回:判断当前请求是否已经完整交付 Header、正文和 Trailer。

示例已编译验证

/* 判断当前请求是否已经完整交付 Header、正文和 Trailer。 */
result = xrtHttp1ServerExchangeComplete(pExchange);

xrtHttp1ServerExchangePaused

判断 Exchange 是否因正文消费者背压而暂停。

bool xrtHttp1ServerExchangePaused( const xhttp1serverexchange* pExchange );
参数说明
const xhttp1serverexchange* pExchange交换对象
返回:判断 Exchange 是否因正文消费者背压而暂停。

示例已编译验证

/* 判断 Exchange 是否因正文消费者背压而暂停。 */
result = xrtHttp1ServerExchangePaused(pExchange);

xrtHttp1ServerExchangeWireBytes

返回当前请求已经接受的 Header 与正文线缆字节总数。

uint64 xrtHttp1ServerExchangeWireBytes( const xhttp1serverexchange* pExchange );
参数说明
const xhttp1serverexchange* pExchange交换对象
返回:返回当前请求已经接受的 Header 与正文线缆字节总数。

示例已编译验证

/* 返回当前请求已经接受的 Header 与正文线缆字节总数。 */
result = xrtHttp1ServerExchangeWireBytes(pExchange);

xrtHttp1ServerResponseInform

XRT_API xhttp1serverresponse* xrtHttp1ServerResponseInform( xhttpversion Version, const xhttpreply* pReply );

;
返回:XRT_API xhttp1serverresponse* xrtHttp1ServerResponseInform( xhttpversion Version, const xhttpreply* pReply );

示例已编译验证

/* XRT_API xhttp1serverresponse* xrtHttp1ServerResponseInform( xhttpversion Version, const xhttpreply* pReply ); */
result = xrtHttp1ServerResponseInform();

xrtHttp1ServerResponsePrepare

XRT_API xhttp1serverresponse* xrtHttp1ServerResponsePrepare( xhttpversion Version, xstrview Method, uint32 iRequestFlags, const xhttpreply* pReply );

;
返回:XRT_API xhttp1serverresponse* xrtHttp1ServerResponsePrepare( xhttpversion Version, xstrview Method, uint32 iRequestFlags, const xhttpreply* pReply );

示例已编译验证

/* XRT_API xhttp1serverresponse* xrtHttp1ServerResponsePrepare( xhttpversion Version, xstrview Method, uint32 iRequestFlags, const xhttpreply* pReply ); */
result = xrtHttp1ServerResponsePrepare();

xrtHttp1ServerResponseCreate

XRT_API xhttp1serverresponse* xrtHttp1ServerResponseCreate( const xhttpserverrequest* pRequest, const xhttpreply* pReply );

;
返回:XRT_API xhttp1serverresponse* xrtHttp1ServerResponseCreate( const xhttpserverrequest* pRequest, const xhttpreply* pReply );

示例已编译验证

/* XRT_API xhttp1serverresponse* xrtHttp1ServerResponseCreate( const xhttpserverrequest* pRequest, const xhttpreply* pReply ); */
xhandle* h = xrtHttp1ServerResponseCreate();

xrtHttp1ServerResponseDestroy

销毁响应计划、正文 Reader、未消费 Chunk 和稳定错误。

void xrtHttp1ServerResponseDestroy( xhttp1serverresponse* pResponse );
参数说明
xhttp1serverresponse* pResponse响应对象
返回:销毁响应计划、正文 Reader、未消费 Chunk 和稳定错误。

示例已编译验证

xrtHttp1ServerResponseDestroy(pResponse);

xrtHttp1ServerResponseOutput

XRT_API xhttp1serveroutputstatus xrtHttp1ServerResponseOutput( xhttp1serverresponse* pResponse, size_t iMaxBytes, xbytesview* pData );

;
返回:XRT_API xhttp1serveroutputstatus xrtHttp1ServerResponseOutput( xhttp1serverresponse* pResponse, size_t iMaxBytes, xbytesview* pData );

示例已编译验证

/* XRT_API xhttp1serveroutputstatus xrtHttp1ServerResponseOutput( xhttp1serverresponse* pResponse, size_t iMaxBytes, xbytesview* pData ); */
result = xrtHttp1ServerResponseOutput();

xrtHttp1ServerResponseOutputConsume

消费最近一次 Output 借出片段的前缀,允许网络短写和零长度消费。

bool xrtHttp1ServerResponseOutputConsume( xhttp1serverresponse* pResponse, size_t iSize );
参数说明
xhttp1serverresponse* pResponse响应对象
size_t iSize字节数
返回:消费最近一次 Output 借出片段的前缀,允许网络短写和零长度消费。

示例已编译验证

/* 消费最近一次 Output 借出片段的前缀,允许网络短写和零长度消费。 */
result = xrtHttp1ServerResponseOutputConsume(pResponse, iSize);

xrtHttp1ServerResponseError

返回响应准备或输出阶段的稳定终态错误。

const xerror* xrtHttp1ServerResponseError( const xhttp1serverresponse* pResponse );
参数说明
const xhttp1serverresponse* pResponse响应对象
返回:返回响应准备或输出阶段的稳定终态错误。

示例已编译验证

/* 返回响应准备或输出阶段的稳定终态错误。 */
result = xrtHttp1ServerResponseError(pResponse);

xrtHttp1ServerResponseComplete

判断全部 HTTP/1 线路字节是否已经由调用方确认消费。

bool xrtHttp1ServerResponseComplete( const xhttp1serverresponse* pResponse );
参数说明
const xhttp1serverresponse* pResponse响应对象
返回:判断全部 HTTP/1 线路字节是否已经由调用方确认消费。

示例已编译验证

/* 判断全部 HTTP/1 线路字节是否已经由调用方确认消费。 */
result = xrtHttp1ServerResponseComplete(pResponse);

xrtHttp1ServerResponseClose

判断响应后是否必须关闭 HTTP 连接。

bool xrtHttp1ServerResponseClose( const xhttp1serverresponse* pResponse );
参数说明
const xhttp1serverresponse* pResponse响应对象
返回:判断响应后是否必须关闭 HTTP 连接。

示例已编译验证

/* 判断响应后是否必须关闭 HTTP 连接。 */
result = xrtHttp1ServerResponseClose(pResponse);

xrtHttp1ServerResponseTunnel

判断线路结束后是否应把连接交给升级协议或 CONNECT 隧道。

bool xrtHttp1ServerResponseTunnel( const xhttp1serverresponse* pResponse );
参数说明
const xhttp1serverresponse* pResponse响应对象
返回:判断线路结束后是否应把连接交给升级协议或 CONNECT 隧道。

示例已编译验证

/* 判断线路结束后是否应把连接交给升级协议或 CONNECT 隧道。 */
result = xrtHttp1ServerResponseTunnel(pResponse);

xrtHttp1ServerResponseInformational

判断该计划是否为发送后仍须等待最终响应的信息响应。

bool xrtHttp1ServerResponseInformational( const xhttp1serverresponse* pResponse );
参数说明
const xhttp1serverresponse* pResponse响应对象
返回:判断该计划是否为发送后仍须等待最终响应的信息响应。

示例已编译验证

/* 判断该计划是否为发送后仍须等待最终响应的信息响应。 */
result = xrtHttp1ServerResponseInformational(pResponse);

xrtHttp1ServerResponseWireBytes

返回已经通过 OutputConsume 确认发送的线路字节数。

uint64 xrtHttp1ServerResponseWireBytes( const xhttp1serverresponse* pResponse );
参数说明
const xhttp1serverresponse* pResponse响应对象
返回:返回已经通过 OutputConsume 确认发送的线路字节数。

示例已编译验证

/* 返回已经通过 OutputConsume 确认发送的线路字节数。 */
result = xrtHttp1ServerResponseWireBytes(pResponse);