ReactOS 0.4.15-dev-8145-ga541a46
roshttpd.cpp File Reference
#include <debug.h>
#include <new>
#include <winsock2.h>
#include <stdio.h>
#include <config.h>
#include <error.h>
#include <httpd.h>
Include dependency graph for roshttpd.cpp:

Go to the source code of this file.

Functions

VOID Run ()
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Definition at line 58 of file roshttpd.cpp.

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}
#define printf
Definition: freeldr.h:97
VOID Run()
Definition: roshttpd.cpp:21

◆ Run()

VOID Run ( )

Definition at line 21 of file roshttpd.cpp.

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}
Definition: config.h:22
VOID Default()
Definition: config.cpp:42
BOOL Terminated()
Definition: thread.cpp:77
struct @1638 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
void ReportErrorStr(LPTSTR lpsText)
Definition: error.cpp:13
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TS(x)
Definition: error.h:11
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:1196
#define PeekMessage
Definition: winuser.h:5830
#define DispatchMessage
Definition: winuser.h:5765

Referenced by main().