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

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

_ZN6YaHTTP7isspaceEc:
   10|  1.16M|  bool isspace(char c) {
   11|  1.16M|    return std::isspace(c) != 0;
   12|  1.16M|  }
_ZN6YaHTTP7isspaceEcRKNSt3__16localeE:
   14|  14.8k|  bool isspace(char c, const std::locale& loc) {
   15|  14.8k|    return std::isspace(c, loc);
   16|  14.8k|  }
_ZN6YaHTTP11AsyncLoaderINS_7RequestEE4feedERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
   44|  3.99k|  {
   45|  3.99k|    if (state < 2) {
  ------------------
  |  Branch (45:9): [True: 3.99k, False: 0]
  ------------------
   46|  3.99k|      headersize += somedata.length(); // maye include some body data, we don't know yet...
   47|  3.99k|      if (headersize > target->max_header_size) {
  ------------------
  |  Branch (47:11): [True: 45, False: 3.94k]
  ------------------
   48|     45|        if (target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|     45|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (48:13): [True: 45, False: 0]
  ------------------
   49|     45|          throw ParseError("Request header too large");
   50|     45|        }
   51|      0|        else {
   52|      0|          throw ParseError("Response header too large");
   53|      0|        }
   54|     45|      }
   55|  3.99k|    }
   56|  3.94k|    buffer.append(somedata);
   57|  33.8k|    while(state < 2) {
  ------------------
  |  Branch (57:11): [True: 33.7k, False: 115]
  ------------------
   58|  33.7k|      int cr=0;
   59|  33.7k|      pos = buffer.find_first_of("\n");
   60|       |      // need to find CRLF in buffer
   61|  33.7k|      if (pos == std::string::npos) return false;
  ------------------
  |  Branch (61:11): [True: 2.72k, False: 31.0k]
  ------------------
   62|  31.0k|      if (pos>0 && buffer[pos-1]=='\r')
  ------------------
  |  Branch (62:11): [True: 27.8k, False: 3.14k]
  |  Branch (62:20): [True: 213, False: 27.6k]
  ------------------
   63|    213|        cr=1;
   64|  31.0k|      std::string line(buffer.begin(), buffer.begin()+pos-cr); // exclude CRLF
   65|  31.0k|      buffer.erase(buffer.begin(), buffer.begin()+pos+1); // remove line from buffer including CRLF
   66|       |
   67|  31.0k|      if (state == 0) { // startup line
  ------------------
  |  Branch (67:11): [True: 3.93k, False: 27.0k]
  ------------------
   68|  3.93k|        if (target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|  3.93k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (68:13): [True: 3.93k, False: 0]
  ------------------
   69|  3.93k|          std::string ver;
   70|  3.93k|          std::string tmpurl;
   71|  3.93k|          std::istringstream iss(line);
   72|  3.93k|          iss >> target->method >> tmpurl >> ver;
   73|  3.93k|          if (ver.size() == 0)
  ------------------
  |  Branch (73:15): [True: 3.85k, False: 72]
  ------------------
   74|  3.85k|            target->version = 9;
   75|     72|          else if (ver.find("HTTP/0.9") == 0)
  ------------------
  |  Branch (75:20): [True: 1, False: 71]
  ------------------
   76|      1|            target->version = 9;
   77|     71|          else if (ver.find("HTTP/1.0") == 0)
  ------------------
  |  Branch (77:20): [True: 1, False: 70]
  ------------------
   78|      1|            target->version = 10;
   79|     70|          else if (ver.find("HTTP/1.1") == 0)
  ------------------
  |  Branch (79:20): [True: 3, False: 67]
  ------------------
   80|      3|            target->version = 11;
   81|     67|          else
   82|     67|            throw ParseError("HTTP version not supported");
   83|       |          // uppercase the target method
   84|  3.86k|          std::transform(target->method.begin(), target->method.end(), target->method.begin(), ::toupper);
   85|  3.86k|          target->url.parse(tmpurl);
   86|  3.86k|          target->getvars = Utility::parseUrlParameters(target->url.parameters);
   87|  3.86k|          state = 1;
   88|  3.86k|        } 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|  27.0k|      } else if (state == 1) {
  ------------------
  |  Branch (112:18): [True: 27.0k, False: 0]
  ------------------
  113|  27.0k|        std::string key,value;
  114|  27.0k|        size_t pos1;
  115|  27.0k|        if (line.empty()) {
  ------------------
  |  Branch (115:13): [True: 1.00k, False: 26.0k]
  ------------------
  116|  1.00k|          chunked = (target->headers.find("transfer-encoding") != target->headers.end() && target->headers["transfer-encoding"] == "chunked");
  ------------------
  |  Branch (116:22): [True: 462, False: 544]
  |  Branch (116:92): [True: 438, False: 24]
  ------------------
  117|  1.00k|          state = 2;
  118|  1.00k|          break;
  119|  1.00k|        }
  120|       |        // split headers
  121|  26.0k|        if ((pos1 = line.find(':')) == std::string::npos) {
  ------------------
  |  Branch (121:13): [True: 21, False: 26.0k]
  ------------------
  122|     21|          throw ParseError("Malformed header line");
  123|     21|        }
  124|  26.0k|        key = line.substr(0, pos1);
  125|  26.0k|        value = line.substr(pos1 + 1);
  126|  1.19M|        for(std::string::iterator it=key.begin(); it != key.end(); it++)
  ------------------
  |  Branch (126:51): [True: 1.16M, False: 26.0k]
  ------------------
  127|  1.16M|          if (YaHTTP::isspace(*it))
  ------------------
  |  Branch (127:15): [True: 13, False: 1.16M]
  ------------------
  128|     13|            throw ParseError("Header key contains whitespace which is not allowed by RFC");
  129|       |
  130|  26.0k|        Utility::trim(value);
  131|  26.0k|        std::transform(key.begin(), key.end(), key.begin(), ::tolower);
  132|       |        // is it already defined
  133|       |
  134|  26.0k|        if (key == "set-cookie" && target->kind == YAHTTP_TYPE_RESPONSE) {
  ------------------
  |  |   36|    293|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (134:13): [True: 293, False: 25.7k]
  |  Branch (134:36): [True: 0, False: 293]
  ------------------
  135|      0|          target->jar.parseSetCookieHeader(value);
  136|  26.0k|        } else if (key == "cookie" && target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|  2.21k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (136:20): [True: 2.21k, False: 23.8k]
  |  Branch (136:39): [True: 2.21k, False: 0]
  ------------------
  137|  2.21k|          target->jar.parseCookieHeader(value);
  138|  23.8k|        } else {
  139|  23.8k|          if (key == "host" && target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|  2.03k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (139:15): [True: 2.03k, False: 21.7k]
  |  Branch (139:32): [True: 2.03k, False: 0]
  ------------------
  140|       |            // maybe it contains port?
  141|  2.03k|            if ((pos1 = value.find(':')) == std::string::npos) {
  ------------------
  |  Branch (141:17): [True: 364, False: 1.66k]
  ------------------
  142|    364|              target->url.host = value;
  143|  1.66k|            } else {
  144|  1.66k|              target->url.host = value.substr(0, pos1);
  145|  1.66k|              target->url.port = ::atoi(value.substr(pos1).c_str());
  146|  1.66k|            }
  147|  2.03k|          }
  148|  23.8k|          if (target->headers.find(key) != target->headers.end()) {
  ------------------
  |  Branch (148:15): [True: 11.7k, False: 12.0k]
  ------------------
  149|  11.7k|            target->headers[key] = target->headers[key] + ";" + value;
  150|  12.0k|          } else {
  151|  12.0k|            target->headers[key] = std::move(value);
  152|  12.0k|          }
  153|  23.8k|        }
  154|  26.0k|      }
  155|  31.0k|    }
  156|       |
  157|  1.12k|    minbody = 0;
  158|       |    // check for expected body size
  159|  1.12k|    if (target->kind == YAHTTP_TYPE_REQUEST) maxbody = target->max_request_size;
  ------------------
  |  |   35|  1.12k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (159:9): [True: 1.00k, False: 115]
  ------------------
  160|    115|    else if (target->kind == YAHTTP_TYPE_RESPONSE) maxbody = target->max_response_size;
  ------------------
  |  |   36|    115|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (160:14): [True: 0, False: 115]
  ------------------
  161|    115|    else maxbody = 0;
  162|       |
  163|  1.12k|    if (!chunked) {
  ------------------
  |  Branch (163:9): [True: 568, False: 553]
  ------------------
  164|    568|      if (target->headers.find("content-length") != target->headers.end()) {
  ------------------
  |  Branch (164:11): [True: 369, False: 199]
  ------------------
  165|    369|        std::istringstream maxbodyS(target->headers["content-length"]);
  166|    369|        maxbodyS >> minbody;
  167|    369|        maxbody = minbody;
  168|    369|      }
  169|    568|      if (minbody < 1) return true; // guess there isn't anything left.
  ------------------
  |  Branch (169:11): [True: 206, False: 362]
  ------------------
  170|    362|      if (target->kind == YAHTTP_TYPE_REQUEST && minbody > target->max_request_size) throw ParseError("Max request body size exceeded");
  ------------------
  |  |   35|    724|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (170:11): [True: 362, False: 0]
  |  Branch (170:50): [True: 148, False: 214]
  ------------------
  171|    214|      else if (target->kind == YAHTTP_TYPE_RESPONSE && minbody > target->max_response_size) throw ParseError("Max response body size exceeded");
  ------------------
  |  |   36|    428|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (171:16): [True: 0, False: 214]
  |  Branch (171:56): [True: 0, False: 0]
  ------------------
  172|    362|    }
  173|       |
  174|    767|    if (maxbody == 0) hasBody = false;
  ------------------
  |  Branch (174:9): [True: 0, False: 767]
  ------------------
  175|    767|    else hasBody = true;
  176|       |
  177|    767|    if (buffer.size() == 0) return ready();
  ------------------
  |  Branch (177:9): [True: 25, False: 742]
  ------------------
  178|       |
  179|  4.06k|    while(buffer.size() > 0) {
  ------------------
  |  Branch (179:11): [True: 3.73k, False: 336]
  ------------------
  180|  3.73k|      if (chunked) {
  ------------------
  |  Branch (180:11): [True: 3.54k, False: 190]
  ------------------
  181|  3.54k|        if (chunk_size == 0) {
  ------------------
  |  Branch (181:13): [True: 1.91k, False: 1.62k]
  ------------------
  182|  1.91k|          char buf[100];
  183|       |          // read chunk length
  184|  1.91k|          if ((pos = buffer.find('\n')) == std::string::npos) {
  ------------------
  |  Branch (184:15): [True: 35, False: 1.88k]
  ------------------
  185|     35|            if (buffer.size() > 99) {
  ------------------
  |  Branch (185:17): [True: 10, False: 25]
  ------------------
  186|     10|              throw ParseError("Nonsensical chunk_size");
  187|     10|            }
  188|     25|            return false;
  189|     35|          }
  190|  1.88k|          if (pos > 99)
  ------------------
  |  Branch (190:15): [True: 29, False: 1.85k]
  ------------------
  191|     29|            throw ParseError("Impossible chunk_size");
  192|  1.85k|          buffer.copy(buf, pos);
  193|  1.85k|          buf[pos]=0; // just in case...
  194|  1.85k|          buffer.erase(buffer.begin(), buffer.begin()+pos+1); // remove line from buffer
  195|  1.85k|          if (sscanf(buf, "%zx", &chunk_size) != 1) {
  ------------------
  |  Branch (195:15): [True: 31, False: 1.82k]
  ------------------
  196|     31|            throw ParseError("Unable to parse chunk size");
  197|     31|          }
  198|  1.82k|          if (chunk_size == 0) { state = 3; break; } // last chunk
  ------------------
  |  Branch (198:15): [True: 3, False: 1.81k]
  ------------------
  199|  1.81k|          if (chunk_size > (std::numeric_limits<decltype(chunk_size)>::max() - 2) || chunk_size > maxbody) {
  ------------------
  |  Branch (199:15): [True: 5, False: 1.81k]
  |  Branch (199:86): [True: 158, False: 1.65k]
  ------------------
  200|    163|            throw ParseError("Chunk is too large");
  201|    163|          }
  202|  1.81k|        } else {
  203|  1.62k|          int crlf=1;
  204|  1.62k|          if (buffer.size() < chunk_size+1) return false; // expect newline
  ------------------
  |  Branch (204:15): [True: 36, False: 1.58k]
  ------------------
  205|  1.58k|          if (buffer.at(chunk_size) == '\r') {
  ------------------
  |  Branch (205:15): [True: 445, False: 1.14k]
  ------------------
  206|    445|            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: 441]
  |  Branch (206:49): [True: 20, False: 421]
  ------------------
  207|    421|            crlf=2;
  208|  1.14k|          } else if (buffer.at(chunk_size) != '\n') return false;
  ------------------
  |  Branch (208:22): [True: 22, False: 1.12k]
  ------------------
  209|  1.54k|          if (bodysize + chunk_size > maxbody) {
  ------------------
  |  Branch (209:15): [True: 0, False: 1.54k]
  ------------------
  210|      0|            throw ParseError("Chunked body is too large");
  211|      0|          }
  212|  1.54k|          std::string tmp = buffer.substr(0, chunk_size);
  213|  1.54k|          buffer.erase(buffer.begin(), buffer.begin()+chunk_size+crlf);
  214|  1.54k|          bodybuf << tmp;
  215|  1.54k|          bodysize += chunk_size;
  216|  1.54k|          chunk_size = 0;
  217|  1.54k|          if (buffer.size() == 0) break; // just in case
  ------------------
  |  Branch (217:15): [True: 63, False: 1.48k]
  ------------------
  218|  1.54k|        }
  219|  3.54k|      } else {
  220|    190|        if (bodysize + buffer.length() > maxbody) {
  ------------------
  |  Branch (220:13): [True: 91, False: 99]
  ------------------
  221|     91|          bodybuf << buffer.substr(0, maxbody - bodybuf.str().length());
  222|     91|          bodysize = maxbody;
  223|     91|        }
  224|     99|        else {
  225|     99|          bodybuf << buffer;
  226|     99|          bodysize += buffer.length();
  227|     99|        }
  228|    190|        buffer = "";
  229|    190|      }
  230|  3.73k|    }
  231|       |
  232|    402|    if (chunk_size!=0) return false; // need more data
  ------------------
  |  Branch (232:9): [True: 31, False: 371]
  ------------------
  233|       |
  234|    371|    return ready();
  235|    402|  };

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

