本文整理汇总了C++中HTTPMessage::getHeader方法的典型用法代码示例。如果您正苦于以下问题:C++ HTTPMessage::getHeader方法的具体用法?C++ HTTPMessage::getHeader怎么用?C++ HTTPMessage::getHeader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPMessage
的用法示例。
在下文中一共展示了HTTPMessage::getHeader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
break;
}
// Remove used data from the buffer
if (uDataUsed == uDataLen)
{
HX_RELEASE(pBuf);
}
else
{
pNewBuf = new CHXStaticBuffer(pBuf, uDataUsed,
uDataLen-uDataUsed);
pNewBuf->AddRef();
HX_RELEASE(pBuf);
pBuf = pNewBuf;
}
if (m_pResponse == NULL)
{
DetectHandler(pMsg);
HX_ASSERT(m_pResponse != NULL);
m_pResponse->Init(this);
bFirstRun = TRUE;
}
if (m_pResponse->GetFeatureFlags() & HTTP_FEATURE_IGNORE_CONTENT_LENGTH)
{
// Cloaking V2.
if (m_pResponse->GetFeatureFlags() & ( HTTP_FEATURE_V11_SUPPORT
| HTTP_FEATURE_CHUNKED_ENCODING_SUPPORT))
{
m_uContentRemain = 0;
CHXString strEncoding = pMsg->getHeaderValue("Transfer-Encoding");
if (strEncoding == "chunked")
{
m_ReadState = DEMUX_READ_DATA;
}
}
else // Far less strict for non-persistent HTTP/1.0 connections.
{
m_uContentRemain = 0;
m_ReadState = DEMUX_READ_DATA;
}
}
else
{
MIMEHeader* pHdr = pMsg->getHeader("Content-Length");
if (!pHdr)
{
m_uContentRemain = 0;
}
else
{
CHXString strLen;
pHdr->asString(strLen);
int iLen = atoi(strLen);
if (iLen < 0 || iLen > 0xffff)
{
DPRINTF(D_ERROR, ("HTTP: Bad content length %d\n", iLen));
if (pBuf)
pBuf->Release();
Close(HXR_FAIL);
return;