From a45977185a485624095bff1a15024e9199eee676 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 1 Jan 2016 22:05:42 +0100 Subject: reorganize source files into SAP and agents --- webproxyconn.h | 63 ---------------------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 webproxyconn.h (limited to 'webproxyconn.h') diff --git a/webproxyconn.h b/webproxyconn.h deleted file mode 100644 index c183462..0000000 --- a/webproxyconn.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef WEBPROXYCONN_H -#define WEBPROXYCONN_H - -#include -#include "sapconnection.h" -#include "sapsocket.h" - -class WebProxyTrans; - -class WebProxyConn : public QObject -{ - Q_OBJECT - -public: - WebProxyConn(SAPConnection *conn, QObject *parent = 0); - -protected: - enum MessageType { - MessageRequest = 1, - MessageResponse = 2, - MessageError = 3, - MessageAbort = 4 - }; - - struct Message { - quint8 command; // Seems to be always 1 - quint8 subCommand; // Seems to be always 1 - MessageType type; - quint8 transactionId; // Monotonically increasing - QByteArray payload; - }; - - static Message unpackMessage(const QByteArray &data); - static QByteArray packMessage(const Message &msg); - - struct RequestHeader { - /** Whether this is a CONNECT request, i.e. tunnel. */ - bool connect; - QString host; - int port; - }; - - static RequestHeader parseRequestHeader(const QByteArray &req); - static QByteArray removeHeaders(const QByteArray &req); - - void sendMessage(const Message &msg); - - void handleRequest(const Message &msg); - void handleAbort(const Message &msg); - -private slots: - void handleMessageReceived(); - void handleTransDataReceived(const QByteArray &data); - void handleTransDisconnected(); - -private: - SAPConnection *_conn; - SAPSocket *_in; - SAPSocket *_out; - QMap _trans; -}; - -#endif // WEBPROXYCONN_H -- cgit v1.2.3