_ZN6YaHTTP3URLC2Ev:
  166|  3.99k|      URL() { initialize(); }; //<! construct empty url
_ZN6YaHTTP3URL10initializeEv:
  116|  19.8k|      void initialize() {
  117|  19.8k|        protocol = ""; host = ""; port = 0; username = ""; password = ""; path = ""; parameters = ""; anchor =""; pathless = true;
  118|  19.8k|      }; //<! initialize to empty URL
_ZN6YaHTTP3URLC2EPKc:
  171|  11.9k|      URL(const char *url) {
  172|  11.9k|        parse(std::string(url));
  173|  11.9k|      }; //<! calls parse with url
_ZN6YaHTTP3URL5parseERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  175|  15.8k|      bool parse(const std::string& url) {
  176|       |        // setup
  177|  15.8k|        initialize();
  178|       |
  179|  15.8k|        if (url.size() > YAHTTP_MAX_URL_LENGTH) return false;
  ------------------
  |  |    8|  15.8k|#define YAHTTP_MAX_URL_LENGTH 2048
  ------------------
  |  Branch (179:13): [True: 13, False: 15.8k]
  ------------------
  180|  15.8k|        size_t pos = 0;
  181|  15.8k|        if (*(url.begin()) != '/') { // full url?
  ------------------
  |  Branch (181:13): [True: 15.6k, False: 226]
  ------------------
  182|  15.6k|          if (parseSchema(url, pos) == false) return false;
  ------------------
  |  Branch (182:15): [True: 14.3k, False: 1.30k]
  ------------------
  183|  1.30k|          if (pathless) {
  ------------------
  |  Branch (183:15): [True: 756, False: 544]
  ------------------
  184|    756|            parameters = url.substr(pos);
  185|    756|            return true;
  186|    756|          }
  187|    544|          if (parseUserPass(url, pos) == false) return false;
  ------------------
  |  Branch (187:15): [True: 0, False: 544]
  ------------------
  188|    544|          if (parseHost(url, pos) == false) return false;
  ------------------
  |  Branch (188:15): [True: 22, False: 522]
  ------------------
  189|    544|        }
  190|    748|        if (parsePath(url, pos) == false) return false;
  ------------------
  |  Branch (190:13): [True: 0, False: 748]
  ------------------
  191|    748|        if (parseParameters(url, pos) == false) return false;
  ------------------
  |  Branch (191:13): [True: 0, False: 748]
  ------------------
  192|    748|        return parseAnchor(url, pos);
  193|    748|    }; //<! 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.6k|      bool parseSchema(const std::string& url, size_t &pos) {
   16|  15.6k|          size_t pos1;
   17|  15.6k|          if (pos >= url.size()) return false; // no data
  ------------------
  |  Branch (17:15): [True: 14.2k, 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: 31, 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.29k]
  ------------------
   21|  1.30k|          if (protocol == "https") port = 443;
  ------------------
  |  Branch (21:15): [True: 1, False: 1.29k]
  ------------------
   22|  1.30k|          pos = pos1+1; // after :
   23|  1.30k|          if (url.compare(pos, 2, "//") == 0) {
  ------------------
  |  Branch (23:15): [True: 544, False: 756]
  ------------------
   24|    544|             pathless = false; // if this is true we put rest into parameters
   25|    544|             pos += 2;
   26|    544|          }
   27|  1.30k|          return true;
   28|  1.33k|      }; //<! parse schema/protocol part 
