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

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

_ZN6YaHTTP7isspaceEc:
   10|  1.12M|  bool isspace(char c) {
   11|  1.12M|    return std::isspace(c) != 0;
   12|  1.12M|  }
_ZN6YaHTTP7isspaceEcRKNSt3__16localeE:
   14|  17.2k|  bool isspace(char c, const std::locale& loc) {
   15|  17.2k|    return std::isspace(c, loc);
   16|  17.2k|  }
_ZN6YaHTTP11AsyncLoaderINS_7RequestEE4feedERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
   44|  4.04k|  {
   45|  4.04k|    if (state < 2) {
  ------------------
  |  Branch (45:9): [True: 4.04k, False: 0]
  ------------------
   46|  4.04k|      headersize += somedata.length(); // maye include some body data, we don't know yet...
   47|  4.04k|      if (headersize > target->max_header_size) {
  ------------------
  |  Branch (47:11): [True: 45, False: 3.99k]
  ------------------
   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|  4.04k|    }
   56|  3.99k|    buffer.append(somedata);
   57|  35.4k|    while(state < 2) {
  ------------------
  |  Branch (57:11): [True: 35.2k, False: 126]
  ------------------
   58|  35.2k|      int cr=0;
   59|  35.2k|      pos = buffer.find_first_of("\n");
   60|       |      // need to find CRLF in buffer
   61|  35.2k|      if (pos == std::string::npos) return false;
  ------------------
  |  Branch (61:11): [True: 2.75k, False: 32.5k]
  ------------------
   62|  32.5k|      if (pos>0 && buffer[pos-1]=='\r')
  ------------------
  |  Branch (62:11): [True: 29.3k, False: 3.23k]
  |  Branch (62:20): [True: 218, False: 29.0k]
  ------------------
   63|    218|        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.97k, False: 28.5k]
  ------------------
   68|  3.97k|        if (target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|  3.97k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (68:13): [True: 3.97k, False: 0]
  ------------------
   69|  3.97k|          std::string ver;
   70|  3.97k|          std::string tmpurl;
   71|  3.97k|          std::istringstream iss(line);
   72|  3.97k|          iss >> target->method >> tmpurl >> ver;
   73|  3.97k|          if (ver.size() == 0)
  ------------------
  |  Branch (73:15): [True: 3.90k, False: 72]
  ------------------
   74|  3.90k|            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: 2, False: 68]
  ------------------
   80|      2|            target->version = 11;
   81|     68|          else
   82|     68|            throw ParseError("HTTP version not supported");
   83|       |          // uppercase the target method
   84|  3.91k|          std::transform(target->method.begin(), target->method.end(), target->method.begin(), ::toupper);
   85|  3.91k|          target->url.parse(tmpurl);
   86|  3.91k|          target->getvars = Utility::parseUrlParameters(target->url.parameters);
   87|  3.91k|          state = 1;
   88|  3.91k|        } 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.5k|      } else if (state == 1) {
  ------------------
  |  Branch (112:18): [True: 28.5k, False: 0]
  ------------------
  113|  28.5k|        std::string key,value;
  114|  28.5k|        size_t pos1;
  115|  28.5k|        if (line.empty()) {
  ------------------
  |  Branch (115:13): [True: 1.01k, False: 27.5k]
  ------------------
  116|  1.01k|          chunked = (target->headers.find("transfer-encoding") != target->headers.end() && target->headers["transfer-encoding"] == "chunked");
  ------------------
  |  Branch (116:22): [True: 462, False: 556]
  |  Branch (116:92): [True: 438, False: 24]
  ------------------
  117|  1.01k|          state = 2;
  118|  1.01k|          break;
  119|  1.01k|        }
  120|       |        // split headers
  121|  27.5k|        if ((pos1 = line.find(':')) == std::string::npos) {
  ------------------
  |  Branch (121:13): [True: 15, False: 27.5k]
  ------------------
  122|     15|          throw ParseError("Malformed header line");
  123|     15|        }
  124|  27.5k|        key = line.substr(0, pos1);
  125|  27.5k|        value = line.substr(pos1 + 1);
  126|  1.15M|        for(std::string::iterator it=key.begin(); it != key.end(); it++)
  ------------------
  |  Branch (126:51): [True: 1.12M, False: 27.5k]
  ------------------
  127|  1.12M|          if (YaHTTP::isspace(*it))
  ------------------
  |  Branch (127:15): [True: 13, False: 1.12M]
  ------------------
  128|     13|            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|    210|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (134:13): [True: 210, False: 27.3k]
  |  Branch (134:36): [True: 0, False: 210]
  ------------------
  135|      0|          target->jar.parseSetCookieHeader(value);
  136|  27.5k|        } else if (key == "cookie" && target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|  2.31k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (136:20): [True: 2.31k, False: 25.2k]
  |  Branch (136:39): [True: 2.31k, False: 0]
  ------------------
  137|  2.31k|          target->jar.parseCookieHeader(value);
  138|  25.2k|        } else {
  139|  25.2k|          if (key == "host" && target->kind == YAHTTP_TYPE_REQUEST) {
  ------------------
  |  |   35|  1.93k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (139:15): [True: 1.93k, False: 23.2k]
  |  Branch (139:32): [True: 1.93k, False: 0]
  ------------------
  140|       |            // maybe it contains port?
  141|  1.93k|            if ((pos1 = value.find(':')) == std::string::npos) {
  ------------------
  |  Branch (141:17): [True: 365, False: 1.57k]
  ------------------
  142|    365|              target->url.host = value;
  143|  1.57k|            } else {
  144|  1.57k|              target->url.host = value.substr(0, pos1);
  145|  1.57k|              target->url.port = ::atoi(value.substr(pos1).c_str());
  146|  1.57k|            }
  147|  1.93k|          }
  148|  25.2k|          if (target->headers.find(key) != target->headers.end()) {
  ------------------
  |  Branch (148:15): [True: 12.2k, False: 12.9k]
  ------------------
  149|  12.2k|            target->headers[key] = target->headers[key] + ";" + value;
  150|  12.9k|          } else {
  151|  12.9k|            target->headers[key] = std::move(value);
  152|  12.9k|          }
  153|  25.2k|        }
  154|  27.5k|      }
  155|  32.5k|    }
  156|       |
  157|  1.14k|    minbody = 0;
  158|       |    // check for expected body size
  159|  1.14k|    if (target->kind == YAHTTP_TYPE_REQUEST) maxbody = target->max_request_size;
  ------------------
  |  |   35|  1.14k|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (159:9): [True: 1.01k, False: 126]
  ------------------
  160|    126|    else if (target->kind == YAHTTP_TYPE_RESPONSE) maxbody = target->max_response_size;
  ------------------
  |  |   36|    126|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (160:14): [True: 0, False: 126]
  ------------------
  161|    126|    else maxbody = 0;
  162|       |
  163|  1.14k|    if (!chunked) {
  ------------------
  |  Branch (163:9): [True: 580, False: 564]
  ------------------
  164|    580|      if (target->headers.find("content-length") != target->headers.end()) {
  ------------------
  |  Branch (164:11): [True: 378, False: 202]
  ------------------
  165|    378|        std::istringstream maxbodyS(target->headers["content-length"]);
  166|    378|        maxbodyS >> minbody;
  167|    378|        maxbody = minbody;
  168|    378|      }
  169|    580|      if (minbody < 1) return true; // guess there isn't anything left.
  ------------------
  |  Branch (169:11): [True: 210, False: 370]
  ------------------
  170|    370|      if (target->kind == YAHTTP_TYPE_REQUEST && minbody > target->max_request_size) throw ParseError("Max request body size exceeded");
  ------------------
  |  |   35|    740|#define YAHTTP_TYPE_REQUEST 1
  ------------------
  |  Branch (170:11): [True: 370, False: 0]
  |  Branch (170:50): [True: 143, False: 227]
  ------------------
  171|    227|      else if (target->kind == YAHTTP_TYPE_RESPONSE && minbody > target->max_response_size) throw ParseError("Max response body size exceeded");
  ------------------
  |  |   36|    454|#define YAHTTP_TYPE_RESPONSE 2
  ------------------
  |  Branch (171:16): [True: 0, False: 227]
  |  Branch (171:56): [True: 0, False: 0]
  ------------------
  172|    370|    }
  173|       |
  174|    791|    if (maxbody == 0) hasBody = false;
  ------------------
  |  Branch (174:9): [True: 0, False: 791]
  ------------------
  175|    791|    else hasBody = true;
  176|       |
  177|    791|    if (buffer.size() == 0) return ready();
  ------------------
  |  Branch (177:9): [True: 25, False: 766]
  ------------------
  178|       |
  179|  4.76k|    while(buffer.size() > 0) {
  ------------------
  |  Branch (179:11): [True: 4.39k, False: 364]
  ------------------
  180|  4.39k|      if (chunked) {
  ------------------
  |  Branch (180:11): [True: 4.19k, False: 204]
  ------------------
  181|  4.19k|        if (chunk_size == 0) {
  ------------------
  |  Branch (181:13): [True: 2.23k, False: 1.95k]
  ------------------
  182|  2.23k|          char buf[100];
  183|       |          // read chunk length
  184|  2.23k|          if ((pos = buffer.find('\n')) == std::string::npos) {
  ------------------
  |  Branch (184:15): [True: 33, False: 2.20k]
  ------------------
  185|     33|            if (buffer.size() > 99) {
  ------------------
  |  Branch (185:17): [True: 11, False: 22]
  ------------------
  186|     11|              throw ParseError("Nonsensical chunk_size");
  187|     11|            }
  188|     22|            return false;
  189|     33|          }
  190|  2.20k|          if (pos > 99)
  ------------------
  |  Branch (190:15): [True: 31, False: 2.17k]
  ------------------
  191|     31|            throw ParseError("Impossible chunk_size");
  192|  2.17k|          buffer.copy(buf, pos);
  193|  2.17k|          buf[pos]=0; // just in case...
  194|  2.17k|          buffer.erase(buffer.begin(), buffer.begin()+pos+1); // remove line from buffer
  195|  2.17k|          if (sscanf(buf, "%zx", &chunk_size) != 1) {
  ------------------
  |  Branch (195:15): [True: 25, False: 2.14k]
  ------------------
  196|     25|            throw ParseError("Unable to parse chunk size");
  197|     25|          }
  198|  2.14k|          if (chunk_size == 0) { state = 3; break; } // last chunk
  ------------------
  |  Branch (198:15): [True: 3, False: 2.14k]
  ------------------
  199|  2.14k|          if (chunk_size > (std::numeric_limits<decltype(chunk_size)>::max() - 2) || chunk_size > maxbody) {
  ------------------
  |  Branch (199:15): [True: 3, False: 2.14k]
  |  Branch (199:86): [True: 152, False: 1.99k]
  ------------------
  200|    155|            throw ParseError("Chunk is too large");
  201|    155|          }
  202|  2.14k|        } else {
  203|  1.95k|          int crlf=1;
  204|  1.95k|          if (buffer.size() < chunk_size+1) return false; // expect newline
  ------------------
  |  Branch (204:15): [True: 34, False: 1.92k]
  ------------------
  205|  1.92k|          if (buffer.at(chunk_size) == '\r') {
  ------------------
  |  Branch (205:15): [True: 442, False: 1.48k]
  ------------------
  206|    442|            if (buffer.size() < chunk_size+2 || buffer.at(chunk_size+1) != '\n') return false; // expect newline after carriage return
  ------------------
  |  Branch (206:17): [True: 6, False: 436]
  |  Branch (206:49): [True: 19, False: 417]
  ------------------
  207|    417|            crlf=2;
  208|  1.48k|          } else if (buffer.at(chunk_size) != '\n') return false;
  ------------------
  |  Branch (208:22): [True: 20, False: 1.46k]
  ------------------
  209|  1.87k|          if (bodysize + chunk_size > maxbody) {
  ------------------
  |  Branch (209:15): [True: 0, False: 1.87k]
  ------------------
  210|      0|            throw ParseError("Chunked body is too large");
  211|      0|          }
  212|  1.87k|          std::string tmp = buffer.substr(0, chunk_size);
  213|  1.87k|          buffer.erase(buffer.begin(), buffer.begin()+chunk_size+crlf);
  214|  1.87k|          bodybuf << tmp;
  215|  1.87k|          bodysize += chunk_size;
  216|  1.87k|          chunk_size = 0;
  217|  1.87k|          if (buffer.size() == 0) break; // just in case
  ------------------
  |  Branch (217:15): [True: 76, False: 1.80k]
  ------------------
  218|  1.87k|        }
  219|  4.19k|      } else {
  220|    204|        if (bodysize + buffer.length() > maxbody) {
  ------------------
  |  Branch (220:13): [True: 94, False: 110]
  ------------------
  221|     94|          bodybuf << buffer.substr(0, maxbody - bodybuf.str().length());
  222|     94|          bodysize = maxbody;
  223|     94|        }
  224|    110|        else {
  225|    110|          bodybuf << buffer;
  226|    110|          bodysize += buffer.length();
  227|    110|        }
  228|    204|        buffer = "";
  229|    204|      }
  230|  4.39k|    }
  231|       |
  232|    443|    if (chunk_size!=0) return false; // need more data
  ------------------
  |  Branch (232:9): [True: 34, False: 409]
  ------------------
  233|       |
  234|    409|    return ready();
  235|    443|  };

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

