_ZN6YaHTTP9CookieJarC2Ev:
   65|  4.01k|    CookieJar() {}; //<! constructs empty cookie jar
_ZN6YaHTTP9CookieJar5clearEv:
   71|  12.0k|    void clear() {
   72|  12.0k|      this->cookies.clear();
   73|  12.0k|    }
_ZN6YaHTTP6CookieaSERKS0_:
   22|  73.7k|     Cookie& operator=(const Cookie &rhs) {
   23|  73.7k|       name = rhs.name;
   24|  73.7k|       value = rhs.value;
   25|  73.7k|       domain = rhs.domain;
   26|  73.7k|       path = rhs.path;
   27|  73.7k|       secure = rhs.secure;
   28|  73.7k|       httponly = rhs.httponly;
   29|  73.7k|       expires = rhs.expires;
   30|  73.7k|       return *this;
   31|  73.7k|     }
_ZN6YaHTTP6CookieC2ERKS0_:
   12|  74.9k|     Cookie(const Cookie &rhs) {
   13|  74.9k|       name = rhs.name;
   14|  74.9k|       value = rhs.value;
   15|  74.9k|       domain = rhs.domain;
   16|  74.9k|       path = rhs.path;
   17|  74.9k|       secure = rhs.secure;
   18|  74.9k|       httponly = rhs.httponly;
   19|  74.9k|       expires = rhs.expires;
   20|  74.9k|     }; //<! Copy cookie values
_ZN6YaHTTP6CookieC2Ev:
    5|  6.64k|     Cookie() {
    6|  6.64k|       secure = false;
    7|  6.64k|       httponly = false;
    8|  6.64k|       name = value = "";
    9|  6.64k|       expires = DateTime();
   10|  6.64k|     }; //!< Set the cookie to empty value
_ZN6YaHTTP9CookieJar12keyValuePairERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_SA_:
   75|  75.0k|    void keyValuePair(const std::string &keyvalue, std::string &key, std::string &value) {
   76|  75.0k|      size_t pos;
   77|  75.0k|      pos = keyvalue.find('=');
   78|  75.0k|      if (pos == std::string::npos) throw ParseError("Not a Key-Value pair (cookie)");
  ------------------
  |  Branch (78:11): [True: 92, False: 74.9k]
  ------------------
   79|  74.9k|      key = std::string(keyvalue.begin(), keyvalue.begin()+pos);
   80|  74.9k|      value = std::string(keyvalue.begin()+pos+1, keyvalue.end());
   81|  74.9k|    } //<! key value pair parser
_ZN6YaHTTP9CookieJar17parseCookieHeaderERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   83|  2.16k|    void parseCookieHeader(const std::string &cookiestr) {
   84|  2.16k|      size_t pos, npos;
   85|  2.16k|      std::list<Cookie> lcookies;
   86|  2.16k|      Cookie c;
   87|  2.16k|      pos = 0;
   88|  77.1k|      while(pos < cookiestr.size()) {
  ------------------
  |  Branch (88:13): [True: 75.0k, False: 2.16k]
  ------------------
   89|  75.0k|        if ((npos = cookiestr.find("; ", pos)) == std::string::npos)
  ------------------
  |  Branch (89:13): [True: 1.87k, False: 73.1k]
  ------------------
   90|  1.87k|          npos = cookiestr.size();
   91|  75.0k|        keyValuePair(cookiestr.substr(pos, npos-pos), c.name, c.value);
   92|  75.0k|        c.name = YaHTTP::Utility::decodeURL(c.name);
   93|  75.0k|        c.value = YaHTTP::Utility::decodeURL(c.value);
   94|  75.0k|        lcookies.push_back(c);
   95|  75.0k|        pos = npos+2;
   96|  75.0k|      }
   97|  75.8k|      for(std::list<Cookie>::iterator i = lcookies.begin(); i != lcookies.end(); i++) {
  ------------------
  |  Branch (97:61): [True: 73.7k, False: 2.16k]
  ------------------
   98|  73.7k|        this->cookies[i->name] = *i;
   99|  73.7k|      }
  100|  2.16k|    }

_ZN6YaHTTP5ErrorC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
    9|    620|    Error(const std::string& reason_): reason(reason_) {};
_ZN6YaHTTP5ErrorD2Ev:
   10|    620|    virtual ~Error() throw() {};
_ZN6YaHTTP10ParseErrorC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   22|    620|    ParseError(const std::string& reason_): Error(reason_) {};

_ZN6YaHTTP7isspaceEc:
   10|  1.18M|  bool isspace(char c) {
   11|  1.18M|    return std::isspace(c) != 0;
   12|  1.18M|  }
_ZN6YaHTTP7isspaceEcRKNSt3__16localeE:
   14|  15.5k|  bool isspace(char c, const std::locale& loc) {
   15|  15.5k|    return std::isspace(c, loc);
   16|  15.5k|  }
