File: connectiontobrowser.h

package info (click to toggle)
havp 0.89-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,284 kB
  • ctags: 597
  • sloc: cpp: 7,161; sh: 497; makefile: 142
file content (84 lines) | stat: -rw-r--r-- 2,306 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/***************************************************************************
                          connectiontobrowser.h  -  description
                             -------------------
    begin                : Sa Feb 12 2005
    copyright            : (C) 2005 by Christian Hilgers
    email                : christian@hilgers.ag
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CONNECTIONTOBROWSER_H
#define CONNECTIONTOBROWSER_H

#include "default.h"
#include "httphandler.h"

#include <map>

using namespace std; 

class ConnectionToBrowser : public HTTPHandler  {

private:

string Request;
string Host;
int Port;
string IP;
string CompleteRequest;
string RequestType;
string RequestProtocol;
string FtpUser;
string FtpPass;
string UserAgent;
long long ContentLength;
bool IsKeepAlive;
bool IsStreamAgent;
vector<string> Methods;
vector<string> StreamUA;

bool Transparent;

int AnalyseFirstHeaderLine( string &RequestT );
int AnalyseHeaderLine( string &RequestT );
int GetHostAndPortOfRequest( string &RequestT, string::size_type StartPos );
int GetHostAndPortOfHostLine( string &HostLineT );

#ifdef REWRITE
map <string,string> URLRewrite;
#endif

public:

string PrepareHeaderForServer( bool ScannerOff, bool UseParentProxy );
string GetIP();
const string GetHost();
const string GetRequest();
const string GetCompleteRequest();
const string GetRequestProtocol();
const string GetRequestType();
const string GetUserAgent();
bool IsItKeepAlive();
bool IsItStreamAgent();
long long GetContentLength();
int GetPort();
void ClearVars();

#ifdef REWRITE
bool RewriteHost();
#endif

ConnectionToBrowser();
~ConnectionToBrowser();

};

#endif