_ZN6YaHTTP3URL13parseUserPassERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   60|    544|      bool parseUserPass(const std::string& url, size_t &pos) {
   61|    544|          size_t pos1,pos2;
   62|    544|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (62:15): [True: 1, False: 543]
  ------------------
   63|       |
   64|    543|          if ( (pos1 = url.find_first_of("@",pos)) == std::string::npos ) return true; // no userinfo
  ------------------
  |  Branch (64:16): [True: 333, False: 210]
  ------------------
   65|    210|          pos2 = url.find_first_of(":",pos);
   66|       |
   67|    210|          if (pos2 != std::string::npos) { // comes with password
  ------------------
  |  Branch (67:15): [True: 121, False: 89]
  ------------------
   68|    121|             username = url.substr(pos, pos2 - pos);
   69|    121|             password = url.substr(pos2+1, pos1 - pos2 - 1);
   70|    121|             password = Utility::decodeURL(password);
   71|    121|          } else {
   72|     89|             username = url.substr(pos, pos1 - pos);
   73|     89|          }
   74|    210|          pos = pos1+1;
   75|    210|          username = Utility::decodeURL(username);
   76|    210|          return true;
   77|    543|      }; //<! parse possible username and password
_ZN6YaHTTP3URL9parseHostERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   30|    544|      bool parseHost(const std::string& url, size_t &pos) {
   31|    544|          size_t pos1;
   32|    544|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (32:15): [True: 70, False: 474]
  ------------------
   33|    474|          if ( (pos1 = url.find_first_of("/", pos)) == std::string::npos ) {
  ------------------
  |  Branch (33:16): [True: 327, False: 147]
  ------------------
   34|    327|             host = url.substr(pos);
   35|    327|             path = "/";
   36|    327|             pos = url.size();
   37|    327|          } else {
   38|    147|             host = url.substr(pos, pos1-pos);
   39|    147|             pos = pos1;
   40|    147|          }
   41|    474|          if (host.at(0) == '[') { // IPv6
  ------------------
  |  Branch (41:15): [True: 159, False: 315]
  ------------------
   42|    159|            if ((pos1 = host.find_first_of("]")) == std::string::npos) {
  ------------------
  |  Branch (42:17): [True: 22, False: 137]
  ------------------
   43|       |              // incomplete address
   44|     22|              return false;
   45|     22|            }
   46|    137|            size_t pos2;
   47|    137|            if ((pos2 = host.find_first_of(":", pos1)) != std::string::npos) {
  ------------------
  |  Branch (47:17): [True: 72, False: 65]
  ------------------
   48|     72|              std::istringstream tmp(host.substr(pos2 + 1));
   49|     72|              tmp >> port;
   50|     72|            }
   51|    137|            host = host.substr(1, pos1 - 1);
   52|    315|          } else if ( (pos1 = host.find_first_of(":")) != std::string::npos ) {
  ------------------
  |  Branch (52:23): [True: 164, False: 151]
  ------------------
   53|    164|             std::istringstream tmp(host.substr(pos1+1));
   54|    164|             tmp >> port;
   55|    164|             host = host.substr(0, pos1);
   56|    164|          }
   57|    452|          return true;
   58|    474|      }; //<! parse host and port