_ZN6YaHTTP3URLC2Ev:
  166|  4.04k|      URL() { initialize(); }; //<! construct empty url
_ZN6YaHTTP3URL10initializeEv:
  116|  20.0k|      void initialize() {
  117|  20.0k|        protocol = ""; host = ""; port = 0; username = ""; password = ""; path = ""; parameters = ""; anchor =""; pathless = true;
  118|  20.0k|      }; //<! initialize to empty URL
_ZN6YaHTTP3URLC2EPKc:
  171|  12.1k|      URL(const char *url) {
  172|  12.1k|        parse(std::string(url));
  173|  12.1k|      }; //<! calls parse with url
_ZN6YaHTTP3URL5parseERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  175|  16.0k|      bool parse(const std::string& url) {
  176|       |        // setup
  177|  16.0k|        initialize();
  178|       |
  179|  16.0k|        if (url.size() > YAHTTP_MAX_URL_LENGTH) return false;
  ------------------
  |  |    8|  16.0k|#define YAHTTP_MAX_URL_LENGTH 2048
  ------------------
  |  Branch (179:13): [True: 11, False: 16.0k]
  ------------------
  180|  16.0k|        size_t pos = 0;
  181|  16.0k|        if (*(url.begin()) != '/') { // full url?
  ------------------
  |  Branch (181:13): [True: 15.8k, False: 219]
  ------------------
  182|  15.8k|          if (parseSchema(url, pos) == false) return false;
  ------------------
  |  Branch (182:15): [True: 14.5k, False: 1.28k]
  ------------------
  183|  1.28k|          if (pathless) {
  ------------------
  |  Branch (183:15): [True: 767, False: 522]
  ------------------
  184|    767|            parameters = url.substr(pos);
  185|    767|            return true;
  186|    767|          }
  187|    522|          if (parseUserPass(url, pos) == false) return false;
  ------------------
  |  Branch (187:15): [True: 0, False: 522]
  ------------------
  188|    522|          if (parseHost(url, pos) == false) return false;
  ------------------
  |  Branch (188:15): [True: 19, False: 503]
  ------------------
  189|    522|        }
  190|    722|        if (parsePath(url, pos) == false) return false;
  ------------------
  |  Branch (190:13): [True: 0, False: 722]
  ------------------
  191|    722|        if (parseParameters(url, pos) == false) return false;
  ------------------
  |  Branch (191:13): [True: 0, False: 722]
  ------------------
  192|    722|        return parseAnchor(url, pos);
  193|    722|    }; //<! 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.8k|      bool parseSchema(const std::string& url, size_t &pos) {
   16|  15.8k|          size_t pos1;
   17|  15.8k|          if (pos >= url.size()) return false; // no data
  ------------------
  |  Branch (17:15): [True: 14.4k, False: 1.31k]
  ------------------
   18|  1.31k|          if ( (pos1 = url.find_first_of(":",pos)) == std::string::npos ) return false; // schema is mandatory
  ------------------
  |  Branch (18:16): [True: 30, False: 1.28k]
  ------------------
   19|  1.28k|          protocol = url.substr(pos, pos1-pos);
   20|  1.28k|          if (protocol == "http") port = 80;
  ------------------
  |  Branch (20:15): [True: 2, False: 1.28k]
  ------------------
   21|  1.28k|          if (protocol == "https") port = 443;
  ------------------
  |  Branch (21:15): [True: 1, False: 1.28k]
  ------------------
   22|  1.28k|          pos = pos1+1; // after :
   23|  1.28k|          if (url.compare(pos, 2, "//") == 0) {
  ------------------
  |  Branch (23:15): [True: 522, False: 767]
  ------------------
   24|    522|             pathless = false; // if this is true we put rest into parameters
   25|    522|             pos += 2;
   26|    522|          }
   27|  1.28k|          return true;
   28|  1.31k|      }; //<! parse schema/protocol part 
