ReactOS 0.4.15-dev-7677-g8209aa5
httpd.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS HTTP Daemon
4 * FILE: include/httpd.h
5 */
6#ifndef __HTTPD_H
7#define __HTTPD_H
8
9#include <socket.h>
10#include <thread.h>
11#include <http.h>
12
13#define HTTPD_START WM_USER + 1
14#define HTTPD_STOP WM_USER + 2
15#define HTTPD_SUSPEND WM_USER + 3
16#define HTTPD_RESUME WM_USER + 4
17
22};
23
24class CHttpDaemon;
25
27public:
30 virtual void OnRead();
31 //virtual void OnWrite();
32 virtual void OnClose();
36 void SplitUri(const LPSTR lpsUri, LPSTR lpsHost, LPSTR lpsResource, LPSTR lpsParams);
37 void SplitResource(const LPSTR lpsResource, LPSTR lpsPath, LPSTR lpsFilename, LPSTR lpsExtension);
38 void ProcessRequest();
39 void SendFile(const LPSTR lpsFilename);
40 void Report(LPCSTR lpsCode, const LPSTR lpsStr);
41private:
45 // unsigned __int64 nTotalRead;
46 unsigned long long nTotalRead;
47 // unsigned __int64 nFileSize;
48 unsigned long long nFileSize;
50};
52
54public:
57 virtual void Execute();
58};
60
61class CHttpDaemon : public CServerSocket {
62public:
64 virtual ~CHttpDaemon();
65 HTTPdState GetState() const;
66 virtual BOOL Start();
67 virtual BOOL Stop();
70 virtual void OnAccept(LPCServerClientThread lpThread);
71private:
73};
75
76class CHttpDaemonThread : public CThread {
77public:
79 virtual void Execute();
80private:
82};
84
85#endif /* __HTTPD_H */
CHttpClientThread()
Definition: httpd.h:55
virtual void Execute()
Definition: httpd.cpp:350
virtual void OnClose()
Definition: httpd.cpp:334
unsigned long long nTotalRead
Definition: httpd.h:46
void ProcessRequest()
Definition: httpd.cpp:118
void SplitUri(const LPSTR lpsUri, LPSTR lpsHost, LPSTR lpsResource, LPSTR lpsParams)
Definition: httpd.cpp:41
unsigned long long nFileSize
Definition: httpd.h:48
void SplitResource(const LPSTR lpsResource, LPSTR lpsPath, LPSTR lpsFilename, LPSTR lpsExtension)
Definition: httpd.cpp:80
CHttpClient()
Definition: httpd.cpp:30
HANDLE hFile
Definition: httpd.h:49
virtual void OnRead()
Definition: httpd.cpp:289
DWORD ThreadId
Definition: httpd.h:34
LPSTR lpsBuffer
Definition: httpd.h:43
BOOL bStop
Definition: httpd.h:42
HANDLE ThreadHandle
Definition: httpd.h:33
LONG nBufferSize
Definition: httpd.h:44
CHttpParser Parser
Definition: httpd.h:35
void Report(LPCSTR lpsCode, const LPSTR lpsStr)
Definition: httpd.cpp:263
CHttpClient(LPCServerSocket lpServerSocket)
void SendFile(const LPSTR lpsFilename)
Definition: httpd.cpp:160
CHttpDaemonThread()
Definition: httpd.h:78
CHttpDaemon * Daemon
Definition: httpd.h:81
virtual void Execute()
Definition: httpd.cpp:449
virtual BOOL Stop()
Definition: httpd.cpp:417
virtual BOOL Start()
Definition: httpd.cpp:403
HTTPdState State
Definition: httpd.h:72
CHttpDaemon()
Definition: httpd.cpp:383
virtual ~CHttpDaemon()
Definition: httpd.cpp:390
virtual LPCServerClientSocket OnGetSocket(LPCServerSocket lpServerSocket)
Definition: httpd.cpp:429
virtual LPCServerClientThread OnGetThread(LPCServerClientSocket Socket)
Definition: httpd.cpp:435
HTTPdState GetState() const
Definition: httpd.cpp:397
virtual void OnAccept(LPCServerClientThread lpThread)
Definition: httpd.cpp:441
SOCKET Socket
Definition: socket.h:89
Definition: thread.h:18
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
CHttpClient * LPCHttpClient
Definition: httpd.h:51
CHttpDaemonThread * LPCHttpDaemonThread
Definition: httpd.h:83
HTTPdState
Definition: httpd.h:18
@ hsRunning
Definition: httpd.h:20
@ hsStopped
Definition: httpd.h:19
@ hsSuspended
Definition: httpd.h:21
CHttpDaemon * LPCHttpDaemon
Definition: httpd.h:74
CHttpClientThread * LPCHttpClientThread
Definition: httpd.h:59
long LONG
Definition: pedump.c:60
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182