xrtHttp1ExchangeConfigInit

初始化公网安全限额;输出可位于合法的未对齐存储。

void xrtHttp1ExchangeConfigInit( xhttp1exchangeconfig* pConfig );
参数说明
xhttp1exchangeconfig* pConfig配置结构
返回:初始化公网安全限额;输出可位于合法的未对齐存储。

示例已编译验证

http1exchangeconfiginit obj;
xrtHttp1ExchangeConfigInit(&obj);

xrtHttp1ExchangeCreate

XRT_API xhttp1exchange* xrtHttp1ExchangeCreate( xhttp1requestplan* pPlan, const xhttp1exchangeconfig* pConfig, const xhttp1exchangeevents* pEvents );

;
返回:XRT_API xhttp1exchange* xrtHttp1ExchangeCreate( xhttp1requestplan* pPlan, const xhttp1exchangeconfig* pConfig, const xhttp1exchangeevents* pEvents );

示例已编译验证

/* XRT_API xhttp1exchange* xrtHttp1ExchangeCreate( xhttp1requestplan* pPlan, const xhttp1exchangeconfig* pConfig, const xhttp1exchangeevents* pEvents ); */
xhandle* h = xrtHttp1ExchangeCreate();

xrtHttp1ExchangeDestroy

销毁 Exchange、未取走的响应、请求计划和正文 Reader。

void xrtHttp1ExchangeDestroy( xhttp1exchange* pExchange );
参数说明
xhttp1exchange* pExchange交换对象
返回:销毁 Exchange、未取走的响应、请求计划和正文 Reader。

示例已编译验证

xrtHttp1ExchangeDestroy(pExchange);

xrtHttp1ExchangeOutput

XRT_API xhttp1outputstatus xrtHttp1ExchangeOutput( xhttp1exchange* pExchange, size_t iMaxBytes, xbytesview* pData );

;
返回:XRT_API xhttp1outputstatus xrtHttp1ExchangeOutput( xhttp1exchange* pExchange, size_t iMaxBytes, xbytesview* pData );

示例已编译验证

/* XRT_API xhttp1outputstatus xrtHttp1ExchangeOutput( xhttp1exchange* pExchange, size_t iMaxBytes, xbytesview* pData ); */
result = xrtHttp1ExchangeOutput();

xrtHttp1ExchangeOutputConsume

消费最近一次 Output 借出的前缀;允许短写。

bool xrtHttp1ExchangeOutputConsume( xhttp1exchange* pExchange, size_t iSize );
参数说明
xhttp1exchange* pExchange交换对象
size_t iSize字节数
返回:消费最近一次 Output 借出的前缀;允许短写。

示例已编译验证

/* 消费最近一次 Output 借出的前缀;允许短写。 */
result = xrtHttp1ExchangeOutputConsume(pExchange, iSize);

xrtHttp1ExchangeContinue

允许 Expect: 100-continue 请求开始发送正文;重复调用是安全的。

bool xrtHttp1ExchangeContinue( xhttp1exchange* pExchange );
参数说明
xhttp1exchange* pExchange交换对象
返回:允许 Expect: 100-continue 请求开始发送正文;重复调用是安全的。

示例已编译验证

/* 允许 Expect: 100-continue 请求开始发送正文;重复调用是安全的。 */
result = xrtHttp1ExchangeContinue(pExchange);

xrtHttp1ExchangePause

暂停响应输入交付;可在 Headers 或 Body 回调内调用。

bool xrtHttp1ExchangePause(xhttp1exchange* pExchange);
参数说明
xhttp1exchange* pExchange交换对象
返回:暂停响应输入交付;可在 Headers 或 Body 回调内调用。

示例已编译验证

/* 暂停响应输入交付;可在 Headers 或 Body 回调内调用。 */
result = xrtHttp1ExchangePause(pExchange);

xrtHttp1ExchangeResume

恢复响应输入交付;重复恢复未暂停 Exchange 是安全的。

bool xrtHttp1ExchangeResume(xhttp1exchange* pExchange);
参数说明
xhttp1exchange* pExchange交换对象
返回:恢复响应输入交付;重复恢复未暂停 Exchange 是安全的。

示例已编译验证

/* 恢复响应输入交付;重复恢复未暂停 Exchange 是安全的。 */
result = xrtHttp1ExchangeResume(pExchange);

xrtHttp1ExchangePaused

判断响应输入是否由应用暂停。

bool xrtHttp1ExchangePaused( const xhttp1exchange* pExchange );
参数说明
const xhttp1exchange* pExchange交换对象
返回:判断响应输入是否由应用暂停。

示例已编译验证

/* 判断响应输入是否由应用暂停。 */
result = xrtHttp1ExchangePaused(pExchange);

xrtHttp1ExchangeFeed

XRT_API xhttp1feedstatus xrtHttp1ExchangeFeed( xhttp1exchange* pExchange, xbytesview Input, bool bEnd, size_t* pAccepted );

