mirror of
https://github.com/debauchee/barrier.git
synced 2025-07-22 02:47:48 +02:00
fixed misused read and write #4313
This commit is contained in:
parent
06253c965b
commit
10cddb97a8
9 changed files with 185 additions and 107 deletions
|
@ -22,6 +22,7 @@
|
|||
|
||||
class IEventQueue;
|
||||
class SocketMultiplexer;
|
||||
class ISocketMultiplexerJob;
|
||||
|
||||
struct Ssl;
|
||||
|
||||
|
@ -41,32 +42,38 @@ public:
|
|||
ArchSocket socket);
|
||||
~SecureSocket();
|
||||
|
||||
// IStream overrides
|
||||
virtual UInt32 read(void* buffer, UInt32 n);
|
||||
virtual void write(const void* buffer, UInt32 n);
|
||||
virtual bool isReady() const;
|
||||
|
||||
void connectSecureSocket();
|
||||
void acceptSecureSocket();
|
||||
void secureConnect();
|
||||
void secureAccept();
|
||||
bool isSecureReady();
|
||||
bool isSecure() { return true; }
|
||||
UInt32 secureRead(void* buffer, UInt32 n);
|
||||
UInt32 secureWrite(const void* buffer, UInt32 n);
|
||||
void initSsl(bool server);
|
||||
void loadCertificates(const char* CertFile);
|
||||
|
||||
private:
|
||||
void onConnected();
|
||||
|
||||
// SSL
|
||||
void initContext(bool server);
|
||||
void createSSL();
|
||||
void secureAccept(int s);
|
||||
void secureConnect(int s);
|
||||
bool secureAccept(int s);
|
||||
bool secureConnect(int s);
|
||||
void showCertificate();
|
||||
bool checkResult(int n);
|
||||
void showError();
|
||||
void throwError(const char* reason);
|
||||
bool getError();
|
||||
|
||||
ISocketMultiplexerJob*
|
||||
serviceConnect(ISocketMultiplexerJob*,
|
||||
bool, bool, bool);
|
||||
|
||||
ISocketMultiplexerJob*
|
||||
serviceAccept(ISocketMultiplexerJob*,
|
||||
bool, bool, bool);
|
||||
|
||||
private:
|
||||
Ssl* m_ssl;
|
||||
bool m_ready;
|
||||
bool m_secureReady;
|
||||
char* m_error;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue