Commit 11567b2d authored by jan.koester's avatar jan.koester
Browse files

socketwait class added

parent b8e526b4
Loading
Loading
Loading
Loading
+321 −1091

File changed.

Preview size limit exceeded, changes collapsed.

+10 −0
Original line number Diff line number Diff line
@@ -93,9 +93,18 @@ namespace libhttppp {
      const std::vector<char> Delete(HttpRequest &nreq);
  private:
      void resetConnection();
      void _ensureConnected();
      bool tryHttp3First();
      int readchunk(const char *data,int datasize,int &pos);

      // Non-blocking I/O helpers using poll() for efficient waiting
      size_t _recvBlocking(netplus::buffer &b);
      void _sendAll(const char *data, size_t len);
      void _sendAll(const std::string &data);

      // Shared HTTP/1.x response reader (avoids code duplication)
      std::vector<char> _h1ReadResponse(const std::string &label);

      // HTTP/2 client helpers
      bool _isH2 = false;
      const std::vector<char> _h2Request(const std::string &method,
@@ -107,6 +116,7 @@ namespace libhttppp {
  private:
      HttpUrl _url;
      std::unique_ptr<netplus::socket> _cltsock;
      netplus::socketwait _sw;
      netplus::x509cert _cert;
  };