-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrawler.h
More file actions
48 lines (32 loc) · 774 Bytes
/
Copy pathcrawler.h
File metadata and controls
48 lines (32 loc) · 774 Bytes
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
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <iostream>
#include <cf/ParsedUrl.h>
#include <cf/searchstring.h>
const size_t BUFFER_SIZE = 10000000;
class Crawler
{
public:
void crawl ( ParsedUrl url, char *buffer, size_t &pageSize);
Crawler();
~Crawler();
private:
SSL_CTX *globalCtx; //global ssl context
};
class Connection {
public:
Connection();
Connection(SSL_CTX * ctx, const string hostname);
void freeSSL();
~Connection();
private:
string hostname;
SSL *ssl;
int sd;
struct addrinfo *address, hints;
friend class Crawler;
};