ReactOS  0.4.14-dev-52-g6116262
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[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

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

◆ Run()

VOID Run ( )

Definition at line 21 of file roshttpd.cpp.

22 {
23  InitWinsock();
24 
27 
28  try {
29  // Create configuration object
30  pConfiguration = new CConfig;
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 e) {
49  if (pConfiguration != NULL)
50  delete pConfiguration;
51  ReportErrorStr(TS("Insufficient resources."));
52  }
53 
54  DeinitWinsock();
55 }
#define DispatchMessage
Definition: winuser.h:5666
#define PeekMessage
Definition: winuser.h:5731
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define TS(x)
Definition: error.h:11
struct @1576 Msg[]
unsigned int BOOL
Definition: ntddk_ex.h:94
#define e
Definition: ke_i.h:82
VOID Default()
Definition: config.cpp:42
smooth NULL
Definition: ftsmooth.c:416
BOOL Terminated()
Definition: thread.cpp:77
void ReportErrorStr(LPTSTR lpsText)
Definition: error.cpp:13
LPCHttpDaemonThread pDaemonThread
Definition: config.cpp:19
LPCConfig pConfiguration
Definition: config.cpp:18
#define PM_REMOVE
Definition: winuser.h:1182
VOID DeinitWinsock()
Definition: socket.cpp:340
Definition: config.h:22
VOID InitWinsock()
Definition: socket.cpp:319

Referenced by main().