_ZN6YaHTTP3URL13parseUserPassERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   60|    522|      bool parseUserPass(const std::string& url, size_t &pos) {
   61|    522|          size_t pos1,pos2;
   62|    522|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (62:15): [True: 1, False: 521]
  ------------------
   63|       |
   64|    521|          if ( (pos1 = url.find_first_of("@",pos)) == std::string::npos ) return true; // no userinfo
  ------------------
  |  Branch (64:16): [True: 324, False: 197]
  ------------------
   65|    197|          pos2 = url.find_first_of(":",pos);
   66|       |
   67|    197|          if (pos2 != std::string::npos) { // comes with password
  ------------------
  |  Branch (67:15): [True: 108, False: 89]
  ------------------
   68|    108|             username = url.substr(pos, pos2 - pos);
   69|    108|             password = url.substr(pos2+1, pos1 - pos2 - 1);
   70|    108|             password = Utility::decodeURL(password);
   71|    108|          } else {
   72|     89|             username = url.substr(pos, pos1 - pos);
   73|     89|          }
   74|    197|          pos = pos1+1;
   75|    197|          username = Utility::decodeURL(username);
   76|    197|          return true;
   77|    521|      }; //<! parse possible username and password
_ZN6YaHTTP3URL9parseHostERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   30|    522|      bool parseHost(const std::string& url, size_t &pos) {
   31|    522|          size_t pos1;
   32|    522|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (32:15): [True: 76, False: 446]
  ------------------
   33|    446|          if ( (pos1 = url.find_first_of("/", pos)) == std::string::npos ) {
  ------------------
  |  Branch (33:16): [True: 315, False: 131]
  ------------------
   34|    315|             host = url.substr(pos);
   35|    315|             path = "/";
   36|    315|             pos = url.size();
   37|    315|          } else {
   38|    131|             host = url.substr(pos, pos1-pos);
   39|    131|             pos = pos1;
   40|    131|          }
   41|    446|          if (host.at(0) == '[') { // IPv6
  ------------------
  |  Branch (41:15): [True: 151, False: 295]
  ------------------
   42|    151|            if ((pos1 = host.find_first_of("]")) == std::string::npos) {
  ------------------
  |  Branch (42:17): [True: 19, False: 132]
  ------------------
   43|       |              // incomplete address
   44|     19|              return false;
   45|     19|            }
   46|    132|            size_t pos2;
   47|    132|            if ((pos2 = host.find_first_of(":", pos1)) != std::string::npos) {
  ------------------
  |  Branch (47:17): [True: 70, False: 62]
  ------------------
   48|     70|              std::istringstream tmp(host.substr(pos2 + 1));
   49|     70|              tmp >> port;
   50|     70|            }
   51|    132|            host = host.substr(1, pos1 - 1);
   52|    295|          } else if ( (pos1 = host.find_first_of(":")) != std::string::npos ) {
  ------------------
  |  Branch (52:23): [True: 159, False: 136]
  ------------------
   53|    159|             std::istringstream tmp(host.substr(pos1+1));
   54|    159|             tmp >> port;
   55|    159|             host = host.substr(0, pos1);
   56|    159|          }
   57|    427|          return true;
   58|    446|      }; //<! parse host and port