_ZN6YaHTTP11AsyncLoaderINS_7RequestEE4feedERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
   44|  4.01k|  {
   45|  4.01k|    if (state < 2) {
  ------------------
  |  Branch (45:9): [True: 4.01k, False: 0]
  ------------------
   46|  4.01k|      headersize += somedata.length(); // maye include some body data, we don't know yet...
   47|  4.01k|      if (headersize > target->max_header_size) {
  ------------------
  |  Branch (47:11): [True: 46, False: 3.97k]
  ------------------
   48|     46|        if (target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|     46|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (48:13): [True: 46, False: 0]
  ------------------
   49|     46|          throw ParseError("Request header too large");
   50|     46|        }
   51|      0|        else {
   52|      0|          throw ParseError("Response header too large");
   53|      0|        }
   54|     46|      }
   55|  4.01k|    }
   56|  3.97k|    buffer.append(somedata);
   57|  35.4k|    while(state < 2) {
  ------------------
  |  Branch (57:11): [True: 35.3k, False: 116]
  ------------------
   58|  35.3k|      int cr=0;
   59|  35.3k|      pos = buffer.find_first_of("\n");
   60|       |      // need to find CRLF in buffer
   61|  35.3k|      if (pos == std::string::npos) return false;
  ------------------
  |  Branch (61:11): [True: 2.73k, False: 32.5k]
  ------------------
   62|  32.5k|      if (pos>0 && buffer[pos-1]=='\r')
  ------------------
  |  Branch (62:11): [True: 29.4k, False: 3.17k]
  |  Branch (62:20): [True: 217, False: 29.2k]
  ------------------
   63|    217|        cr=1;
   64|  32.5k|      std::string line(buffer.begin(), buffer.begin()+pos-cr); // exclude CRLF
   65|  32.5k|      buffer.erase(buffer.begin(), buffer.begin()+pos+1); // remove line from buffer including CRLF
   66|       |
   67|  32.5k|      if (state == 0) { // startup line
  ------------------
  |  Branch (67:11): [True: 3.95k, False: 28.6k]
  ------------------
   68|  3.95k|        if (target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|  3.95k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (68:13): [True: 3.95k, False: 0]
  ------------------
   69|  3.95k|          std::string ver;
   70|  3.95k|          std::string tmpurl;
   71|  3.95k|          std::istringstream iss(line);
   72|  3.95k|          iss >> target->method >> tmpurl >> ver;
   73|  3.95k|          if (ver.size() == 0)
  ------------------
  |  Branch (73:15): [True: 3.88k, False: 71]
  ------------------
   74|  3.88k|            target->version = 9;
   75|     71|          else if (ver.find("HTTP/0.9") == 0)
  ------------------
  |  Branch (75:20): [True: 1, False: 70]
  ------------------
   76|      1|            target->version = 9;
   77|     70|          else if (ver.find("HTTP/1.0") == 0)
  ------------------
  |  Branch (77:20): [True: 1, False: 69]
  ------------------
   78|      1|            target->version = 10;
   79|     69|          else if (ver.find("HTTP/1.1") == 0)
  ------------------
  |  Branch (79:20): [True: 3, False: 66]
  ------------------
   80|      3|            target->version = 11;
   81|     66|          else
   82|     66|            throw ParseError("HTTP version not supported");
   83|       |          // uppercase the target method
   84|  3.88k|          std::transform(target->method.begin(), target->method.end(), target->method.begin(), ::toupper);
   85|  3.88k|          target->url.parse(tmpurl);
   86|  3.88k|          target->getvars = Utility::parseUrlParameters(target->url.parameters);
   87|  3.88k|          state = 1;
   88|  3.88k|        } else if(target->kind == YAHTTP_TYPE_RESPONSE) {
  ------------------
  |  |   36|      0|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (88:19): [True: 0, False: 0]
  ------------------
   89|      0|          std::string ver;
   90|      0|          std::istringstream iss(line);
   91|      0|          std::string::size_type pos1;
   92|      0|          iss >> ver >> target->status;
   93|      0|          std::getline(iss, target->statusText);
   94|      0|          pos1=0;
   95|      0|          while(pos1 < target->statusText.size() && YaHTTP::isspace(target->statusText.at(pos1))) pos1++;
  ------------------
  |  Branch (95:17): [True: 0, False: 0]
  |  Branch (95:53): [True: 0, False: 0]
  ------------------
   96|      0|          target->statusText = target->statusText.substr(pos1); 
   97|      0|          if ((pos1 = target->statusText.find("\r")) != std::string::npos) {
  ------------------
  |  Branch (97:15): [True: 0, False: 0]
  ------------------
   98|      0|            target->statusText = target->statusText.substr(0, pos1-1);
   99|      0|          }
  100|      0|          if (ver.size() == 0) {
  ------------------
  |  Branch (100:15): [True: 0, False: 0]
  ------------------
  101|      0|            target->version = 9;
  102|      0|          } else if (ver.find("HTTP/0.9") == 0)
  ------------------
  |  Branch (102:22): [True: 0, False: 0]
  ------------------
  103|      0|            target->version = 9;
  104|      0|          else if (ver.find("HTTP/1.0") == 0)
  ------------------
  |  Branch (104:20): [True: 0, False: 0]
  ------------------
  105|      0|            target->version = 10;
  106|      0|          else if (ver.find("HTTP/1.1") == 0)
  ------------------
  |  Branch (106:20): [True: 0, False: 0]
  ------------------
  107|      0|            target->version = 11;
  108|      0|          else
  109|      0|            throw ParseError("HTTP version not supported");
  110|      0|          state = 1;
  111|      0|        }
  112|  28.6k|      } else if (state == 1) {
  ------------------
  |  Branch (112:18): [True: 28.6k, False: 0]
  ------------------
  113|  28.6k|        std::string key,value;
  114|  28.6k|        size_t pos1;
  115|  28.6k|        if (line.empty()) {
  ------------------
  |  Branch (115:13): [True: 1.01k, False: 27.6k]
  ------------------
  116|  1.01k|          chunked = (target->headers.find("transfer-encoding") != target->headers.end() && target->headers["transfer-encoding"] == "chunked");
  ------------------
  |  Branch (116:22): [True: 465, False: 550]
  |  Branch (116:92): [True: 441, False: 24]
  ------------------
  117|  1.01k|          state = 2;
  118|  1.01k|          break;
  119|  1.01k|        }
  120|       |        // split headers
  121|  27.6k|        if ((pos1 = line.find(':')) == std::string::npos) {
  ------------------
  |  Branch (121:13): [True: 23, False: 27.6k]
  ------------------
  122|     23|          throw ParseError("Malformed header line");
  123|     23|        }
  124|  27.6k|        key = line.substr(0, pos1);
  125|  27.6k|        value = line.substr(pos1 + 1);
  126|  1.21M|        for(std::string::iterator it=key.begin(); it != key.end(); it++)
  ------------------
  |  Branch (126:51): [True: 1.18M, False: 27.5k]
  ------------------
  127|  1.18M|          if (YaHTTP::isspace(*it))
  ------------------
  |  Branch (127:15): [True: 14, False: 1.18M]
  ------------------
  128|     14|            throw ParseError("Header key contains whitespace which is not allowed by RFC");
  129|       |
  130|  27.5k|        Utility::trim(value);
  131|  27.5k|        std::transform(key.begin(), key.end(), key.begin(), ::tolower);
  132|       |        // is it already defined
  133|       |
  134|  27.5k|        if (key == "set-cookie" && target->kind == YAHTTP_TYPE_RESPONSE) {
  ------------------
  |  |   36|    217|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (134:13): [True: 217, False: 27.3k]
  |  Branch (134:36): [True: 0, False: 217]
  ------------------
  135|      0|          target->jar.parseSetCookieHeader(value);
  136|  27.5k|        } else if (key == "cookie" && target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|  2.16k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (136:20): [True: 2.16k, False: 25.4k]
  |  Branch (136:39): [True: 2.16k, False: 0]
  ------------------
  137|  2.16k|          target->jar.parseCookieHeader(value);
  138|  25.4k|        } else {
  139|  25.4k|          if (key == "host" && target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|  2.32k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (139:15): [True: 2.32k, False: 23.1k]
  |  Branch (139:32): [True: 2.32k, False: 0]
  ------------------
  140|       |            // maybe it contains port?
  141|  2.32k|            if ((pos1 = value.find(':')) == std::string::npos) {
  ------------------
  |  Branch (141:17): [True: 426, False: 1.89k]
  ------------------
  142|    426|              target->url.host = value;
  143|  1.89k|            } else {
  144|  1.89k|              target->url.host = value.substr(0, pos1);
  145|  1.89k|              target->url.port = ::atoi(value.substr(pos1).c_str());
  146|  1.89k|            }
  147|  2.32k|          }
  148|  25.4k|          if (target->headers.find(key) != target->headers.end()) {
  ------------------
  |  Branch (148:15): [True: 12.9k, False: 12.5k]
  ------------------
  149|  12.9k|            target->headers[key] = target->headers[key] + ";" + value;
  150|  12.9k|          } else {
  151|  12.5k|            target->headers[key] = std::move(value);
  152|  12.5k|          }
  153|  25.4k|        }
  154|  27.5k|      }
  155|  32.5k|    }
  156|       |
  157|  1.13k|    minbody = 0;
  158|       |    // check for expected body size
  159|  1.13k|    if (target->kind == YAHTTP_TYPE_REQUEST) maxbody = target->max_request_size;
  ------------------
  |  |   35|  1.13k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (159:9): [True: 1.01k, False: 116]
  ------------------
  160|    116|    else if (target->kind == YAHTTP_TYPE_RESPONSE) maxbody = target->max_response_size;
  ------------------
  |  |   36|    116|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (160:14): [True: 0, False: 116]
  ------------------
  161|    116|    else maxbody = 0;
  162|       |
  163|  1.13k|    if (!chunked) {
  ------------------
  |  Branch (163:9): [True: 574, False: 557]
  ------------------
  164|    574|      if (target->headers.find("content-length") != target->headers.end()) {
  ------------------
  |  Branch (164:11): [True: 373, False: 201]
  ------------------
  165|    373|        std::istringstream maxbodyS(target->headers["content-length"]);
  166|    373|        maxbodyS >> minbody;
  167|    373|        maxbody = minbody;
  168|    373|      }
  169|    574|      if (minbody < 1) return true; // guess there isn't anything left.
  ------------------
  |  Branch (169:11): [True: 209, False: 365]
  ------------------
  170|    365|      if (target->kind == YAHTTP_TYPE_REQUEST && minbody > target->max_request_size) throw ParseError("Max request body size exceeded");
  ------------------
  |  |   35|    730|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (170:11): [True: 365, False: 0]
  |  Branch (170:50): [True: 149, False: 216]
  ------------------
  171|    216|      else if (target->kind == YAHTTP_TYPE_RESPONSE && minbody > target->max_response_size) throw ParseError("Max response body size exceeded");
  ------------------
  |  |   36|    432|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (171:16): [True: 0, False: 216]
  |  Branch (171:56): [True: 0, False: 0]
  ------------------
  172|    365|    }
  173|       |
  174|    773|    if (maxbody == 0) hasBody = false;
  ------------------
  |  Branch (174:9): [True: 0, False: 773]
  ------------------
  175|    773|    else hasBody = true;
  176|       |
  177|    773|    if (buffer.size() == 0) return ready();
  ------------------
  |  Branch (177:9): [True: 24, False: 749]
  ------------------
  178|       |
  179|  4.28k|    while(buffer.size() > 0) {
  ------------------
  |  Branch (179:11): [True: 3.94k, False: 340]
  ------------------
  180|  3.94k|      if (chunked) {
  ------------------
  |  Branch (180:11): [True: 3.74k, False: 193]
  ------------------
  181|  3.74k|        if (chunk_size == 0) {
  ------------------
  |  Branch (181:13): [True: 2.02k, False: 1.72k]
  ------------------
  182|  2.02k|          char buf[100];
  183|       |          // read chunk length
  184|  2.02k|          if ((pos = buffer.find('\n')) == std::string::npos) {
  ------------------
  |  Branch (184:15): [True: 37, False: 1.98k]
  ------------------
  185|     37|            if (buffer.size() > 99) {
  ------------------
  |  Branch (185:17): [True: 11, False: 26]
  ------------------
  186|     11|              throw ParseError("Nonsensical chunk_size");
  187|     11|            }
  188|     26|            return false;
  189|     37|          }
  190|  1.98k|          if (pos > 99)
  ------------------
  |  Branch (190:15): [True: 31, False: 1.95k]
  ------------------
  191|     31|            throw ParseError("Impossible chunk_size");
  192|  1.95k|          buffer.copy(buf, pos);
  193|  1.95k|          buf[pos]=0; // just in case...
  194|  1.95k|          buffer.erase(buffer.begin(), buffer.begin()+pos+1); // remove line from buffer
  195|  1.95k|          if (sscanf(buf, "%zx", &chunk_size) != 1) {
  ------------------
  |  Branch (195:15): [True: 24, False: 1.92k]
  ------------------
  196|     24|            throw ParseError("Unable to parse chunk size");
  197|     24|          }
  198|  1.92k|          if (chunk_size == 0) { state = 3; break; } // last chunk
  ------------------
  |  Branch (198:15): [True: 6, False: 1.92k]
  ------------------
  199|  1.92k|          if (chunk_size > (std::numeric_limits<decltype(chunk_size)>::max() - 2) || chunk_size > maxbody) {
  ------------------
  |  Branch (199:15): [True: 4, False: 1.91k]
  |  Branch (199:86): [True: 160, False: 1.75k]
  ------------------
  200|    164|            throw ParseError("Chunk is too large");
  201|    164|          }
  202|  1.92k|        } else {
  203|  1.72k|          int crlf=1;
  204|  1.72k|          if (buffer.size() < chunk_size+1) return false; // expect newline
  ------------------
  |  Branch (204:15): [True: 32, False: 1.69k]
  ------------------
  205|  1.69k|          if (buffer.at(chunk_size) == '\r') {
  ------------------
  |  Branch (205:15): [True: 332, False: 1.36k]
  ------------------
  206|    332|            if (buffer.size() < chunk_size+2 || buffer.at(chunk_size+1) != '\n') return false; // expect newline after carriage return
  ------------------
  |  Branch (206:17): [True: 4, False: 328]
  |  Branch (206:49): [True: 20, False: 308]
  ------------------
  207|    308|            crlf=2;
  208|  1.36k|          } else if (buffer.at(chunk_size) != '\n') return false;
  ------------------
  |  Branch (208:22): [True: 20, False: 1.34k]
  ------------------
  209|  1.65k|          if (bodysize + chunk_size > maxbody) {
  ------------------
  |  Branch (209:15): [True: 0, False: 1.65k]
  ------------------
  210|      0|            throw ParseError("Chunked body is too large");
  211|      0|          }
  212|  1.65k|          std::string tmp = buffer.substr(0, chunk_size);
  213|  1.65k|          buffer.erase(buffer.begin(), buffer.begin()+chunk_size+crlf);
  214|  1.65k|          bodybuf << tmp;
  215|  1.65k|          bodysize += chunk_size;
  216|  1.65k|          chunk_size = 0;
  217|  1.65k|          if (buffer.size() == 0) break; // just in case
  ------------------
  |  Branch (217:15): [True: 71, False: 1.58k]
  ------------------
  218|  1.65k|        }
  219|  3.74k|      } else {
  220|    193|        if (bodysize + buffer.length() > maxbody) {
  ------------------
  |  Branch (220:13): [True: 93, False: 100]
  ------------------
  221|     93|          bodybuf << buffer.substr(0, maxbody - bodybuf.str().length());
  222|     93|          bodysize = maxbody;
  223|     93|        }
  224|    100|        else {
  225|    100|          bodybuf << buffer;
  226|    100|          bodysize += buffer.length();
  227|    100|        }
  228|    193|        buffer = "";
  229|    193|      }
  230|  3.94k|    }
  231|       |
  232|    417|    if (chunk_size!=0) return false; // need more data
  ------------------
  |  Branch (232:9): [True: 31, False: 386]
  ------------------
  233|       |
  234|    386|    return ready();
  235|    417|  };

