mirror of
https://github.com/debauchee/barrier.git
synced 2026-11-26 05:42:24 +08:00
formatting changes.
This commit is contained in:
@@ -23,9 +23,7 @@ CHTTPRequest::~CHTTPRequest()
|
||||
}
|
||||
|
||||
void
|
||||
CHTTPRequest::insertHeader(
|
||||
const CString& name,
|
||||
const CString& value)
|
||||
CHTTPRequest::insertHeader(const CString& name, const CString& value)
|
||||
{
|
||||
CHeaderMap::iterator index = m_headerByName.find(name);
|
||||
if (index != m_headerByName.end()) {
|
||||
@@ -39,9 +37,7 @@ CHTTPRequest::insertHeader(
|
||||
}
|
||||
|
||||
void
|
||||
CHTTPRequest::appendHeader(
|
||||
const CString& name,
|
||||
const CString& value)
|
||||
CHTTPRequest::appendHeader(const CString& name, const CString& value)
|
||||
{
|
||||
CHeaderMap::iterator index = m_headerByName.find(name);
|
||||
if (index != m_headerByName.end()) {
|
||||
@@ -56,8 +52,7 @@ CHTTPRequest::appendHeader(
|
||||
}
|
||||
|
||||
void
|
||||
CHTTPRequest::eraseHeader(
|
||||
const CString& name)
|
||||
CHTTPRequest::eraseHeader(const CString& name)
|
||||
{
|
||||
CHeaderMap::iterator index = m_headerByName.find(name);
|
||||
if (index != m_headerByName.end()) {
|
||||
@@ -66,15 +61,13 @@ CHTTPRequest::eraseHeader(
|
||||
}
|
||||
|
||||
bool
|
||||
CHTTPRequest::isHeader(
|
||||
const CString& name) const
|
||||
CHTTPRequest::isHeader(const CString& name) const
|
||||
{
|
||||
return (m_headerByName.find(name) != m_headerByName.end());
|
||||
}
|
||||
|
||||
CString
|
||||
CHTTPRequest::getHeader(
|
||||
const CString& name) const
|
||||
CHTTPRequest::getHeader(const CString& name) const
|
||||
{
|
||||
CHeaderMap::const_iterator index = m_headerByName.find(name);
|
||||
if (index != m_headerByName.end()) {
|
||||
@@ -91,9 +84,7 @@ CHTTPRequest::getHeader(
|
||||
//
|
||||
|
||||
CHTTPRequest*
|
||||
CHTTPProtocol::readRequest(
|
||||
IInputStream* stream,
|
||||
UInt32 maxSize)
|
||||
CHTTPProtocol::readRequest(IInputStream* stream, UInt32 maxSize)
|
||||
{
|
||||
CString scratch;
|
||||
|
||||
@@ -241,9 +232,7 @@ CHTTPProtocol::readRequest(
|
||||
}
|
||||
|
||||
void
|
||||
CHTTPProtocol::reply(
|
||||
IOutputStream* stream,
|
||||
CHTTPReply& reply)
|
||||
CHTTPProtocol::reply(IOutputStream* stream, CHTTPReply& reply)
|
||||
{
|
||||
// suppress body for certain replies
|
||||
bool hasBody = true;
|
||||
@@ -321,9 +310,7 @@ CHTTPProtocol::reply(
|
||||
}
|
||||
|
||||
bool
|
||||
CHTTPProtocol::parseFormData(
|
||||
const CHTTPRequest& request,
|
||||
CFormParts& parts)
|
||||
CHTTPProtocol::parseFormData(const CHTTPRequest& request, CFormParts& parts)
|
||||
{
|
||||
static const char formData[] = "multipart/form-data";
|
||||
static const char boundary[] = "boundary=";
|
||||
@@ -458,9 +445,7 @@ CHTTPProtocol::parseFormData(
|
||||
}
|
||||
|
||||
CString
|
||||
CHTTPProtocol::readLine(
|
||||
IInputStream* stream,
|
||||
CString& tmpBuffer)
|
||||
CHTTPProtocol::readLine(IInputStream* stream, CString& tmpBuffer)
|
||||
{
|
||||
// read up to and including a CRLF from stream, using whatever
|
||||
// is in tmpBuffer as if it were at the head of the stream.
|
||||
@@ -493,10 +478,8 @@ CHTTPProtocol::readLine(
|
||||
}
|
||||
|
||||
CString
|
||||
CHTTPProtocol::readBlock(
|
||||
IInputStream* stream,
|
||||
UInt32 numBytes,
|
||||
CString& tmpBuffer)
|
||||
CHTTPProtocol::readBlock(IInputStream* stream,
|
||||
UInt32 numBytes, CString& tmpBuffer)
|
||||
{
|
||||
CString data;
|
||||
|
||||
@@ -543,10 +526,8 @@ CHTTPProtocol::readBlock(
|
||||
}
|
||||
|
||||
CString
|
||||
CHTTPProtocol::readChunk(
|
||||
IInputStream* stream,
|
||||
CString& tmpBuffer,
|
||||
UInt32* maxSize)
|
||||
CHTTPProtocol::readChunk(IInputStream* stream,
|
||||
CString& tmpBuffer, UInt32* maxSize)
|
||||
{
|
||||
CString line;
|
||||
|
||||
@@ -594,12 +575,9 @@ CHTTPProtocol::readChunk(
|
||||
}
|
||||
|
||||
void
|
||||
CHTTPProtocol::readHeaders(
|
||||
IInputStream* stream,
|
||||
CHTTPRequest* request,
|
||||
bool isFooter,
|
||||
CString& tmpBuffer,
|
||||
UInt32* maxSize)
|
||||
CHTTPProtocol::readHeaders(IInputStream* stream,
|
||||
CHTTPRequest* request, bool isFooter,
|
||||
CString& tmpBuffer, UInt32* maxSize)
|
||||
{
|
||||
// parse headers. done with headers when we get a blank line.
|
||||
CString name;
|
||||
@@ -652,8 +630,7 @@ CHTTPProtocol::readHeaders(
|
||||
}
|
||||
|
||||
bool
|
||||
CHTTPProtocol::isValidToken(
|
||||
const CString& token)
|
||||
CHTTPProtocol::isValidToken(const CString& token)
|
||||
{
|
||||
return (token.find("()<>@,;:\\\"/[]?={} "
|
||||
"\0\1\2\3\4\5\6\7"
|
||||
|
||||
Reference in New Issue
Block a user