_ZN6YaHTTP3URL9parsePathERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   79|    697|      bool parsePath(const std::string& url, size_t &pos) {
   80|    697|          size_t pos1;
   81|    697|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (81:15): [True: 375, False: 322]
  ------------------
   82|    322|          if (url[pos] != '/') return false; // not an url
  ------------------
  |  Branch (82:15): [True: 0, False: 322]
  ------------------
   83|    322|          if ( (pos1 = url.find_first_of("?", pos)) == std::string::npos ) {
  ------------------
  |  Branch (83:16): [True: 114, False: 208]
  ------------------
   84|    114|             path = url.substr(pos);
   85|    114|             pos = url.size();
   86|    208|          } else {
   87|    208|             path = url.substr(pos, pos1-pos);
   88|    208|             pos = pos1;
   89|    208|          }
   90|    322|          return true;
   91|    322|      }; //<! parse path component
_ZN6YaHTTP3URL15parseParametersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   93|    697|      bool parseParameters(const std::string& url, size_t &pos) {
   94|    697|          size_t pos1;
   95|    697|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (95:15): [True: 489, False: 208]
  ------------------
   96|    208|          if (url[pos] == '#') return true; // anchor starts here
  ------------------
  |  Branch (96:15): [True: 0, False: 208]
  ------------------
   97|    208|          if (url[pos] != '?') return false; // not a parameter
  ------------------
  |  Branch (97:15): [True: 0, False: 208]
  ------------------
   98|    208|          if ( (pos1 = url.find_first_of("#", pos)) == std::string::npos ) {
  ------------------
  |  Branch (98:16): [True: 119, False: 89]
  ------------------
   99|    119|             parameters = url.substr(pos+1);;
  100|    119|             pos = url.size();
  101|    119|          } else {
  102|     89|             parameters = url.substr(pos+1, pos1-pos-1);
  103|     89|             pos = pos1;
  104|     89|          }
  105|    208|          if (parameters.size()>0 && *(parameters.end()-1) == '&') parameters.resize(parameters.size()-1);
  ------------------
  |  Branch (105:15): [True: 130, False: 78]
  |  Branch (105:15): [True: 5, False: 203]
  |  Branch (105:38): [True: 5, False: 125]
  ------------------
  106|    208|          return true;
  107|    208|      }; //<! parse url parameters