_ZN6YaHTTP7RequestC2Ev:
  237|  4.01k|    Request() { Request::initialize(); };
_ZN6YaHTTP8HTTPBaseC2Ev:
  102|  4.01k|    HTTPBase() {
  103|  4.01k|      HTTPBase::initialize();
  104|  4.01k|    };
_ZN6YaHTTP8HTTPBase10initializeEv:
  107|  12.0k|    virtual void initialize() {
  108|  12.0k|      kind = 0;
  109|  12.0k|      status = 0;
  110|  12.0k|#ifdef HAVE_CPP_FUNC_PTR
  111|  12.0k|      renderer = SendBodyRender();
  112|  12.0k|#endif
  113|  12.0k|      max_request_size = YAHTTP_MAX_REQUEST_SIZE;
  ------------------
  |  |   28|  12.0k|#define YAHTTP_MAX_REQUEST_SIZE 2097152
  ------------------
  114|  12.0k|      max_response_size = YAHTTP_MAX_RESPONSE_SIZE;
  ------------------
  |  |   32|  12.0k|#define YAHTTP_MAX_RESPONSE_SIZE 2097152
  ------------------
  115|  12.0k|      max_header_size = YAHTTP_MAX_HEADER_SIZE;
  ------------------
  |  |   24|  12.0k|#define YAHTTP_MAX_HEADER_SIZE (100 * 1024)
  ------------------
  116|  12.0k|      url = "";
  117|  12.0k|      method = "";
  118|  12.0k|      statusText = "";
  119|  12.0k|      jar.clear();
  120|  12.0k|      headers.clear();
  121|  12.0k|      parameters.clear();
  122|  12.0k|      getvars.clear();
  123|  12.0k|      postvars.clear();
  124|  12.0k|      body = "";
  125|  12.0k|      routeName = "";
  126|  12.0k|      version = 11; // default to version 1.1
  127|  12.0k|      is_multipart = false;
  128|  12.0k|    }
