From 885816be897838130354223de7f5c7e3fd54e216 Mon Sep 17 00:00:00 2001 From: zeldakatze Date: Fri, 3 Oct 2025 23:41:33 +0200 Subject: Initial commit --- GeminiConnectionHandler.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 GeminiConnectionHandler.h (limited to 'GeminiConnectionHandler.h') diff --git a/GeminiConnectionHandler.h b/GeminiConnectionHandler.h new file mode 100644 index 0000000..03330da --- /dev/null +++ b/GeminiConnectionHandler.h @@ -0,0 +1,45 @@ +/* + * Copyright 2024, My Name + * All rights reserved. Distributed under the terms of the MIT license. + */ +#ifndef GeminiConnectionHandler_H +#define GeminiConnectionHandler_H + + +#include +#include + +#include +#include +#include + +#include "BrowserTab.h" + + +class ConnectionHandler; +class BrowserTab; + +extern status_t GeminiConnectionHandler_threadInit(ConnectionHandler *h); + +class ConnectionHandler { +public: + ConnectionHandler(BrowserTab * tab); + virtual ~ConnectionHandler(); + + void OpenAdress(const BString &addr); +private: + BrowserTab * tab; + GeminiView * gview; + BString lastFetchedData; + thread_id connection_thread; + SSL_CTX *ssl_context; + + status_t threadMain(); + char buf[1024]; + + void receive_data(BString &output, BIO *bio); + + friend status_t GeminiConnectionHandler_threadInit(ConnectionHandler *h); +}; + +#endif // GeminiConnectionHandler_H -- cgit v1.2.3