_ZN6YaHTTP3URL11parseAnchorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
  109|    697|      bool parseAnchor(const std::string& url, size_t &pos) {
  110|    697|          if (pos >= url.size()) return true; // no data
  ------------------
  |  Branch (110:15): [True: 608, False: 89]
  ------------------
  111|     89|          if (url[pos] != '#') return false; // not anchor
  ------------------
  |  Branch (111:15): [True: 0, False: 89]
  ------------------
  112|     89|          anchor = url.substr(pos+1);
  113|     89|          return true;
  114|     89|      }; //<! parse anchor

_ZN6YaHTTP7Utility9decodeURLERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  122|   181k|    static std::string decodeURL(const std::string& component) {
  123|   181k|        std::string result = component;
  124|   181k|        size_t pos1,pos2;
  125|   181k|        pos2 = 0;
  126|   535k|        while((pos1 = result.find_first_of("%", pos2))!=std::string::npos) {
  ------------------
  |  Branch (126:15): [True: 357k, False: 177k]
  ------------------
  127|   357k|           std::string code;
  128|   357k|           char a,b,c;
  129|   357k|           if (pos1 + 2 > result.length()) return result; // end of result
  ------------------
  |  Branch (129:16): [True: 4.46k, False: 353k]
  ------------------
  130|   353k|           code = result.substr(pos1+1, 2);
  131|   353k|           a = std::tolower(code[0]); b = std::tolower(code[1]);
  132|       |
  133|   353k|           if ((( '0' > a || a > '9') && ('a' > a || a > 'f')) ||
  ------------------
  |  Branch (133:19): [True: 138k, False: 214k]
  |  Branch (133:30): [True: 186k, False: 27.4k]
  |  Branch (133:43): [True: 165k, False: 160k]
  |  Branch (133:54): [True: 51.2k, False: 109k]
  ------------------
  134|   269k|              (( '0' > b || b > '9') && ('a' > b || b > 'f'))) {
  ------------------
  |  Branch (134:18): [True: 40.4k, False: 96.5k]
  |  Branch (134:29): [True: 87.4k, False: 9.09k]
  |  Branch (134:42): [True: 51.3k, False: 76.5k]
  |  Branch (134:53): [True: 2.15k, False: 74.3k]
  ------------------
  135|   269k|              pos2 = pos1+3;
  136|   269k|              continue;
  137|   269k|           }
  138|       |
  139|  83.4k|           if ('0' <= a && a <= '9') a = a - '0';
  ------------------
  |  Branch (139:16): [True: 83.4k, False: 0]
  |  Branch (139:28): [True: 8.93k, False: 74.5k]
  ------------------
  140|  74.5k|           else if ('a' <= a && a <= 'f') a = a - 'a' + 0x0a;
  ------------------
  |  Branch (140:21): [True: 74.5k, False: 0]
  |  Branch (140:33): [True: 74.5k, False: 0]
  ------------------
  141|  83.4k|           if ('0' <= b && b <= '9') b = b - '0';
  ------------------
  |  Branch (141:16): [True: 83.4k, False: 0]
  |  Branch (141:28): [True: 9.09k, False: 74.3k]
  ------------------
  142|  74.3k|           else if ('a' <= b && b <= 'f') b = b - 'a' + 0x0a;
  ------------------
  |  Branch (142:21): [True: 74.3k, False: 0]
  |  Branch (142:33): [True: 74.3k, False: 0]
  ------------------
  143|       |
  144|  83.4k|           c = (a<<4)+b;
  145|  83.4k|           result = result.replace(pos1,3,1,c);
  146|  83.4k|           pos2=pos1;
  147|  83.4k|        }
  148|   177k|        return result;
  149|   181k|    }; //<! Decodes %xx from string into bytes
