-
Notifications
You must be signed in to change notification settings - Fork 0
/
crawler.h
46 lines (27 loc) · 826 Bytes
/
crawler.h
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
#ifndef __CRAWLER_H__
#define __CRAWLER_H__
#include "sqlspider.h"
#include "url.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <assert.h>
#include <unistd.h>
#include <poll.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <fcntl.h>
#define MAX_DEPTH 200
char* itoa(int num,char*str,int radix);
bool get_ip_byname(char *domainname,char *hostip);
int creat_sock(char *domainname);
void makepost(char *domainname,char *url,char *postbuff);
void sendpost(char *domainname,char *url,int sockfd);
char *recvpost(int sockfd,int *msize);
bool savehtml(char *recvbuff,int size,char *path,MySqlServer &mySql);
char * get_domainname(char *url);
void get_and_prase_html(Curl &murl,Url &tmp,MySqlServer &mySql);
#endif