havp/proxyhandler.h
changeset 0 8baf084f58c5
equal deleted inserted replaced
-1:000000000000 0:8baf084f58c5
       
     1 /***************************************************************************
       
     2                           proxyhandler.h  -  description
       
     3                              -------------------
       
     4     begin                : So Feb 20 2005
       
     5     copyright            : (C) 2005 by Christian Hilgers
       
     6     email                : christian@hilgers.ag
       
     7  ***************************************************************************/
       
     8 
       
     9 /***************************************************************************
       
    10  *                                                                         *
       
    11  *   This program is free software; you can redistribute it and/or modify  *
       
    12  *   it under the terms of the GNU General Public License as published by  *
       
    13  *   the Free Software Foundation; either version 2 of the License, or     *
       
    14  *   (at your option) any later version.                                   *
       
    15  *                                                                         *
       
    16  ***************************************************************************/
       
    17 
       
    18 #ifndef PROXYHANDLER_H
       
    19 #define PROXYHANDLER_H
       
    20 
       
    21 #include "default.h"
       
    22 #include "connectiontobrowser.h"
       
    23 #include "connectiontohttp.h"
       
    24 #include "scannerhandler.h"
       
    25 
       
    26 #include <string>
       
    27 
       
    28 using namespace std;
       
    29 
       
    30 class ProxyDetails {
       
    31 private:
       
    32     bool UseParentProxy;
       
    33 	string ParentHost;
       
    34 	int ParentPort;
       
    35 	bool UseParentProxyAuth;
       
    36 	string ParentUser;
       
    37 	string ParentPassword;
       
    38 public:
       
    39 	ProxyDetails();
       
    40 	bool useProxy() {return UseParentProxy;};
       
    41 	bool useProxyAuth() {return UseParentProxyAuth;};
       
    42 	string getHost() {return ParentHost;};
       
    43 	int getPort() {return ParentPort;};
       
    44 	string getUser() {return ParentUser;};
       
    45 	string getPassword() {return ParentPassword;};
       
    46 };
       
    47 
       
    48 class ProxyHandler {
       
    49 private:
       
    50 
       
    51 bool HeaderSend;
       
    52 bool BrowserDropped;
       
    53 bool DropBrowser;
       
    54 bool ScannerUsed;
       
    55 bool UnlockDone;
       
    56 bool AnswerDone;
       
    57 bool ReinitDone;
       
    58 bool ServerClosed;
       
    59 bool ServerConnected;
       
    60 bool DropServer;
       
    61 int alivecount;
       
    62 string ConnectedHost;
       
    63 int ConnectedPort;
       
    64 
       
    65 string Header;
       
    66 
       
    67 ConnectionToBrowser ToBrowser;
       
    68 ConnectionToHTTP ToServer;
       
    69 ProxyDetails parentProxy;
       
    70 
       
    71 int MaxDownloadSize;
       
    72 int KeepBackTime;
       
    73 int TricklingTime;
       
    74 unsigned int TricklingBytes;
       
    75 int KeepBackBuffer;
       
    76 
       
    77 int TransferredHeader;
       
    78 long long TransferredBody;
       
    79 
       
    80 bool DontLock;
       
    81 bool DontLockBINHEX;
       
    82 bool DontLockPDF;
       
    83 bool DontLockZIP;
       
    84 
       
    85 bool ProxyMessage( int CommunicationAnswerT, string Answer );
       
    86 int CommunicationHTTP( ScannerHandler &Scanners, bool ScannerOff );
       
    87 int CommunicationFTP( ScannerHandler &Scanners, bool ScannerOff );
       
    88 
       
    89 #ifdef SSLTUNNEL
       
    90 int CommunicationSSL();
       
    91 #endif
       
    92 
       
    93 public:
       
    94 
       
    95 void Proxy( SocketHandler &ProxyServerT, ScannerHandler &Scanners );
       
    96  
       
    97 ProxyHandler();
       
    98 ~ProxyHandler();
       
    99 
       
   100 };
       
   101 
       
   102 #endif