_ZN6YaHTTP8HTTPBase14SendBodyRenderC2Ev:
   52|  12.0k|      SendBodyRender() {};
_ZN6YaHTTP7Request10initializeEv:
  246|  8.03k|    void initialize() override {
  247|  8.03k|      HTTPBase::initialize();
  248|  8.03k|      this->kind = YAHTTP_TYPE_REQUEST;
  ------------------
  |  |   35|  8.03k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  249|  8.03k|    }
_ZN6YaHTTP8HTTPBaseD2Ev:
  105|  4.01k|    virtual ~HTTPBase() = default;
_ZN6YaHTTP11AsyncLoaderINS_7RequestEE10initializeEPS1_:
  322|  4.01k|    void initialize(T* target_) {
  323|  4.01k|      chunked = false; chunk_size = 0;
  324|  4.01k|      bodybuf.str(""); minbody = 0; maxbody = 0;
  325|  4.01k|      pos = 0; state = 0; this->target = target_;
  326|  4.01k|      hasBody = false;
  327|  4.01k|      buffer = "";
  328|  4.01k|      headersize = 0;
  329|  4.01k|      bodysize = 0;
  330|  4.01k|      this->target->initialize();
  331|  4.01k|    }; //<! Initialize the parser for target and clear state
_ZN6YaHTTP11AsyncLoaderINS_7RequestEE8finalizeEv:
  338|    379|    void finalize() {
  339|    379|      bodybuf.flush();
  340|    379|      if (ready()) {
  ------------------
  |  Branch (340:11): [True: 379, False: 0]
  ------------------
  341|    379|        std::string body = bodybuf.str();
  342|    379|        strstr_map_t::iterator cpos = target->headers.find("content-type");
  343|    379|        if (cpos != target->headers.end() && Utility::iequals(cpos->second, "application/x-www-form-urlencoded", 32)) {
  ------------------
  |  Branch (343:13): [True: 123, False: 256]
  |  Branch (343:13): [True: 83, False: 296]
  |  Branch (343:46): [True: 83, False: 40]
  ------------------
  344|     83|          target->postvars = Utility::parseUrlParameters(body);
  345|     83|        }
  346|    379|        target->body = std::move(body);
  347|    379|      }
  348|    379|      bodybuf.str("");
  349|    379|      bodysize = 0;
  350|       |      this->target = NULL;
  351|    379|    }; //<! finalize and release target
