ReactOS 0.4.16-dev-297-gc569aee
roshttpd.cpp
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS HTTP Daemon
4 * FILE: roshttpd.cpp
5 * PURPOSE: Main program
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * REVISIONS:
8 * CSH 01/09/2000 Created
9 */
10#include <debug.h>
11#include <new>
12#include <winsock2.h>
13#include <stdio.h>
14#include <config.h>
15#include <error.h>
16#include <httpd.h>
17
18using namespace std;
19
20
22{
24
27
28 try {
29 // Create configuration object
32
33 // Create daemon object
35
36 MSG Msg;
37 BOOL bQuit = FALSE;
38 while ((!bQuit) && (!pDaemonThread->Terminated())) {
39 bQuit = PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE);
40 if (!bQuit)
42 }
43
44 delete pDaemonThread;
45
46 if (pConfiguration != NULL)
47 delete pConfiguration;
48 } catch (bad_alloc&) {
49 if (pConfiguration != NULL)
50 delete pConfiguration;
51 ReportErrorStr(TS("Insufficient resources."));
52 }
53
55}
56
57/* Program entry point */
58int main(int argc, char* argv[])
59{
60 printf("ReactOS HTTP Daemon\n");
61 printf("Type Control-C to stop.\n");
62
63 Run();
64
65 printf("Daemon stopped.\n");
66}
static int argc
Definition: ServiceArgs.c:12
Definition: config.h:22
VOID Default()
Definition: config.cpp:42
BOOL Terminated()
Definition: thread.cpp:77
struct @1640 Msg[]
LPCConfig pConfiguration
Definition: config.cpp:18
LPCHttpDaemonThread pDaemonThread
Definition: config.cpp:19
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
int main()
Definition: test.c:6
void ReportErrorStr(LPTSTR lpsText)
Definition: error.cpp:13
unsigned int BOOL
Definition: ntddk_ex.h:94
#define printf
Definition: freeldr.h:97
#define TS(x)
Definition: error.h:11
#define argv
Definition: mplay32.c:18
Definition: features.h:417
VOID Run()
Definition: roshttpd.cpp:21
VOID DeinitWinsock()
Definition: socket.cpp:340
VOID InitWinsock()
Definition: socket.cpp:319
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define PM_REMOVE
Definition: winuser.h:1199
#define PeekMessage
Definition: winuser.h:5842
#define DispatchMessage
Definition: winuser.h:5777