Commit 1385af98 authored by jan.koester's avatar jan.koester
Browse files

fix2

parent e1db56f7
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -162,8 +162,6 @@ namespace netplus {
		virtual void  handshake_after_connect(){};

#ifdef Windows
		virtual bool hasPendingWrite() const { return _pendingIocpWrite.load(); }
		virtual void setPendingWrite(bool pending) { _pendingIocpWrite.store(pending); }
		virtual void accept(LPFN_ACCEPTEX lpfnAcceptEx, std::unique_ptr<socket>& csock) = 0;
		virtual void prime_read() = 0;
		std::unique_ptr<buffer> _ReadBuffer;
@@ -183,6 +181,8 @@ namespace netplus {
		virtual bool getHandshakeDone() { return true; }
		virtual bool hasBufferedData() const { return false; }
		virtual int  getSocketType() const { return _Type; }
		virtual bool hasPendingWrite() const { return _pendingIocpWrite.load(); }
		virtual void setPendingWrite(bool pending) { _pendingIocpWrite.store(pending); }

		// Push received data directly into buffer (for IOCP)
		virtual void pushReceivedData(const uint8_t* data, size_t len) { (void)data; (void)len; }
@@ -211,9 +211,7 @@ namespace netplus {
		ULONG_PTR        _Extension;

	protected:
#ifdef Windows
		std::atomic<bool> _pendingIocpWrite{false};
#endif
		// ✅ legacy helper still available
		void copyAddrInfo(ULONG_PTR* dest, ULONG_PTR src, size_t srclen);

+4 −8
Original line number Diff line number Diff line
@@ -369,17 +369,13 @@ std::vector<uint8_t> netplus::ssl::readTlsRecordAsync()
    // ----------------------------------------------------------------
    auto tryReadMore = [this]() -> bool {
        try {
            char tmpBuf[16384];
            buffer buf;
            buf.data.buf = tmpBuf;
            buf.size = sizeof(tmpBuf);
            buf.ptr = false;
            buffer buf(16384);

            size_t got = tcp::recvData(buf, 0);
            if (got > 0) {
                _rx_tcp_buf.insert(_rx_tcp_buf.end(), 
                                   (uint8_t*)tmpBuf, 
                                   (uint8_t*)tmpBuf + got);
                                   (uint8_t*)buf.data.buf,
                                   (uint8_t*)buf.data.buf + got);
                std::cerr << "[SSL] readTlsRecordAsync: tcp::recvData got " << got 
                          << " bytes, _rx_tcp_buf now " << _rx_tcp_buf.size() << std::endl;
                return true;