xrtHttp1ServerConfigInit
XRT_API void xrtHttp1ServerConfigInit( xhttp1serverconfig* pConfig );
示例已编译验证
http1serverconfiginit obj; xrtHttp1ServerConfigInit(&obj);
xrtHttp1ServerExchangeCreate
创建不拥有 Socket、线程或 Timer 的串行 Server Exchange。
| 参数 | 说明 |
|---|---|
| const xhttp1serverconfig* pConfig | 配置结构 |
| const xhttp1serverevents* pEvents | 事件回调表 |
示例已编译验证
/* 创建不拥有 Socket、线程或 Timer 的串行 Server Exchange。 */ xhandle* h = xrtHttp1ServerExchangeCreate();
xrtHttp1ServerExchangeDestroy
销毁当前请求、临时解析存储和终态错误。
| 参数 | 说明 |
|---|---|
| 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 ); */ result = xrtHttp1ServerExchangeFeed();
xrtHttp1ServerExchangePause
XRT_API bool xrtHttp1ServerExchangePause( xhttp1serverexchange* pExchange );
示例已编译验证
/* XRT_API bool xrtHttp1ServerExchangePause( xhttp1serverexchange* pExchange ); */ result = xrtHttp1ServerExchangePause();
xrtHttp1ServerExchangeResume
恢复正文消费;调用方随后以尚未接受的输入再次 Feed。
| 参数 | 说明 |
|---|---|
| xhttp1serverexchange* pExchange | 交换对象 |
示例已编译验证
/* 恢复正文消费;调用方随后以尚未接受的输入再次 Feed。 */ result = xrtHttp1ServerExchangeResume(pExchange);
xrtHttp1ServerExchangeSetBodyLimit
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 ); */ result = xrtHttp1ServerExchangeNext();
xrtHttp1ServerExchangeRequest
返回当前拥有型请求的借用指针,尚未完成 Header 时为空。
| 参数 | 说明 |
|---|---|
| const xhttp1serverexchange* pExchange | 交换对象 |
示例已编译验证
/* 返回当前拥有型请求的借用指针,尚未完成 Header 时为空。 */ result = xrtHttp1ServerExchangeRequest(pExchange);
xrtHttp1ServerExchangeError
返回稳定终态错误;非失败状态返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttp1serverexchange* pExchange | 交换对象 |
示例已编译验证
/* 返回稳定终态错误;非失败状态返回空指针。 */ result = xrtHttp1ServerExchangeError(pExchange);
xrtHttp1ServerExchangeComplete
判断当前请求是否已经完整交付 Header、正文和 Trailer。
| 参数 | 说明 |
|---|---|
| const xhttp1serverexchange* pExchange | 交换对象 |
示例已编译验证
/* 判断当前请求是否已经完整交付 Header、正文和 Trailer。 */ result = xrtHttp1ServerExchangeComplete(pExchange);
xrtHttp1ServerExchangePaused
判断 Exchange 是否因正文消费者背压而暂停。
| 参数 | 说明 |
|---|---|
| const xhttp1serverexchange* pExchange | 交换对象 |
示例已编译验证
/* 判断 Exchange 是否因正文消费者背压而暂停。 */ result = xrtHttp1ServerExchangePaused(pExchange);
xrtHttp1ServerExchangeWireBytes
返回当前请求已经接受的 Header 与正文线缆字节总数。
| 参数 | 说明 |
|---|---|
| const xhttp1serverexchange* pExchange | 交换对象 |
示例已编译验证
/* 返回当前请求已经接受的 Header 与正文线缆字节总数。 */ result = xrtHttp1ServerExchangeWireBytes(pExchange);
xrtHttp1ServerResponseInform
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 ); */ result = xrtHttp1ServerResponsePrepare();
xrtHttp1ServerResponseCreate
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 和稳定错误。
| 参数 | 说明 |
|---|---|
| xhttp1serverresponse* pResponse | 响应对象 |
示例已编译验证
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 ); */ result = xrtHttp1ServerResponseOutput();
xrtHttp1ServerResponseOutputConsume
消费最近一次 Output 借出片段的前缀,允许网络短写和零长度消费。
| 参数 | 说明 |
|---|---|
| xhttp1serverresponse* pResponse | 响应对象 |
| size_t iSize | 字节数 |
示例已编译验证
/* 消费最近一次 Output 借出片段的前缀,允许网络短写和零长度消费。 */ result = xrtHttp1ServerResponseOutputConsume(pResponse, iSize);
xrtHttp1ServerResponseError
返回响应准备或输出阶段的稳定终态错误。
| 参数 | 说明 |
|---|---|
| const xhttp1serverresponse* pResponse | 响应对象 |
示例已编译验证
/* 返回响应准备或输出阶段的稳定终态错误。 */ result = xrtHttp1ServerResponseError(pResponse);
xrtHttp1ServerResponseComplete
判断全部 HTTP/1 线路字节是否已经由调用方确认消费。
| 参数 | 说明 |
|---|---|
| const xhttp1serverresponse* pResponse | 响应对象 |
示例已编译验证
/* 判断全部 HTTP/1 线路字节是否已经由调用方确认消费。 */ result = xrtHttp1ServerResponseComplete(pResponse);
xrtHttp1ServerResponseClose
判断响应后是否必须关闭 HTTP 连接。
| 参数 | 说明 |
|---|---|
| const xhttp1serverresponse* pResponse | 响应对象 |
示例已编译验证
/* 判断响应后是否必须关闭 HTTP 连接。 */ result = xrtHttp1ServerResponseClose(pResponse);
xrtHttp1ServerResponseTunnel
判断线路结束后是否应把连接交给升级协议或 CONNECT 隧道。
| 参数 | 说明 |
|---|---|
| const xhttp1serverresponse* pResponse | 响应对象 |
示例已编译验证
/* 判断线路结束后是否应把连接交给升级协议或 CONNECT 隧道。 */ result = xrtHttp1ServerResponseTunnel(pResponse);
xrtHttp1ServerResponseInformational
判断该计划是否为发送后仍须等待最终响应的信息响应。
| 参数 | 说明 |
|---|---|
| const xhttp1serverresponse* pResponse | 响应对象 |
示例已编译验证
/* 判断该计划是否为发送后仍须等待最终响应的信息响应。 */ result = xrtHttp1ServerResponseInformational(pResponse);
xrtHttp1ServerResponseWireBytes
返回已经通过 OutputConsume 确认发送的线路字节数。
| 参数 | 说明 |
|---|---|
| const xhttp1serverresponse* pResponse | 响应对象 |
示例已编译验证
/* 返回已经通过 OutputConsume 确认发送的线路字节数。 */ result = xrtHttp1ServerResponseWireBytes(pResponse);