FS2_Open
Open source remastering of the Freespace 2 engine
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
chttpget.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) Volition, Inc. 1999. All rights reserved.
3
*
4
* All source code herein is the property of Volition, Inc. You may not sell
5
* or otherwise commercially exploit the source or things you created based on the
6
* source.
7
*
8
*/
9
10
11
12
#ifndef _CHTTPGET_HEADER_
13
#define _CHTTPGET_HEADER_
14
15
#define HTTP_STATE_INTERNAL_ERROR 0
16
#define HTTP_STATE_SOCKET_ERROR 1
17
#define HTTP_STATE_URL_PARSING_ERROR 2
18
#define HTTP_STATE_CONNECTING 3
19
#define HTTP_STATE_HOST_NOT_FOUND 4
20
#define HTTP_STATE_CANT_CONNECT 5
21
#define HTTP_STATE_CONNECTED 6
22
#define HTTP_STATE_FILE_NOT_FOUND 10
23
#define HTTP_STATE_RECEIVING 11
24
#define HTTP_STATE_FILE_RECEIVED 12
25
#define HTTP_STATE_UNKNOWN_ERROR 13
26
#define HTTP_STATE_RECV_FAILED 14
27
#define HTTP_STATE_CANT_WRITE_FILE 15
28
#define HTTP_STATE_STARTUP 16
29
30
#define MAX_URL_LEN 300
31
32
class
ChttpGet
33
{
34
public
:
35
ChttpGet
(
char
*URL,
char
*localfile);
36
ChttpGet
(
char
*URL,
char
*localfile,
char
*proxyip,
unsigned
short
proxyport);
37
~ChttpGet
();
38
void
GetFile
(
char
*URL,
char
*localfile);
39
int
GetStatus
();
40
uint
GetBytesIn
();
41
uint
GetTotalBytes
();
42
void
AbortGet
();
43
void
WorkerThread
();
44
bool
m_Aborted
;
45
46
protected
:
47
int
ConnectSocket
();
48
char
*
GetHTTPLine
();
49
uint
ReadDataChannel
();
50
uint
m_iBytesIn
;
51
uint
m_iBytesTotal
;
52
uint
m_State
;
53
bool
m_ProxyEnabled
;
54
char
*
m_ProxyIP
;
55
char
m_URL
[
MAX_URL_LEN
];
56
ushort
m_ProxyPort
;
57
58
char
m_szUserName
[100];
59
char
m_szPassword
[100];
60
char
m_szHost
[200];
61
char
m_szDir
[200];
62
char
m_szFilename
[100];
63
64
bool
m_Aborting
;
65
66
67
SOCKET
m_DataSock
;
68
69
FILE *
LOCALFILE
;
70
char
recv_buffer
[1000];
71
72
#ifdef SCP_UNIX
73
SDL_Thread *thread_id;
74
#endif
75
};
76
77
78
79
80
81
82
83
84
85
86
#endif
ChttpGet::m_szUserName
char m_szUserName[100]
Definition:
chttpget.h:58
ChttpGet::m_DataSock
SOCKET m_DataSock
Definition:
chttpget.h:67
ChttpGet::m_szPassword
char m_szPassword[100]
Definition:
chttpget.h:59
ChttpGet::m_szHost
char m_szHost[200]
Definition:
chttpget.h:60
ChttpGet::GetHTTPLine
char * GetHTTPLine()
Definition:
chttpget.cpp:462
ChttpGet::m_iBytesTotal
uint m_iBytesTotal
Definition:
chttpget.h:51
ChttpGet::LOCALFILE
FILE * LOCALFILE
Definition:
chttpget.h:69
ChttpGet::WorkerThread
void WorkerThread()
Definition:
chttpget.cpp:224
ChttpGet::m_ProxyPort
ushort m_ProxyPort
Definition:
chttpget.h:56
ChttpGet::ConnectSocket
int ConnectSocket()
Definition:
chttpget.cpp:317
uint
unsigned int uint
Definition:
pstypes.h:64
ChttpGet::m_szDir
char m_szDir[200]
Definition:
chttpget.h:61
ChttpGet::m_Aborting
bool m_Aborting
Definition:
chttpget.h:64
ChttpGet::AbortGet
void AbortGet()
Definition:
chttpget.cpp:70
ChttpGet::GetStatus
int GetStatus()
Definition:
chttpget.cpp:208
SOCKET
#define SOCKET
Definition:
config.h:122
ChttpGet::GetTotalBytes
uint GetTotalBytes()
Definition:
chttpget.cpp:218
ChttpGet
Definition:
chttpget.h:32
ChttpGet::m_ProxyIP
char * m_ProxyIP
Definition:
chttpget.h:54
ChttpGet::GetFile
void GetFile(char *URL, char *localfile)
Definition:
chttpget.cpp:99
ChttpGet::m_iBytesIn
uint m_iBytesIn
Definition:
chttpget.h:50
ChttpGet::m_URL
char m_URL[MAX_URL_LEN]
Definition:
chttpget.h:55
ChttpGet::recv_buffer
char recv_buffer[1000]
Definition:
chttpget.h:70
MAX_URL_LEN
#define MAX_URL_LEN
Definition:
chttpget.h:30
ChttpGet::ReadDataChannel
uint ReadDataChannel()
Definition:
chttpget.cpp:534
ChttpGet::m_szFilename
char m_szFilename[100]
Definition:
chttpget.h:62
ushort
unsigned short ushort
Definition:
pstypes.h:63
ChttpGet::m_ProxyEnabled
bool m_ProxyEnabled
Definition:
chttpget.h:53
ChttpGet::ChttpGet
ChttpGet(char *URL, char *localfile)
Definition:
chttpget.cpp:92
ChttpGet::m_Aborted
bool m_Aborted
Definition:
chttpget.h:44
ChttpGet::GetBytesIn
uint GetBytesIn()
Definition:
chttpget.cpp:213
ChttpGet::m_State
uint m_State
Definition:
chttpget.h:52
ChttpGet::~ChttpGet
~ChttpGet()
Definition:
chttpget.cpp:191
code
inetfile
chttpget.h
Generated on Sun May 1 2016 16:22:40 for FS2_Open by
1.8.10