_ZN6YaHTTP8DateTimeC2Ev:
   56|  89.4k|     DateTime() { 
   57|  89.4k|       initialize();
   58|  89.4k|     }; //<! Construct and initialize
_ZN6YaHTTP8DateTime10initializeEv:
   60|  89.4k|     void initialize() {
   61|  89.4k|       isSet = false; 
   62|  89.4k|       year = month = day = wday = hours = minutes = seconds = utc_offset = 0;
   63|  89.4k|       month = 1; // it's invalid otherwise
   64|  89.4k|     }; //<! Creates year 0 date
_ZNK6YaHTTP25ASCIICINullSafeComparatorclERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
   25|   688k|    bool operator() (const std::string& lhs, const std::string& rhs) const {
   26|   688k|      int v;
   27|   688k|      std::string::const_iterator lhi = lhs.begin();
   28|   688k|      std::string::const_iterator rhi = rhs.begin();
   29|  1.51M|      for(;lhi != lhs.end() && rhi != rhs.end(); lhi++, rhi++)
  ------------------
  |  Branch (29:12): [True: 1.19M, False: 317k]
  |  Branch (29:12): [True: 1.18M, False: 329k]
  |  Branch (29:32): [True: 1.18M, False: 12.1k]
  ------------------
   30|  1.18M|        if ((v = ::tolower(*lhi) - ::tolower(*rhi)) != 0) return v<0; 
  ------------------
  |  Branch (30:13): [True: 359k, False: 825k]
  ------------------
   31|   329k|      if (lhi == lhs.end() && rhi != rhs.end()) return true;
  ------------------
  |  Branch (31:11): [True: 317k, False: 12.1k]
  |  Branch (31:11): [True: 85.5k, False: 244k]
  |  Branch (31:31): [True: 85.5k, False: 232k]
  ------------------
   32|   244k|      if (lhi != lhs.end() && rhi == rhs.end()) return false;
  ------------------
  |  Branch (32:11): [True: 12.1k, False: 232k]
  |  Branch (32:11): [True: 12.1k, False: 232k]
  |  Branch (32:31): [True: 12.1k, False: 0]
  ------------------
   33|   232k|      return false; // they are equal
   34|   244k|    }