_ZN6YaHTTP3URL9parsePathERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   79|    724|      bool parsePath(const std::string& url, size_t &pos) {
   80|    724|          size_t pos1;
   81|    724|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (81:15): [True: 379, False: 345]
  ------------------
   82|    345|          if (url[pos] != '/') return false; // not an url
  ------------------
  |  Branch (82:15): [True: 0, False: 345]
  ------------------
   83|    345|          if ( (pos1 = url.find_first_of("?", pos)) == std::string::npos ) {
  ------------------
  |  Branch (83:16): [True: 123, False: 222]
  ------------------
   84|    123|             path = url.substr(pos);
   85|    123|             pos = url.size();
   86|    222|          } else {
   87|    222|             path = url.substr(pos, pos1-pos);
   88|    222|             pos = pos1;
   89|    222|          }
   90|    345|          return true;
   91|    345|      }; //<! parse path component
_ZN6YaHTTP3URL15parseParametersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   93|    724|      bool parseParameters(const std::string& url, size_t &pos) {
   94|    724|          size_t pos1;
   95|    724|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (95:15): [True: 502, False: 222]
  ------------------
   96|    222|          if (url[pos] == '#') return true; // anchor starts here
  ------------------
  |  Branch (96:15): [True: 0, False: 222]
  ------------------
   97|    222|          if (url[pos] != '?') return false; // not a parameter
  ------------------
  |  Branch (97:15): [True: 0, False: 222]
  ------------------
   98|    222|          if ( (pos1 = url.find_first_of("#", pos)) == std::string::npos ) {
  ------------------
  |  Branch (98:16): [True: 127, False: 95]
  ------------------
   99|    127|             parameters = url.substr(pos+1);;
  100|    127|             pos = url.size();
  101|    127|          } else {
  102|     95|             parameters = url.substr(pos+1, pos1-pos-1);
  103|     95|             pos = pos1;
  104|     95|          }
  105|    222|          if (parameters.size()>0 && *(parameters.end()-1) == '&') parameters.resize(parameters.size()-1);
  ------------------
  |  Branch (105:15): [True: 143, False: 79]
  |  Branch (105:15): [True: 6, False: 216]
  |  Branch (105:38): [True: 6, False: 137]
  ------------------
  106|    222|          return true;
  107|    222|      }; //<! parse url parameters
