diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-05-22 20:51:58 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-22 20:51:58 +0300 |
| commit | 6cc7dd09d5e69cf57e6de7fb568a0ad2693f9c9a (patch) | |
| tree | fab23811a5cedc1ebf01479c852ee92ff62b636c /indra/llcorehttp/httpheaders.cpp | |
| parent | ef8f4819822288e044ea719feb6af7a1f4df4c4e (diff) | |
| parent | 7bb5afc11ee5a6af78302a8d76a9a619e2baaab2 (diff) | |
Merge pull request #1545 from Ansariel/DRTVWR-600-maint-A
Merge main into DRTVWR-600-maint-a
Diffstat (limited to 'indra/llcorehttp/httpheaders.cpp')
| -rw-r--r-- | indra/llcorehttp/httpheaders.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/indra/llcorehttp/httpheaders.cpp b/indra/llcorehttp/httpheaders.cpp index f586191a7c..6f1d0db370 100644 --- a/indra/llcorehttp/httpheaders.cpp +++ b/indra/llcorehttp/httpheaders.cpp @@ -44,61 +44,61 @@ HttpHeaders::~HttpHeaders() void HttpHeaders::clear() { - mHeaders.clear(); + mHeaders.clear(); } void HttpHeaders::append(const std::string & name, const std::string & value) { - mHeaders.push_back(value_type(name, value)); + mHeaders.push_back(value_type(name, value)); } void HttpHeaders::append(const char * name, const char * value) { - mHeaders.push_back(value_type(name, value)); + mHeaders.push_back(value_type(name, value)); } void HttpHeaders::appendNormal(const char * header, size_t size) { - std::string name; - std::string value; + std::string name; + std::string value; - int col_pos(0); - for (; col_pos < size; ++col_pos) - { - if (':' == header[col_pos]) - break; - } - - if (col_pos < size) - { - // Looks like a header, split it and normalize. - // Name is everything before the colon, may be zero-length. - name.assign(header, col_pos); + int col_pos(0); + for (; col_pos < size; ++col_pos) + { + if (':' == header[col_pos]) + break; + } - // Value is everything after the colon, may also be zero-length. - const size_t val_len(size - col_pos - 1); - if (val_len) - { - value.assign(header + col_pos + 1, val_len); - } + if (col_pos < size) + { + // Looks like a header, split it and normalize. + // Name is everything before the colon, may be zero-length. + name.assign(header, col_pos); - // Clean the strings - LLStringUtil::toLower(name); - LLStringUtil::trim(name); - LLStringUtil::trimHead(value); - } - else - { - // Uncertain what this is, we'll pack it as - // a name without a value. Won't clean as we don't - // know what it is... - name.assign(header, size); - } + // Value is everything after the colon, may also be zero-length. + const size_t val_len(size - col_pos - 1); + if (val_len) + { + value.assign(header + col_pos + 1, val_len); + } + + // Clean the strings + LLStringUtil::toLower(name); + LLStringUtil::trim(name); + LLStringUtil::trimHead(value); + } + else + { + // Uncertain what this is, we'll pack it as + // a name without a value. Won't clean as we don't + // know what it is... + name.assign(header, size); + } - mHeaders.push_back(value_type(name, value)); + mHeaders.push_back(value_type(name, value)); } @@ -106,15 +106,15 @@ void HttpHeaders::appendNormal(const char * header, size_t size) // std::map for this in the past. const std::string * HttpHeaders::find(const std::string &name) const { - const_reverse_iterator iend(rend()); - for (const_reverse_iterator iter(rbegin()); iend != iter; ++iter) - { - if ((*iter).first == name) - { - return &(*iter).second; - } - } - return NULL; + const_reverse_iterator iend(rend()); + for (const_reverse_iterator iter(rbegin()); iend != iter; ++iter) + { + if ((*iter).first == name) + { + return &(*iter).second; + } + } + return NULL; } void HttpHeaders::remove(const char *name) @@ -139,50 +139,50 @@ void HttpHeaders::remove(const std::string &name) // Standard Iterators HttpHeaders::iterator HttpHeaders::begin() { - return mHeaders.begin(); + return mHeaders.begin(); } HttpHeaders::const_iterator HttpHeaders::begin() const { - return mHeaders.begin(); + return mHeaders.begin(); } HttpHeaders::iterator HttpHeaders::end() { - return mHeaders.end(); + return mHeaders.end(); } HttpHeaders::const_iterator HttpHeaders::end() const { - return mHeaders.end(); + return mHeaders.end(); } // Standard Reverse Iterators HttpHeaders::reverse_iterator HttpHeaders::rbegin() { - return mHeaders.rbegin(); + return mHeaders.rbegin(); } HttpHeaders::const_reverse_iterator HttpHeaders::rbegin() const { - return mHeaders.rbegin(); + return mHeaders.rbegin(); } HttpHeaders::reverse_iterator HttpHeaders::rend() { - return mHeaders.rend(); + return mHeaders.rend(); } HttpHeaders::const_reverse_iterator HttpHeaders::rend() const { - return mHeaders.rend(); + return mHeaders.rend(); } @@ -192,7 +192,7 @@ HttpHeaders::const_reverse_iterator HttpHeaders::rend() const // HttpHeaders::container_t & HttpHeaders::getContainerTESTONLY() { - return mHeaders; + return mHeaders; } |