_ZN6YaHTTP7Utility7iequalsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_m:
  296|    126|    static bool iequals(const std::string& a, const std::string& b, size_t length) {
  297|    126|      std::string::const_iterator ai, bi;
  298|    126|      size_t i;
  299|  3.38k|      for(ai = a.begin(), bi = b.begin(), i = 0; ai != a.end() && bi != b.end() && i < length; ai++,bi++,i++) {
  ------------------
  |  Branch (299:50): [True: 3.36k, False: 18]
  |  Branch (299:50): [True: 3.26k, False: 114]
  |  Branch (299:67): [True: 3.36k, False: 0]
  |  Branch (299:84): [True: 3.26k, False: 96]
  ------------------
  300|  3.26k|        if (::toupper(*ai) != ::toupper(*bi)) return false;
  ------------------
  |  Branch (300:13): [True: 12, False: 3.25k]
  ------------------
  301|  3.26k|      }
  302|       |
  303|    114|      if (ai == a.end() && bi == b.end()) return true;
  ------------------
  |  Branch (303:11): [True: 18, False: 96]
  |  Branch (303:11): [True: 0, False: 114]
  |  Branch (303:28): [True: 0, False: 18]
  ------------------
  304|    114|      if ((ai == a.end() && bi != b.end()) ||
  ------------------
  |  Branch (304:11): [True: 18, False: 96]
  |  Branch (304:12): [True: 18, False: 96]
  |  Branch (304:29): [True: 18, False: 0]
  ------------------
  305|     96|          (ai != a.end() && bi == b.end())) return false;
  ------------------
  |  Branch (305:12): [True: 96, False: 0]
  |  Branch (305:29): [True: 0, False: 96]
  ------------------
  306|       |      
  307|     96|      return ::toupper(*ai) == ::toupper(*bi);
  308|    114|    }; //<! case-insensitive comparison with length
