2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
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
10 * $Logfile: /Freespace2/code/Inetfile/Chttpget.h $
15 * HTTP Client class (get only)
18 * Revision 1.2 2002/06/09 04:41:12 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 3 8/22/99 1:19p Dave
26 * Fixed up http proxy code. Cleaned up scoring code. Reverse the order in
27 * which d3d cards are detected.
29 * 5 8/20/99 3:01p Kevin
30 * Added support for Proxies (I hope!)
32 * 4 7/31/98 12:19p Nate
33 * Fixed http abort problem.
35 * 3 7/31/98 11:57a Kevin
36 * Added new functions for getting state
38 * 2 6/01/98 10:10a Kevin
39 * Added DLL connection interface and auto update DLL
41 * 1 5/27/98 9:54a Kevin
43 * 1 5/25/98 5:31p Kevin
48 #ifndef _CHTTPGET_HEADER_
49 #define _CHTTPGET_HEADER_
51 #define HTTP_STATE_INTERNAL_ERROR 0
52 #define HTTP_STATE_SOCKET_ERROR 1
53 #define HTTP_STATE_URL_PARSING_ERROR 2
54 #define HTTP_STATE_CONNECTING 3
55 #define HTTP_STATE_HOST_NOT_FOUND 4
56 #define HTTP_STATE_CANT_CONNECT 5
57 #define HTTP_STATE_CONNECTED 6
58 #define HTTP_STATE_FILE_NOT_FOUND 10
59 #define HTTP_STATE_RECEIVING 11
60 #define HTTP_STATE_FILE_RECEIVED 12
61 #define HTTP_STATE_UNKNOWN_ERROR 13
62 #define HTTP_STATE_RECV_FAILED 14
63 #define HTTP_STATE_CANT_WRITE_FILE 15
64 #define HTTP_STATE_STARTUP 16
66 #define MAX_URL_LEN 300
71 ChttpGet(char *URL,char *localfile);
72 ChttpGet(char *URL,char *localfile,char *proxyip,unsigned short proxyport);
74 void GetFile(char *URL,char *localfile);
76 unsigned int GetBytesIn();
77 unsigned int GetTotalBytes();
85 unsigned int ReadDataChannel();
86 unsigned int m_iBytesIn;
87 unsigned int m_iBytesTotal;
91 char m_URL[MAX_URL_LEN];
92 unsigned short m_ProxyPort;
94 char m_szUserName[100];
95 char m_szPassword[100];
98 char m_szFilename[100];
106 char recv_buffer[1000];