_ZN6YaHTTP3URL11parseAnchorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
  109|    724|      bool parseAnchor(const std::string& url, size_t &pos) {
  110|    724|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (110:15): [True: 629, False: 95]
  ------------------
  111|     95|          if (url[pos] != '#') return false; // not anchor
  ------------------
  |  Branch (111:15): [True: 0, False: 95]
  ------------------
  112|     95|          anchor = url.substr(pos+1);
  113|     95|          return true;
  114|     95|      }; //<! parse anchor

_ZN6YaHTTP7Utility9decodeURLERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  229|   191k|    static std::string decodeURL(const std::string& component) {
  230|   191k|        std::string result = component;
  231|   191k|        size_t pos1,pos2;
  232|   191k|        pos2 = 0;
  233|   579k|        while((pos1 = result.find_first_of("%", pos2))!=std::string::npos) {
  ------------------
  |  Branch (233:15): [True: 392k, False: 186k]
  ------------------
  234|   392k|           std::string code;
  235|   392k|           char a,b,c;
  236|   392k|           if (pos1 + 2 > result.length()) return result; // end of result
  ------------------
  |  Branch (236:16): [True: 4.96k, False: 387k]
  ------------------
  237|   387k|           code = result.substr(pos1+1, 2);
  238|   387k|           a = std::tolower(code[0]); b = std::tolower(code[1]);
  239|       |
  240|   387k|           if ((( '0' > a || a > '9') && ('a' > a || a > 'f')) ||
  ------------------
  |  Branch (240:19): [True: 150k, False: 236k]
  |  Branch (240:30): [True: 186k, False: 50.1k]
  |  Branch (240:43): [True: 179k, False: 157k]
  |  Branch (240:54): [True: 46.9k, False: 110k]
  ------------------
  241|   316k|              (( '0' > b || b > '9') && ('a' > b || b > 'f'))) {
  ------------------
  |  Branch (241:18): [True: 53.3k, False: 107k]
  |  Branch (241:29): [True: 101k, False: 6.69k]
  |  Branch (241:42): [True: 84.0k, False: 70.3k]
  |  Branch (241:53): [True: 6.11k, False: 64.2k]
  ------------------
  242|   316k|              pos2 = pos1+3;
  243|   316k|              continue;
  244|   316k|           }
  245|       |
  246|  70.9k|           if ('0' <= a && a <= '9') a = a - '0';
  ------------------
  |  Branch (246:16): [True: 70.9k, False: 0]
  |  Branch (246:28): [True: 6.42k, False: 64.5k]
  ------------------
  247|  64.5k|           else if ('a' <= a && a <= 'f') a = a - 'a' + 0x0a;
  ------------------
  |  Branch (247:21): [True: 64.5k, False: 0]
  |  Branch (247:33): [True: 64.5k, False: 0]
  ------------------
  248|  70.9k|           if ('0' <= b && b <= '9') b = b - '0';
  ------------------
  |  Branch (248:16): [True: 70.9k, False: 0]
  |  Branch (248:28): [True: 6.69k, False: 64.2k]
  ------------------
  249|  64.2k|           else if ('a' <= b && b <= 'f') b = b - 'a' + 0x0a;
  ------------------
  |  Branch (249:21): [True: 64.2k, False: 0]
  |  Branch (249:33): [True: 64.2k, False: 0]
  ------------------
  250|       |
  251|  70.9k|           c = (a<<4)+b;
  252|  70.9k|           result = result.replace(pos1,3,1,c);
  253|  70.9k|           pos2=pos1;
  254|  70.9k|        }
  255|   186k|        return result;
  256|   191k|    }; //<! Decodes %xx from string into bytes