_ZN6YaHTTP11AsyncLoaderINS_7RequestEE5readyEv:
  333|    673|    bool ready() {
  334|    673|     return (chunked == true && state == 3) || // if it's chunked we get end of data indication
  ------------------
  |  Branch (334:14): [True: 84, False: 589]
  |  Branch (334:33): [True: 12, False: 72]
  ------------------
  335|    661|             (chunked == false && state > 1 &&  
  ------------------
  |  Branch (335:15): [True: 589, False: 72]
  |  Branch (335:35): [True: 589, False: 0]
  ------------------
  336|    589|               (!hasBody || (bodysize <= maxbody && bodysize >= minbody))); 
  ------------------
  |  Branch (336:17): [True: 209, False: 380]
  |  Branch (336:30): [True: 380, False: 0]
  |  Branch (336:53): [True: 328, False: 52]
  ------------------
  337|    673|    }; //<! whether we have received enough data

_ZN6YaHTTP3URLC2Ev:
  166|  4.01k|      URL() { initialize(); }; //<! construct empty url
_ZN6YaHTTP3URL10initializeEv:
  116|  19.9k|      void initialize() {
  117|  19.9k|        protocol = ""; host = ""; port = 0; username = ""; password = ""; path = ""; parameters = ""; anchor =""; pathless = true;
  118|  19.9k|      }; //<! initialize to empty URL
_ZN6YaHTTP3URLC2EPKc:
  171|  12.0k|      URL(const char *url) {
  172|  12.0k|        parse(std::string(url));
  173|  12.0k|      }; //<! calls parse with url
_ZN6YaHTTP3URL5parseERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  175|  15.9k|      bool parse(const std::string& url) {
  176|       |        // setup
  177|  15.9k|        initialize();
  178|       |
  179|  15.9k|        if (url.size() > YAHTTP_MAX_URL_LENGTH) return false;
  ------------------
  |  |    8|  15.9k|#define YAHTTP_MAX_URL_LENGTH 2048
  ------------------
  |  Branch (179:13): [True: 12, False: 15.9k]
  ------------------
  180|  15.9k|        size_t pos = 0;
  181|  15.9k|        if (*(url.begin()) != '/') { // full url?
  ------------------
  |  Branch (181:13): [True: 15.7k, False: 218]
  ------------------
  182|  15.7k|          if (parseSchema(url, pos) == false) return false;
  ------------------
  |  Branch (182:15): [True: 14.4k, False: 1.30k]
  ------------------
  183|  1.30k|          if (pathless) {
  ------------------
  |  Branch (183:15): [True: 761, False: 541]
  ------------------
  184|    761|            parameters = url.substr(pos);
  185|    761|            return true;
  186|    761|          }
  187|    541|          if (parseUserPass(url, pos) == false) return false;
  ------------------
  |  Branch (187:15): [True: 0, False: 541]
  ------------------
  188|    541|          if (parseHost(url, pos) == false) return false;
  ------------------
  |  Branch (188:15): [True: 25, False: 516]
  ------------------
  189|    541|        }
  190|    734|        if (parsePath(url, pos) == false) return false;
  ------------------
  |  Branch (190:13): [True: 0, False: 734]
  ------------------
  191|    734|        if (parseParameters(url, pos) == false) return false;
  ------------------
  |  Branch (191:13): [True: 0, False: 734]
  ------------------
  192|    734|        return parseAnchor(url, pos);
  193|    734|    }; //<! parse various formats of urls ranging from http://example.com/foo?bar=baz into data:base64:d089swt64wt... 
_ZN6YaHTTP3URL11parseSchemaERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   15|  15.7k|      bool parseSchema(const std::string& url, size_t &pos) {
   16|  15.7k|          size_t pos1;
   17|  15.7k|          if (pos >= url.size()) return false; // no data
  ------------------
  |  Branch (17:15): [True: 14.3k, False: 1.33k]
  ------------------
   18|  1.33k|          if ( (pos1 = url.find_first_of(":",pos)) == std::string::npos ) return false; // schema is mandatory
  ------------------
  |  Branch (18:16): [True: 37, False: 1.30k]
  ------------------
   19|  1.30k|          protocol = url.substr(pos, pos1-pos);
   20|  1.30k|          if (protocol == "http") port = 80;
  ------------------
  |  Branch (20:15): [True: 2, False: 1.30k]
  ------------------
   21|  1.30k|          if (protocol == "https") port = 443;
  ------------------
  |  Branch (21:15): [True: 2, False: 1.30k]
  ------------------
   22|  1.30k|          pos = pos1+1; // after :
   23|  1.30k|          if (url.compare(pos, 2, "//") == 0) {
  ------------------
  |  Branch (23:15): [True: 541, False: 761]
  ------------------
   24|    541|             pathless = false; // if this is true we put rest into parameters
   25|    541|             pos += 2;
   26|    541|          }
   27|  1.30k|          return true;
   28|  1.33k|      }; //<! parse schema/protocol part 