_ZN6YaHTTP7Utility18parseUrlParametersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  253|  3.97k|    static strstr_map_t parseUrlParameters(const std::string& parameters) {
  254|  3.97k|      if (parameters.size() > YAHTTP_MAX_REQUEST_LINE_SIZE) {
  ------------------
  |  |    4|  3.97k|#define YAHTTP_MAX_REQUEST_LINE_SIZE 8192
  ------------------
  |  Branch (254:11): [True: 2, False: 3.96k]
  ------------------
  255|      2|        return {};
  256|      2|      }
  257|  3.96k|      std::string::size_type pos = 0;
  258|  3.96k|      strstr_map_t parameter_map;
  259|  18.2k|      while (pos != std::string::npos) {
  ------------------
  |  Branch (259:14): [True: 18.2k, False: 0]
  ------------------
  260|       |        // find next parameter start
  261|  18.2k|        std::string::size_type nextpos = parameters.find('&', pos);
  262|  18.2k|        std::string::size_type delim = parameters.find('=', pos);
  263|  18.2k|        if (delim > nextpos) {
  ------------------
  |  Branch (263:13): [True: 12.2k, False: 6.01k]
  ------------------
  264|  12.2k|          delim = nextpos;
  265|  12.2k|        }
  266|  18.2k|        std::string key;
  267|  18.2k|        std::string value;
  268|  18.2k|        if (delim == std::string::npos) {
  ------------------
  |  Branch (268:13): [True: 3.75k, False: 14.4k]
  ------------------
  269|  3.75k|          key = parameters.substr(pos);
  270|  14.4k|        } else {
  271|  14.4k|          key = parameters.substr(pos, delim-pos);
  272|  14.4k|          if (nextpos == std::string::npos) {
  ------------------
  |  Branch (272:15): [True: 104, False: 14.3k]
  ------------------
  273|    104|            value = parameters.substr(delim+1);
  274|  14.3k|          } else {
  275|  14.3k|            value = parameters.substr(delim+1, nextpos-delim-1);
  276|  14.3k|          }
  277|  14.4k|        }
  278|  18.2k|        if (key.empty()) {
  ------------------
  |  Branch (278:13): [True: 3.30k, False: 14.9k]
  ------------------
  279|       |          // no parameters at all
  280|  3.30k|          break;
  281|  3.30k|        }
  282|  14.9k|        parameter_map[decodeURL(key)] = decodeURL(value);
  283|  14.9k|        if (nextpos == std::string::npos) {
  ------------------
  |  Branch (283:13): [True: 662, False: 14.2k]
  ------------------
  284|       |          // no more parameters left
  285|    662|          break;
  286|    662|        }
  287|  14.2k|        if (parameter_map.size() >= YAHTTP_MAX_REQUEST_FIELDS) {
  ------------------
  |  |    8|  14.2k|#define YAHTTP_MAX_REQUEST_FIELDS 100
  ------------------
  |  Branch (287:13): [True: 5, False: 14.2k]
  ------------------
  288|      5|          break;
  289|      5|        }
  290|       |
  291|  14.2k|        pos = nextpos+1;
  292|  14.2k|      }
  293|  3.96k|      return parameter_map;
  294|  3.97k|    }; //<! parses URL parameters into string map 
_ZN6YaHTTP7Utility8trimLeftERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  315|  27.5k|    static void trimLeft(std::string &str) {
  316|  27.5k|       const std::locale &loc = std::locale::classic();
  317|  27.5k|       std::string::iterator iter = str.begin();
  318|  28.6k|       while(iter != str.end() && YaHTTP::isspace(*iter, loc)) iter++;
  ------------------
  |  Branch (318:14): [True: 8.00k, False: 20.6k]
  |  Branch (318:14): [True: 1.17k, False: 27.5k]
  |  Branch (318:35): [True: 1.17k, False: 6.83k]
  ------------------
  319|  27.5k|       str.erase(str.begin(), iter);
  320|  27.5k|    }; //<! removes whitespace from left
_ZN6YaHTTP7Utility9trimRightERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  322|  27.5k|    static void trimRight(std::string &str) {
  323|  27.5k|       const std::locale &loc = std::locale::classic();
  324|  27.5k|       std::string::reverse_iterator iter = str.rbegin();
  325|  29.9k|       while(iter != str.rend() && YaHTTP::isspace(*iter, loc)) iter++;
  ------------------
  |  Branch (325:14): [True: 9.24k, False: 20.6k]
  |  Branch (325:14): [True: 2.41k, False: 27.5k]
  |  Branch (325:36): [True: 2.41k, False: 6.83k]
  ------------------
  326|  27.5k|       str.erase(iter.base(), str.end());
  327|  27.5k|    }; //<! removes whitespace from right
_ZN6YaHTTP7Utility4trimERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  329|  27.5k|    static void trim(std::string &str) {
  330|  27.5k|       trimLeft(str);
  331|  27.5k|       trimRight(str);
  332|  27.5k|    }; //<! removes whitespace from left and right

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