_ZN6YaHTTP8DateTimeC2Ev:
   57|  92.7k|     DateTime() { 
   58|  92.7k|       initialize();
   59|  92.7k|     }; //<! Construct and initialize
_ZN6YaHTTP8DateTime10initializeEv:
   61|  92.7k|     void initialize() {
   62|  92.7k|       isSet = false; 
   63|  92.7k|       year = month = day = wday = hours = minutes = seconds = utc_offset = 0;
   64|  92.7k|       month = 1; // it's invalid otherwise
   65|  92.7k|     }; //<! Creates year 0 date
_ZNK6YaHTTP25ASCIICINullSafeComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
   26|   676k|    bool operator() (const std::string& lhs, const std::string& rhs) const {
   27|   676k|      int v;
   28|   676k|      std::string::const_iterator lhi = lhs.begin();
   29|   676k|      std::string::const_iterator rhi = rhs.begin();
   30|  1.48M|      for(;lhi != lhs.end() && rhi != rhs.end(); lhi++, rhi++)
  ------------------
  |  Branch (30:12): [True: 1.16M, False: 312k]
  |  Branch (30:12): [True: 1.15M, False: 323k]
  |  Branch (30:32): [True: 1.15M, False: 11.5k]
  ------------------
   31|  1.15M|        if ((v = ::tolower(*lhi) - ::tolower(*rhi)) != 0) return v<0; 
  ------------------
  |  Branch (31:13): [True: 352k, False: 805k]
  ------------------
   32|   323k|      if (lhi == lhs.end() && rhi != rhs.end()) return true;
  ------------------
  |  Branch (32:11): [True: 312k, False: 11.5k]
  |  Branch (32:11): [True: 86.3k, False: 237k]
  |  Branch (32:31): [True: 86.3k, False: 226k]
  ------------------
   33|   237k|      if (lhi != lhs.end() && rhi == rhs.end()) return false;
  ------------------
  |  Branch (33:11): [True: 11.5k, False: 226k]
  |  Branch (33:11): [True: 11.5k, False: 226k]
  |  Branch (33:31): [True: 11.5k, False: 0]
  ------------------
   34|   226k|      return false; // they are equal
   35|   237k|    }