_ZN6YaHTTP3URL13parseUserPassERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   60|    541|      bool parseUserPass(const std::string& url, size_t &pos) {
   61|    541|          size_t pos1,pos2;
   62|    541|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (62:15): [True: 1, False: 540]
  ------------------
   63|       |
   64|    540|          if ( (pos1 = url.find_first_of("@",pos)) == std::string::npos ) return true; // no userinfo
  ------------------
  |  Branch (64:16): [True: 336, False: 204]
  ------------------
   65|    204|          pos2 = url.find_first_of(":",pos);
   66|       |
   67|    204|          if (pos2 != std::string::npos) { // comes with password
  ------------------
  |  Branch (67:15): [True: 122, False: 82]
  ------------------
   68|    122|             username = url.substr(pos, pos2 - pos);
   69|    122|             password = url.substr(pos2+1, pos1 - pos2 - 1);
   70|    122|             password = Utility::decodeURL(password);
   71|    122|          } else {
   72|     82|             username = url.substr(pos, pos1 - pos);
   73|     82|          }
   74|    204|          pos = pos1+1;
   75|    204|          username = Utility::decodeURL(username);
   76|    204|          return true;
   77|    540|      }; //<! parse possible username and password
_ZN6YaHTTP3URL9parseHostERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   30|    541|      bool parseHost(const std::string& url, size_t &pos) {
   31|    541|          size_t pos1;
   32|    541|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (32:15): [True: 77, False: 464]
  ------------------
   33|    464|          if ( (pos1 = url.find_first_of("/", pos)) == std::string::npos ) {
  ------------------
  |  Branch (33:16): [True: 327, False: 137]
  ------------------
   34|    327|             host = url.substr(pos);
   35|    327|             path = "/";
   36|    327|             pos = url.size();
   37|    327|          } else {
   38|    137|             host = url.substr(pos, pos1-pos);
   39|    137|             pos = pos1;
   40|    137|          }
   41|    464|          if (host.at(0) == '[') { // IPv6
  ------------------
  |  Branch (41:15): [True: 165, False: 299]
  ------------------
   42|    165|            if ((pos1 = host.find_first_of("]")) == std::string::npos) {
  ------------------
  |  Branch (42:17): [True: 25, False: 140]
  ------------------
   43|       |              // incomplete address
   44|     25|              return false;
   45|     25|            }
   46|    140|            size_t pos2;
   47|    140|            if ((pos2 = host.find_first_of(":", pos1)) != std::string::npos) {
  ------------------
  |  Branch (47:17): [True: 77, False: 63]
  ------------------
   48|     77|              std::istringstream tmp(host.substr(pos2 + 1));
   49|     77|              tmp >> port;
   50|     77|            }
   51|    140|            host = host.substr(1, pos1 - 1);
   52|    299|          } else if ( (pos1 = host.find_first_of(":")) != std::string::npos ) {
  ------------------
  |  Branch (52:23): [True: 154, False: 145]
  ------------------
   53|    154|             std::istringstream tmp(host.substr(pos1+1));
   54|    154|             tmp >> port;
   55|    154|             host = host.substr(0, pos1);
   56|    154|          }
   57|    439|          return true;
   58|    464|      }; //<! parse host and port
_ZN6YaHTTP3URL9parsePathERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   79|    710|      bool parsePath(const std::string& url, size_t &pos) {
   80|    710|          size_t pos1;
   81|    710|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (81:15): [True: 383, False: 327]
  ------------------
   82|    327|          if (url[pos] != '/') return false; // not an url
  ------------------
  |  Branch (82:15): [True: 0, False: 327]
  ------------------
   83|    327|          if ( (pos1 = url.find_first_of("?", pos)) == std::string::npos ) {
  ------------------
  |  Branch (83:16): [True: 112, False: 215]
  ------------------
   84|    112|             path = url.substr(pos);
   85|    112|             pos = url.size();
   86|    215|          } else {
   87|    215|             path = url.substr(pos, pos1-pos);
   88|    215|             pos = pos1;
   89|    215|          }
   90|    327|          return true;
   91|    327|      }; //<! parse path component
_ZN6YaHTTP3URL15parseParametersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   93|    710|      bool parseParameters(const std::string& url, size_t &pos) {
   94|    710|          size_t pos1;
   95|    710|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (95:15): [True: 495, False: 215]
  ------------------
   96|    215|          if (url[pos] == '#') return true; // anchor starts here
  ------------------
  |  Branch (96:15): [True: 0, False: 215]
  ------------------
   97|    215|          if (url[pos] != '?') return false; // not a parameter
  ------------------
  |  Branch (97:15): [True: 0, False: 215]
  ------------------
   98|    215|          if ( (pos1 = url.find_first_of("#", pos)) == std::string::npos ) {
  ------------------
  |  Branch (98:16): [True: 124, False: 91]
  ------------------
   99|    124|             parameters = url.substr(pos+1);;
  100|    124|             pos = url.size();
  101|    124|          } else {
  102|     91|             parameters = url.substr(pos+1, pos1-pos-1);
  103|     91|             pos = pos1;
  104|     91|          }
  105|    215|          if (parameters.size()>0 && *(parameters.end()-1) == '&') parameters.resize(parameters.size()-1);
  ------------------
  |  Branch (105:15): [True: 139, False: 76]
  |  Branch (105:15): [True: 6, False: 209]
  |  Branch (105:38): [True: 6, False: 133]
  ------------------
  106|    215|          return true;
  107|    215|      }; //<! parse url parameters
_ZN6YaHTTP3URL11parseAnchorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
  109|    710|      bool parseAnchor(const std::string& url, size_t &pos) {
  110|    710|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (110:15): [True: 619, False: 91]
  ------------------
  111|     91|          if (url[pos] != '#') return false; // not anchor
  ------------------
  |  Branch (111:15): [True: 0, False: 91]
  ------------------
  112|     91|          anchor = url.substr(pos+1);
  113|     91|          return true;
  114|     91|      }; //<! parse anchor