;
返回:XRT_API xhttp1feedstatus xrtHttp1ExchangeFeed( xhttp1exchange* pExchange, xbytesview Input, bool bEnd, size_t* pAccepted );

示例已编译验证

/* XRT_API xhttp1feedstatus xrtHttp1ExchangeFeed( xhttp1exchange* pExchange, xbytesview Input, bool bEnd, size_t* pAccepted ); */
result = xrtHttp1ExchangeFeed();

xrtHttp1ExchangeResponse

返回最终响应的借用指针;最终 Header 到达前返回空指针。

const xhttpresponse* xrtHttp1ExchangeResponse( const xhttp1exchange* pExchange );
参数说明
const xhttp1exchange* pExchange交换对象
返回:返回最终响应的借用指针;最终 Header 到达前返回空指针。

示例已编译验证

/* 返回最终响应的借用指针;最终 Header 到达前返回空指针。 */
result = xrtHttp1ExchangeResponse(pExchange);

xrtHttp1ExchangeTakeResponse

在 DONE 或 UPGRADED 后取走最终响应;其他状态失败。

xhttpresponse* xrtHttp1ExchangeTakeResponse( xhttp1exchange* pExchange );
参数说明
xhttp1exchange* pExchange交换对象
返回:在 DONE 或 UPGRADED 后取走最终响应;其他状态失败。

示例已编译验证

/* 在 DONE 或 UPGRADED 后取走最终响应;其他状态失败。 */
result = xrtHttp1ExchangeTakeResponse(pExchange);

xrtHttp1ExchangeRemainder

返回因跨输入边界而内部保留的升级或多余后缀。

xbytesview xrtHttp1ExchangeRemainder( const xhttp1exchange* pExchange );
参数说明
const xhttp1exchange* pExchange交换对象
返回:返回因跨输入边界而内部保留的升级或多余后缀。

示例已编译验证

/* 返回因跨输入边界而内部保留的升级或多余后缀。 */
result = xrtHttp1ExchangeRemainder(pExchange);

xrtHttp1ExchangeError

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

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

示例已编译验证

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

xrtHttp1ExchangeRequestComplete

判断请求 Header 和完整正文是否已经全部被调用方消费。

bool xrtHttp1ExchangeRequestComplete( const xhttp1exchange* pExchange );
参数说明
const xhttp1exchange* pExchange交换对象
返回:判断请求 Header 和完整正文是否已经全部被调用方消费。

示例已编译验证

/* 判断请求 Header 和完整正文是否已经全部被调用方消费。 */
result = xrtHttp1ExchangeRequestComplete(pExchange);

xrtHttp1ExchangeResponseComplete

判断最终响应是否已经完整结束。

bool xrtHttp1ExchangeResponseComplete( const xhttp1exchange* pExchange );
参数说明
const xhttp1exchange* pExchange交换对象
返回:判断最终响应是否已经完整结束。

示例已编译验证

/* 判断最终响应是否已经完整结束。 */
result = xrtHttp1ExchangeResponseComplete(pExchange);

xrtHttp1ExchangeUpgraded

判断响应是否已经切换为升级协议或 CONNECT 隧道。

bool xrtHttp1ExchangeUpgraded( const xhttp1exchange* pExchange );
参数说明
const xhttp1exchange* pExchange交换对象
返回:判断响应是否已经切换为升级协议或 CONNECT 隧道。

示例已编译验证

/* 判断响应是否已经切换为升级协议或 CONNECT 隧道。 */
result = xrtHttp1ExchangeUpgraded(pExchange);

xrtHttp1ExchangeReusable

XRT_API bool xrtHttp1ExchangeReusable( const xhttp1exchange* pExchange );

;
返回:XRT_API bool xrtHttp1ExchangeReusable( const xhttp1exchange* pExchange );

示例已编译验证

/* XRT_API bool xrtHttp1ExchangeReusable( const xhttp1exchange* pExchange ); */
result = xrtHttp1ExchangeReusable();

xrtHttp1ExchangeInformationalCount

返回已经消费的信息响应数量。

uint32 xrtHttp1ExchangeInformationalCount( const xhttp1exchange* pExchange );
参数说明
const xhttp1exchange* pExchange交换对象
返回:返回已经消费的信息响应数量。

示例已编译验证

/* 返回已经消费的信息响应数量。 */
result = xrtHttp1ExchangeInformationalCount(pExchange);

xrtHttp1ExchangeRequestWireBytes

返回调用方通过 OutputConsume 确认发送的线路字节数。

uint64 xrtHttp1ExchangeRequestWireBytes( const xhttp1exchange* pExchange );
参数说明
const xhttp1exchange* pExchange交换对象
返回:返回调用方通过 OutputConsume 确认发送的线路字节数。

示例已编译验证

/* 返回调用方通过 OutputConsume 确认发送的线路字节数。 */
result = xrtHttp1ExchangeRequestWireBytes(pExchange);