_ZN6YaHTTP7Utility7iequalsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_m:
  419|    124|    static bool iequals(const std::string& a, const std::string& b, size_t length) {
  420|    124|      std::string::const_iterator ai, bi;
  421|    124|      size_t i;
  422|  3.34k|      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.32k, False: 19]
  |  Branch (422:50): [True: 3.23k, False: 114]
  |  Branch (422:67): [True: 3.32k, False: 0]
  |  Branch (422:84): [True: 3.23k, False: 95]
  ------------------
  423|  3.23k|        if (::toupper(*ai) != ::toupper(*bi)) return false;
  ------------------
  |  Branch (423:13): [True: 10, False: 3.22k]
  ------------------
  424|  3.23k|      }
  425|       |
  426|    114|      if (ai == a.end() && bi == b.end()) return true;
  ------------------
  |  Branch (426:11): [True: 19, False: 95]
  |  Branch (426:11): [True: 0, False: 114]
  |  Branch (426:28): [True: 0, False: 19]
  ------------------
  427|    114|      if ((ai == a.end() && bi != b.end()) ||
  ------------------
  |  Branch (427:11): [True: 19, False: 95]
  |  Branch (427:12): [True: 19, False: 95]
  |  Branch (427:29): [True: 19, False: 0]
  ------------------
  428|     95|          (ai != a.end() && bi == b.end())) return false;
  ------------------
  |  Branch (428:12): [True: 95, False: 0]
  |  Branch (428:29): [True: 0, False: 95]
  ------------------
  429|       |      
  430|     95|      return ::toupper(*ai) == ::toupper(*bi);
  431|    114|    }; //<! case-insensitive comparison with length