_ZN6YaHTTP7Utility9decodeURLERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  229|   181k|    static std::string decodeURL(const std::string& component) {
  230|   181k|        std::string result = component;
  231|   181k|        size_t pos1,pos2;
  232|   181k|        pos2 = 0;
  233|   509k|        while((pos1 = result.find_first_of("%", pos2))!=std::string::npos) {
  ------------------
  |  Branch (233:15): [True: 333k, False: 176k]
  ------------------
  234|   333k|           std::string code;
  235|   333k|           char a,b,c;
  236|   333k|           if (pos1 + 2 > result.length()) return result; // end of result
  ------------------
  |  Branch (236:16): [True: 4.87k, False: 328k]
  ------------------
  237|   328k|           code = result.substr(pos1+1, 2);
  238|   328k|           a = std::tolower(code[0]); b = std::tolower(code[1]);
  239|       |
  240|   328k|           if ((( '0' > a || a > '9') && ('a' > a || a > 'f')) ||
  ------------------
  |  Branch (240:19): [True: 143k, False: 185k]
  |  Branch (240:30): [True: 145k, False: 40.2k]
  |  Branch (240:43): [True: 169k, False: 118k]
  |  Branch (240:54): [True: 27.2k, False: 91.6k]
  ------------------
  241|   259k|              (( '0' > b || b > '9') && ('a' > b || b > 'f'))) {
  ------------------
  |  Branch (241:18): [True: 43.5k, False: 88.3k]
  |  Branch (241:29): [True: 75.3k, False: 13.0k]
  |  Branch (241:42): [True: 61.2k, False: 57.5k]
  |  Branch (241:53): [True: 1.89k, False: 55.6k]
  ------------------
  242|   259k|              pos2 = pos1+3;
  243|   259k|              continue;
  244|   259k|           }
  245|       |
  246|  68.7k|           if ('0' <= a && a <= '9') a = a - '0';
  ------------------
  |  Branch (246:16): [True: 68.7k, False: 0]
  |  Branch (246:28): [True: 12.7k, False: 55.9k]
  ------------------
  247|  55.9k|           else if ('a' <= a && a <= 'f') a = a - 'a' + 0x0a;
  ------------------
  |  Branch (247:21): [True: 55.9k, False: 0]
  |  Branch (247:33): [True: 55.9k, False: 0]
  ------------------
  248|  68.7k|           if ('0' <= b && b <= '9') b = b - '0';
  ------------------
  |  Branch (248:16): [True: 68.7k, False: 0]
  |  Branch (248:28): [True: 13.0k, False: 55.6k]
  ------------------
  249|  55.6k|           else if ('a' <= b && b <= 'f') b = b - 'a' + 0x0a;
  ------------------
  |  Branch (249:21): [True: 55.6k, False: 0]
  |  Branch (249:33): [True: 55.6k, False: 0]
  ------------------
  250|       |
  251|  68.7k|           c = (a<<4)+b;
  252|  68.7k|           result = result.replace(pos1,3,1,c);
  253|  68.7k|           pos2=pos1;
  254|  68.7k|        }
  255|   176k|        return result;
  256|   181k|    }; //<! Decodes %xx from string into bytes
_ZN6YaHTTP8DateTimeC2Ev:
   57|  88.2k|     DateTime() { 
   58|  88.2k|       initialize();
   59|  88.2k|     }; //<! Construct and initialize
_ZN6YaHTTP8DateTime10initializeEv:
   61|  88.2k|     void initialize() {
   62|  88.2k|       isSet = false; 
   63|  88.2k|       year = month = day = wday = hours = minutes = seconds = utc_offset = 0;
   64|  88.2k|       month = 1; // it's invalid otherwise
   65|  88.2k|     }; //<! Creates year 0 date
_ZNK6YaHTTP25ASCIICINullSafeComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
   26|   706k|    bool operator() (const std::string& lhs, const std::string& rhs) const {
   27|   706k|      int v;
   28|   706k|      std::string::const_iterator lhi = lhs.begin();
   29|   706k|      std::string::const_iterator rhi = rhs.begin();
   30|  1.58M|      for(;lhi != lhs.end() && rhi != rhs.end(); lhi++, rhi++)
  ------------------
  |  Branch (30:12): [True: 1.26M, False: 320k]
  |  Branch (30:12): [True: 1.25M, False: 332k]
  |  Branch (30:32): [True: 1.25M, False: 12.1k]
  ------------------
   31|  1.25M|        if ((v = ::tolower(*lhi) - ::tolower(*rhi)) != 0) return v<0; 
  ------------------
  |  Branch (31:13): [True: 373k, False: 881k]
  ------------------
   32|   332k|      if (lhi == lhs.end() && rhi != rhs.end()) return true;
  ------------------
  |  Branch (32:11): [True: 320k, False: 12.1k]
  |  Branch (32:11): [True: 87.3k, False: 245k]
  |  Branch (32:31): [True: 87.3k, False: 233k]
  ------------------
   33|   245k|      if (lhi != lhs.end() && rhi == rhs.end()) return false;
  ------------------
  |  Branch (33:11): [True: 12.1k, False: 233k]
  |  Branch (33:11): [True: 12.1k, False: 233k]
  |  Branch (33:31): [True: 12.1k, False: 0]
  ------------------
   34|   233k|      return false; // they are equal
   35|   245k|    }
_ZN6YaHTTP7Utility7iequalsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_m:
  419|    123|    static bool iequals(const std::string& a, const std::string& b, size_t length) {
  420|    123|      std::string::const_iterator ai, bi;
  421|    123|      size_t i;
  422|  3.27k|      for(ai = a.begin(), bi = b.begin(), i = 0; ai != a.end() && bi != b.end() && i < length; ai++,bi++,i++) {
  ------------------
  |  Branch (422:50): [True: 3.25k, False: 20]
  |  Branch (422:50): [True: 3.16k, False: 113]
  |  Branch (422:67): [True: 3.25k, False: 0]
  |  Branch (422:84): [True: 3.16k, False: 93]
  ------------------
  423|  3.16k|        if (::toupper(*ai) != ::toupper(*bi)) return false;
  ------------------
  |  Branch (423:13): [True: 10, False: 3.15k]
  ------------------
  424|  3.16k|      }
  425|       |
  426|    113|      if (ai == a.end() && bi == b.end()) return true;
  ------------------
  |  Branch (426:11): [True: 20, False: 93]
  |  Branch (426:11): [True: 0, False: 113]
  |  Branch (426:28): [True: 0, False: 20]
  ------------------
  427|    113|      if ((ai == a.end() && bi != b.end()) ||
  ------------------
  |  Branch (427:11): [True: 20, False: 93]
  |  Branch (427:12): [True: 20, False: 93]
  |  Branch (427:29): [True: 20, False: 0]
  ------------------
  428|     93|          (ai != a.end() && bi == b.end())) return false;
  ------------------
  |  Branch (428:12): [True: 93, False: 0]
  |  Branch (428:29): [True: 0, False: 93]
  ------------------
  429|       |      
  430|     93|      return ::toupper(*ai) == ::toupper(*bi);
  431|    113|    }; //<! case-insensitive comparison with length
