From c437a9c4ec865c38366c8057010d24311888ecb1 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 20 May 2015 17:37:27 -0700 Subject: Webprofile converted to coroutine. Added JSON->LLSD converter Added corohandler for JSON data --- indra/llcorehttp/httpheaders.cpp | 18 ++++++++++++++++++ indra/llcorehttp/httpheaders.h | 6 +++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/httpheaders.cpp b/indra/llcorehttp/httpheaders.cpp index 73c92c8f10..e03b1b080d 100755 --- a/indra/llcorehttp/httpheaders.cpp +++ b/indra/llcorehttp/httpheaders.cpp @@ -118,6 +118,24 @@ const std::string * HttpHeaders::find(const std::string &name) const return NULL; } +void HttpHeaders::remove(const char *name) +{ + remove(std::string(name)); +} + +void HttpHeaders::remove(const std::string &name) +{ + iterator iend(end()); + for (iterator iter(begin()); iend != iter; ++iter) + { + if ((*iter).first == name) + { + mHeaders.erase(iter); + return; + } + } +} + // Standard Iterators HttpHeaders::iterator HttpHeaders::begin() diff --git a/indra/llcorehttp/httpheaders.h b/indra/llcorehttp/httpheaders.h index 940f92183c..51bd76a01d 100755 --- a/indra/llcorehttp/httpheaders.h +++ b/indra/llcorehttp/httpheaders.h @@ -146,13 +146,17 @@ public: // a pointer to a std::string in the container. // Pointer is valid only for the lifetime of // the container or until container is modifed. - const std::string * find(const std::string &name) const; const std::string * find(const char * name) const { return find(std::string(name)); } + // Remove the header from the list if found. + // + void remove(const std::string &name); + void remove(const char *name); + // Count of headers currently in the list. size_type size() const { -- cgit v1.2.3