_ZN6YaHTTP7Utility18parseUrlParametersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  376|  3.92k|    static strstr_map_t parseUrlParameters(const std::string& parameters) {
  377|  3.92k|      if (parameters.size() > YAHTTP_MAX_REQUEST_LINE_SIZE) {
  ------------------
  |  |    4|  3.92k|#define YAHTTP_MAX_REQUEST_LINE_SIZE 8192
  ------------------
  |  Branch (377:11): [True: 2, False: 3.92k]
  ------------------
  378|      2|        return {};
  379|      2|      }
  380|  3.92k|      std::string::size_type pos = 0;
  381|  3.92k|      strstr_map_t parameter_map;
  382|  19.3k|      while (pos != std::string::npos) {
  ------------------
  |  Branch (382:14): [True: 19.3k, False: 0]
  ------------------
  383|       |        // find next parameter start
  384|  19.3k|        std::string::size_type nextpos = parameters.find('&', pos);
  385|  19.3k|        std::string::size_type delim = parameters.find('=', pos);
  386|  19.3k|        if (delim > nextpos) {
  ------------------
  |  Branch (386:13): [True: 13.8k, False: 5.49k]
  ------------------
  387|  13.8k|          delim = nextpos;
  388|  13.8k|        }
  389|  19.3k|        std::string key;
  390|  19.3k|        std::string value;
  391|  19.3k|        if (delim == std::string::npos) {
  ------------------
  |  Branch (391:13): [True: 3.71k, False: 15.6k]
  ------------------
  392|  3.71k|          key = parameters.substr(pos);
  393|  15.6k|        } else {
  394|  15.6k|          key = parameters.substr(pos, delim-pos);
  395|  15.6k|          if (nextpos == std::string::npos) {
  ------------------
  |  Branch (395:15): [True: 107, False: 15.5k]
  ------------------
  396|    107|            value = parameters.substr(delim+1);
  397|  15.5k|          } else {
  398|  15.5k|            value = parameters.substr(delim+1, nextpos-delim-1);
  399|  15.5k|          }
  400|  15.6k|        }
  401|  19.3k|        if (key.empty()) {
  ------------------
  |  Branch (401:13): [True: 3.23k, False: 16.1k]
  ------------------
  402|       |          // no parameters at all
  403|  3.23k|          break;
  404|  3.23k|        }
  405|  16.1k|        parameter_map[decodeURL(key)] = decodeURL(value);
  406|  16.1k|        if (nextpos == std::string::npos) {
  ------------------
  |  Branch (406:13): [True: 680, False: 15.4k]
  ------------------
  407|       |          // no more parameters left
  408|    680|          break;
  409|    680|        }
  410|  15.4k|        if (parameter_map.size() >= YAHTTP_MAX_REQUEST_FIELDS) {
  ------------------
  |  |    8|  15.4k|#define YAHTTP_MAX_REQUEST_FIELDS 100
  ------------------
  |  Branch (410:13): [True: 4, False: 15.4k]
  ------------------
  411|      4|          break;
  412|      4|        }
  413|       |
  414|  15.4k|        pos = nextpos+1;
  415|  15.4k|      }
  416|  3.92k|      return parameter_map;
  417|  3.92k|    }; //<! parses URL parameters into string map 
_ZN6YaHTTP7Utility8trimLeftERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  438|  26.0k|    static void trimLeft(std::string &str) {
  439|  26.0k|       const std::locale &loc = std::locale::classic();
  440|  26.0k|       std::string::iterator iter = str.begin();
  441|  27.0k|       while(iter != str.end() && YaHTTP::isspace(*iter, loc)) iter++;
  ------------------
  |  Branch (441:14): [True: 7.35k, False: 19.6k]
  |  Branch (441:14): [True: 1.00k, False: 26.0k]
  |  Branch (441:35): [True: 1.00k, False: 6.34k]
  ------------------
  442|  26.0k|       str.erase(str.begin(), iter);
  443|  26.0k|    }; //<! removes whitespace from left
_ZN6YaHTTP7Utility9trimRightERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  445|  26.0k|    static void trimRight(std::string &str) {
  446|  26.0k|       const std::locale &loc = std::locale::classic();
  447|  26.0k|       std::string::reverse_iterator iter = str.rbegin();
  448|  27.1k|       while(iter != str.rend() && YaHTTP::isspace(*iter, loc)) iter++;
  ------------------
  |  Branch (448:14): [True: 7.45k, False: 19.6k]
  |  Branch (448:14): [True: 1.10k, False: 26.0k]
  |  Branch (448:36): [True: 1.10k, False: 6.34k]
  ------------------
  449|  26.0k|       str.erase(iter.base(), str.end());
  450|  26.0k|    }; //<! removes whitespace from right
_ZN6YaHTTP7Utility4trimERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  452|  26.0k|    static void trim(std::string &str) {
  453|  26.0k|       trimLeft(str);
  454|  26.0k|       trimRight(str);
  455|  26.0k|    }; //<! removes whitespace from left and right

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