_ZN6YaHTTP7Utility18parseUrlParametersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  376|  3.94k|    static strstr_map_t parseUrlParameters(const std::string& parameters) {
  377|  3.94k|      if (parameters.size() > YAHTTP_MAX_REQUEST_LINE_SIZE) {
  ------------------
  |  |    4|  3.94k|#define YAHTTP_MAX_REQUEST_LINE_SIZE 8192
  ------------------
  |  Branch (377:11): [True: 2, False: 3.94k]
  ------------------
  378|      2|        return {};
  379|      2|      }
  380|  3.94k|      std::string::size_type pos = 0;
  381|  3.94k|      strstr_map_t parameter_map;
  382|  18.8k|      while (pos != std::string::npos) {
  ------------------
  |  Branch (382:14): [True: 18.8k, False: 0]
  ------------------
  383|       |        // find next parameter start
  384|  18.8k|        std::string::size_type nextpos = parameters.find('&', pos);
  385|  18.8k|        std::string::size_type delim = parameters.find('=', pos);
  386|  18.8k|        if (delim > nextpos) {
  ------------------
  |  Branch (386:13): [True: 13.2k, False: 5.57k]
  ------------------
  387|  13.2k|          delim = nextpos;
  388|  13.2k|        }
  389|  18.8k|        std::string key;
  390|  18.8k|        std::string value;
  391|  18.8k|        if (delim == std::string::npos) {
  ------------------
  |  Branch (391:13): [True: 3.73k, False: 15.0k]
  ------------------
  392|  3.73k|          key = parameters.substr(pos);
  393|  15.0k|        } else {
  394|  15.0k|          key = parameters.substr(pos, delim-pos);
  395|  15.0k|          if (nextpos == std::string::npos) {
  ------------------
  |  Branch (395:15): [True: 101, False: 14.9k]
  ------------------
  396|    101|            value = parameters.substr(delim+1);
  397|  14.9k|          } else {
  398|  14.9k|            value = parameters.substr(delim+1, nextpos-delim-1);
  399|  14.9k|          }
  400|  15.0k|        }
  401|  18.8k|        if (key.empty()) {
  ------------------
  |  Branch (401:13): [True: 3.27k, False: 15.5k]
  ------------------
  402|       |          // no parameters at all
  403|  3.27k|          break;
  404|  3.27k|        }
  405|  15.5k|        parameter_map[decodeURL(key)] = decodeURL(value);
  406|  15.5k|        if (nextpos == std::string::npos) {
  ------------------
  |  Branch (406:13): [True: 670, False: 14.8k]
  ------------------
  407|       |          // no more parameters left
  408|    670|          break;
  409|    670|        }
  410|  14.8k|        if (parameter_map.size() >= YAHTTP_MAX_REQUEST_FIELDS) {
  ------------------
  |  |    8|  14.8k|#define YAHTTP_MAX_REQUEST_FIELDS 100
  ------------------
  |  Branch (410:13): [True: 4, False: 14.8k]
  ------------------
  411|      4|          break;
  412|      4|        }
  413|       |
  414|  14.8k|        pos = nextpos+1;
  415|  14.8k|      }
  416|  3.94k|      return parameter_map;
  417|  3.94k|    }; //<! parses URL parameters into string map 
_ZN6YaHTTP7Utility8trimLeftERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  438|  27.5k|    static void trimLeft(std::string &str) {
  439|  27.5k|       const std::locale &loc = std::locale::classic();
  440|  27.5k|       std::string::iterator iter = str.begin();
  441|  28.6k|       while(iter != str.end() && YaHTTP::isspace(*iter, loc)) iter++;
  ------------------
  |  Branch (441:14): [True: 7.74k, False: 20.9k]
  |  Branch (441:14): [True: 1.05k, False: 27.5k]
  |  Branch (441:35): [True: 1.05k, False: 6.68k]
  ------------------
  442|  27.5k|       str.erase(str.begin(), iter);
  443|  27.5k|    }; //<! removes whitespace from left
_ZN6YaHTTP7Utility9trimRightERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  445|  27.5k|    static void trimRight(std::string &str) {
  446|  27.5k|       const std::locale &loc = std::locale::classic();
  447|  27.5k|       std::string::reverse_iterator iter = str.rbegin();
  448|  28.7k|       while(iter != str.rend() && YaHTTP::isspace(*iter, loc)) iter++;
  ------------------
  |  Branch (448:14): [True: 7.79k, False: 20.9k]
  |  Branch (448:14): [True: 1.11k, False: 27.5k]
  |  Branch (448:36): [True: 1.11k, False: 6.68k]
  ------------------
  449|  27.5k|       str.erase(iter.base(), str.end());
  450|  27.5k|    }; //<! removes whitespace from right
_ZN6YaHTTP7Utility4trimERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  452|  27.5k|    static void trim(std::string &str) {
  453|  27.5k|       trimLeft(str);
  454|  27.5k|       trimRight(str);
  455|  27.5k|    }; //<! removes whitespace from left and right

LLVMFuzzerTestOneInput:
   30|  4.01k|{
   31|  4.01k|  try {
   32|  4.01k|    YaHTTP::AsyncRequestLoader yarl;
   33|  4.01k|    YaHTTP::Request req;
   34|       |
   35|  4.01k|    yarl.initialize(&req);
   36|  4.01k|    bool finished = yarl.feed(std::string(reinterpret_cast<const char*>(data), size));
   37|  4.01k|    if (finished) {
  ------------------
  |  Branch (37:9): [True: 379, False: 3.63k]
  ------------------
   38|    379|      yarl.finalize();
   39|    379|    }
   40|  4.01k|  }
   41|  4.01k|  catch (const YaHTTP::ParseError& e) {
   42|    620|  }
   43|  4.01k|  catch (const std::exception& e) {
   44|     24|  }
   45|  4.01k|  catch (...) {
   46|      0|  }
   47|       |
   48|  4.01k|  return 0;
   49|  4.01k|}

