ReactOS  0.4.14-dev-1007-g90d795b
httpd.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: httpd.cpp
5  * PURPOSE: HTTP daemon
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 <malloc.h>
13 #include <string.h>
14 #include <config.h>
15 #include <httpd.h>
16 #include <error.h>
17 
18 using namespace std;
19 
20 CHAR HttpMsg400[] = "<HEAD><TITLE>400 Bad Request</TITLE></HEAD>\n\r<BODY><H1>400 Bad Request</H1>\n\rThe request had bad syntax.<BR>\n\r</BODY>\n\r\n\r";
21 CHAR HttpMsg404[] = "<HEAD><TITLE>404 Not Found</TITLE></HEAD>\n\r<BODY><H1>404 Not Found</H1>\n\rThe requested URL was not found on this server.<BR>\n\r</BODY>\n\r\n\r";
22 CHAR HttpMsg405[] = "<HEAD><TITLE>405 Method Not Allowed</TITLE></HEAD>\n\r<BODY><H1>405 Method Not Allowed</H1>\n\rThe requested method is not supported on this server.<BR>\n\r</BODY>\n\r\n\r";
23 CHAR HttpMsg500[] = "<HEAD><TITLE>500 Internal Server Error</TITLE></HEAD>\n\r<BODY><H1>500 Internal Server Error</H1>\n\rAn internal error occurred.<BR>\n\r</BODY>\n\r\n\r";
24 CHAR HttpMsg501[] = "<HEAD><TITLE>501 Not Implemented</TITLE></HEAD>\n\r<BODY><H1>501 Not Implemented</H1>\n\rThe feature is not implemented.<BR>\n\r</BODY>\n\r\n\r";
25 
26 
27 // *************************** CHttpClient ***************************
28 
29 // Default constructor
31 {
32 }
33 
34 // Constructor with server socket as starter value
36 {
37  ServerSocket = serversocket;
38 }
39 
40 // Split URIs into its parts (ie. |http://|www.host.com|/resource|?parameters|)
41 VOID CHttpClient::SplitUri(LPSTR lpsUri, LPSTR lpsHost, LPSTR lpsResource, LPSTR lpsParams)
42 {
43  LPSTR lpsPos;
44  LPSTR lpsStr;
45  UINT i;
46 
47  strcpy(lpsHost, "");
48  strcpy(lpsResource, "");
49  strcpy(lpsParams, "");
50 
51  lpsPos = strstr(lpsUri, "://");
52  if (lpsPos != NULL)
53  lpsStr = &lpsPos[3];
54  else
55  lpsStr = lpsUri;
56 
57  lpsPos = strstr(lpsStr, "/");
58  if (lpsPos != NULL) {
59  strncat(lpsHost, lpsPos, lpsPos - lpsStr);
60  lpsStr = &lpsPos[1];
61 
62  lpsPos = strstr(lpsStr, "?");
63  if (lpsPos != NULL) {
64  strncat(lpsResource, lpsStr, lpsPos - lpsStr);
65  strcpy(lpsParams, &lpsPos[1]);
66  } else {
67  strcpy(lpsResource, lpsStr);
68  strcpy(lpsParams, "");
69  }
70 
71  // Replace "/" with "\"
72  for (i = 0; i < strlen(lpsResource); i++) {
73  if (lpsResource[i] == '/')
74  lpsResource[i] = '\\';
75  }
76  }
77 }
78 
79 // Split resource into its parts (ie. |/path/|filename|.extension|)
80 VOID CHttpClient::SplitResource(LPSTR lpsResource, LPSTR lpsPath, LPSTR lpsFilename, LPSTR lpsExtension)
81 {
82  INT i,len,fileptr,extptr;
83 
84  strcpy(lpsPath, "");
85  strcpy(lpsFilename, "");
86  strcpy(lpsExtension, "");
87 
88  len = strlen(lpsResource);
89  if (len != 0) {
90  if (lpsResource[len - 1] == '/') {
91  // There is only a path
92  strcpy(lpsPath, lpsResource);
93  } else {
94  // Find extension
95  i = len - 1;
96  while ((i >= 0) && (lpsResource[i] != '.')) i--;
97  extptr = i;
98  while ((i >= 0) && (lpsResource[i] != '/')) i--;
99  if (i > 0) {
100  // There is at least one directory in the path (besides root directory)
101  fileptr = i + 1;
102  strncat(lpsPath, lpsResource, fileptr);
103  } else
104  fileptr = 1;
105 
106  // Get filename and possibly extension
107  if (extptr != 0) {
108  strncat(lpsFilename, &lpsResource[fileptr], extptr - fileptr);
109  // Get extension
110  strncat(lpsExtension, &lpsResource[extptr + 1], len - extptr - 1);
111  } else
112  strncat(lpsFilename, &lpsResource[fileptr], len - fileptr);
113  }
114  }
115 }
116 
117 // Process HTTP request
119 {
120  CHAR sStr[255];
121  CHAR sHost[255];
122  CHAR sResource[255];
123  CHAR sParams[255];
124 
125  // Which method?
126  switch (Parser.nMethodNo) {
127  case hmGET: {
128  SplitUri(Parser.sUri, sHost, sResource, sParams);
129 
130  // Default resource?
131  if (strlen(sResource) == 0) {
133 
134  // FIXME: All default resources should be tried
135  // Iterate through all strings
136  //for (i->First(); !i->IsDone(); i->Next())
137  i->First();
138  if (!i->IsDone()) {
139  strcat(sResource, i->CurrentItem());
140  delete i;
141  } else {
142  // File not found
143  Report("404 Not Found", HttpMsg404);
144  break;
145  }
146  }
148  strcat(sStr, sResource);
149  SendFile(sStr);
150  break;
151  }
152  default: {
153  // Method is not implemented
154  Report("501 Not Implemented", HttpMsg501);
155  }
156  }
157 }
158 
159 // Send a file to socket
161 {
162  CHAR str[255];
163  CHAR str2[32];
164  union BigNum {
165  // unsigned __int64 Big;
166  unsigned long long Big;
167  struct {
168  DWORD Low;
169  DWORD High;
170  } u;
171  } nTotalBytes;
172  DWORD nBytesToRead;
173  DWORD nBytesRead;
174  BOOL bStatus;
175 
176  // Try to open file
177  hFile = CreateFileA(lpsFilename,
178  GENERIC_READ, // Open for reading
179  FILE_SHARE_READ, // Share for reading
180  NULL, // No security
181  OPEN_EXISTING, // Existing file only
182  FILE_ATTRIBUTE_NORMAL, // Normal file
183  NULL); // No attr. template
184  if (hFile == INVALID_HANDLE_VALUE) {
185  // File not found
186  Report("404 Not Found", HttpMsg404);
187  return;
188  }
189  // Get file size
190  nTotalBytes.u.Low = GetFileSize(hFile, &nTotalBytes.u.High);
191  if ((nTotalBytes.u.Low == 0xFFFFFFFF) && ((GetLastError()) != NO_ERROR)) {
192  // Internal server error
193  Report("500 Internal Server Error", HttpMsg500);
194  // Close file
196  return;
197  }
198 
199  // Determine buffer size
200  if (nTotalBytes.Big < 65536)
201  nBufferSize = 1024;
202  else
203  nBufferSize = 32768;
204  // Allocate memory on heap
205  lpsBuffer = (PCHAR) malloc(nBufferSize);
206 
207  if (lpsBuffer == NULL) {
208  // Internal server error
209  Report("500 Internal Server Error", HttpMsg500);
210  // Close file
212  return;
213  }
214 
215  SendText("HTTP/1.1 200 OK");
216  SendText("Server: ROSHTTPD");
217  SendText("MIME-version: 1.0");
218  SendText("Content-Type: text/plain");
219  SendText("Accept-Ranges: bytes");
220  strcpy(str, "Content-Length: ");
221  _itoa(nTotalBytes.u.Low, str2, 10);
222  strcat(str, str2);
223  SendText(str);
224  SendText("");
225  // Read and transmit file
226  nTotalRead = 0;
227  nFileSize = nTotalBytes.Big;
228  bStop = FALSE;
229 
230  fd_set wfds;
231  FD_ZERO(&wfds);
232  FD_SET(Socket, &wfds);
233  do {
234  MessageLoop();
235 
236  if (nTotalRead + nBufferSize < nFileSize)
237  nBytesToRead = nBufferSize;
238  else nBytesToRead = nFileSize - nTotalRead;
239 
240  bStatus = ReadFile(hFile, lpsBuffer, nBytesToRead, &nBytesRead, NULL);
241  if (bStatus) {
242  select(0, NULL, &wfds, NULL, NULL);
243  bStatus = (Transmit(lpsBuffer, nBytesRead) == (INT)nBytesRead);
244  nTotalRead += nBytesRead;
245  }
246  } while ((!bStop) && (bStatus) && (nTotalRead < nFileSize));
247 
248  if (bStatus)
249  SendText("");
250  else
251  // We can't send an error message here as we are in the process of sending a file.
252  // We have to terminate the connection instead
253  Close();
254 
255  // Free allocated memory
256  free(lpsBuffer);
257 
258  // Close file
260 }
261 
262 // Report something to client
264 {
265  CHAR sTmp[128];
266  CHAR sTmp2[16];
267 
268  strcpy(sTmp, "HTTP/1.1 ");
269  strcat(sTmp, lpsCode);
270  SendText(sTmp);
271  SendText("Server: ROSHTTPD");
272  SendText("MIME-version: 1.0");
273  SendText("Content-Type: text/html");
274  SendText("Accept-Ranges: bytes");
275  strcpy(sTmp, "Content-Length: ");
276  if (lpsStr != NULL) {
277  _itoa(strlen(lpsStr), sTmp2, 10);
278  strcat(sTmp, sTmp2);
279  } else
280  strcat(sTmp, "0");
281  SendText(sTmp);
282  SendText("");
283  if (lpsStr != NULL)
284  SendText(lpsStr);
285  SendText("");
286 }
287 
288 // OnRead event handler
290 {
291  LONG nCount;
292 
293  nCount = Receive((LPSTR) &Parser.sBuffer[Parser.nHead],
294  sizeof(Parser.sBuffer) - Parser.nHead);
295 
296  Parser.nHead += nCount;
297  if (Parser.nHead >= sizeof(Parser.sBuffer))
298  Parser.nHead = 0;
299 
300  if (Parser.Complete()) {
301  ProcessRequest();
302  }
303 
304  if (Parser.bUnknownMethod) {
305  // Method Not Allowed
306  Report("405 Method Not Allowed", HttpMsg405);
307  // Terminate connection
308  Close();
309  }
310 }
311 /*
312 // OnWrite event handler
313 VOID CHttpClient::OnWrite()
314 {
315  DWORD nBytesToRead;
316  DWORD nBytesRead;
317 
318  OutputDebugString(TS("Can write\n"));
319 
320  if (bSendingFile) {
321  if (nTotalRead + nBufferSize < nFileSize)
322  nBytesToRead = nBufferSize;
323  else nBytesToRead = nFileSize - nTotalRead;
324 
325  bError = ReadFile(hFile, Buffer, nBytesToRead, &nBytesRead, NULL);
326  if (!bError) {
327  Transmit(Buffer, nBytesRead);
328  nTotalRead += nBytesRead;
329  }
330  }
331 }
332 */
333 // OnClose event handler
335 {
336  // Stop sending file if we are doing that now
337  bStop = TRUE;
338 }
339 
340 
341 // ************************ CHttpClientThread ************************
342 
343 // Constructor with client socket as starter value
345 {
346  ClientSocket = lpSocket;
347 }
348 
349 // Execute client thread code
351 {
352  MSG Msg;
353 
354  while (!Terminated()) {
355  (( CHttpClient *) ClientSocket)->MessageLoop();
356  if (PeekMessage(&Msg, 0, 0, 0, PM_REMOVE) != 0) {
357  switch (Msg.message) {
358  case HTTPD_START: {
359  // TODO: Start thread
360  break;
361  }
362  case HTTPD_STOP: {
363  // TODO: Stop thread
364  break;
365  }
366  default:
368  }
369 
370  }
371  }
372 
373  if (ClientSocket != NULL) {
374  delete ClientSocket;
375  ClientSocket = NULL;
376  }
377 }
378 
379 
380 // *************************** CHttpDaemon ***************************
381 
382 // Default constructor
384 {
385  State = hsStopped;
386  Start();
387 }
388 
389 // Default destructor
391 {
392  if (State==hsRunning)
393  Stop();
394 }
395 
396 // Return daemon state
398 {
399  return State;
400 }
401 
402 // Start HTTP daemon
404 {
406 
408 
409  Open();
410 
411  State = hsRunning;
412 
413  return TRUE;
414 }
415 
416 // Stop HTTP daemon
418 {
420 
421  Close();
422 
423  State = hsStopped;
424 
425  return TRUE;
426 }
427 
428 // OnGetSocket event handler
430 {
431  return new CHttpClient(lpServerSocket);
432 }
433 
434 // OnGetThread event handler
436 {
437  return new CHttpClientThread(lpSocket);
438 }
439 
440 // OnAccept event handler
442 {
443 }
444 
445 
446 // ************************ CHttpDaemonThread ************************
447 
448 // Execute daemon thread code
450 {
451  MSG Msg;
452 
453  try {
454  Daemon = NULL;
455  Daemon = new CHttpDaemon;
456 
457  while (!Terminated()) {
458  Daemon->MessageLoop();
459  if (PeekMessage(&Msg, 0, 0, 0, PM_REMOVE) != 0) {
460  switch (Msg.message) {
461  case HTTPD_START: {
462  if (Daemon->GetState() == hsStopped)
463  Daemon->Start();
464  break;
465  }
466  case HTTPD_STOP: {
467  if (Daemon->GetState() == hsRunning)
468  Daemon->Stop();
469  break;
470  }
471  case HTTPD_SUSPEND: {
472  if (Daemon->GetState() == hsRunning){}
473  // FIXME: Suspend service
474  break;
475  }
476  case HTTPD_RESUME: {
477  if (Daemon->GetState() != hsSuspended){}
478  // FIXME: Resume service
479  break;
480  }
481  default:
483  }
484  }
485  }
486  delete Daemon;
487  } catch (ESocket e) {
488  ReportErrorStr(e.what());
489  } catch (bad_alloc&) {
490  ReportErrorStr(TS("Insufficient resources."));
491  }
492 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
Definition: winsock.h:66
CList< LPSTR > * GetDefaultResources()
Definition: config.cpp:116
#define DispatchMessage
Definition: winuser.h:5740
#define PeekMessage
Definition: winuser.h:5805
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
#define SetPort
Definition: winspool.h:1154
virtual void Execute()
Definition: httpd.cpp:350
char * strncat(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:605
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
virtual ~CHttpDaemon()
Definition: httpd.cpp:390
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
CIterator< Item > * CreateIterator() const
Definition: list.h:93
char CHAR
Definition: xmlstorage.h:175
#define free
Definition: debug_ros.c:5
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define INT
Definition: polytest.cpp:20
CHAR HttpMsg500[]
Definition: httpd.cpp:23
#define TS(x)
Definition: error.h:11
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
#define assert(x)
Definition: debug.h:53
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
Definition: strmini.h:380
virtual BOOL Stop()
Definition: httpd.cpp:417
#define FD_ZERO(set)
Definition: winsock.h:96
Definition: features.h:417
char * LPSTR
Definition: xmlstorage.h:182
virtual void OnClose()
Definition: httpd.cpp:334
#define FD_SET(fd, set)
Definition: winsock.h:89
#define NO_ERROR
Definition: dderror.h:5
static DWORD WINAPI MessageLoop(LPVOID lpParameter)
Definition: videorenderer.c:98
LPSTR GetHttpBase()
Definition: config.cpp:104
int32_t INT
Definition: typedefs.h:57
CHAR HttpMsg404[]
Definition: httpd.cpp:21
#define FILE_SHARE_READ
Definition: compat.h:125
_In_ PVOID _Out_ BOOLEAN * Stop
Definition: ldrtypes.h:241
#define Open
Definition: syshdrs.h:62
virtual void OnRead()
Definition: httpd.cpp:289
void Report(LPCSTR lpsCode, const LPSTR lpsStr)
Definition: httpd.cpp:263
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
virtual LPCServerClientThread OnGetThread(LPCServerClientSocket Socket)
Definition: httpd.cpp:435
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
Definition: select.c:41
#define e
Definition: ke_i.h:82
void SendFile(const LPSTR lpsFilename)
Definition: httpd.cpp:160
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
#define OPEN_EXISTING
Definition: compat.h:434
CHttpClient()
Definition: httpd.cpp:30
_CRTIMP char *__cdecl _itoa(_In_ int _Value, _Pre_notnull_ _Post_z_ char *_Dest, _In_ int _Radix)
#define PCHAR
Definition: match.c:90
#define HTTPD_STOP
Definition: httpd.h:14
USHORT GetPort()
Definition: config.cpp:122
CHttpClientThread()
Definition: httpd.h:55
CHAR HttpMsg405[]
Definition: httpd.cpp:22
virtual VOID MessageLoop()
Definition: socket.cpp:251
CHAR HttpMsg400[]
Definition: httpd.cpp:20
void SplitResource(const LPSTR lpsResource, LPSTR lpsPath, LPSTR lpsFilename, LPSTR lpsExtension)
Definition: httpd.cpp:80
void ProcessRequest()
Definition: httpd.cpp:118
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
Definition: partlist.h:33
Definition: strmini.h:378
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
virtual BOOL Start()
Definition: httpd.cpp:403
GLenum GLsizei len
Definition: glext.h:6722
virtual void OnAccept(const LPCServerClientThread lpThread)
Definition: httpd.cpp:441
HTTPdState GetState() const
Definition: httpd.cpp:397
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
void ReportErrorStr(LPTSTR lpsText)
Definition: error.cpp:13
virtual void Execute()
Definition: httpd.cpp:449
enum State_ State
Definition: pofuncs.h:54
virtual LPCServerClientSocket OnGetSocket(LPCServerSocket lpServerSocket)
Definition: httpd.cpp:429
#define hmGET
Definition: http.h:19
Definition: sacdrv.h:267
CHttpDaemon()
Definition: httpd.cpp:383
unsigned int UINT
Definition: ndis.h:50
Definition: socket.h:32
SOCKET ServerSocket
Definition: socket.c:3
#define HTTPD_SUSPEND
Definition: httpd.h:15
LPCConfig pConfiguration
Definition: config.cpp:18
#define HTTPD_START
Definition: httpd.h:13
CHAR HttpMsg501[]
Definition: httpd.cpp:24
struct @1587 Msg[]
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define malloc
Definition: debug_ros.c:4
HTTPdState
Definition: httpd.h:18
#define PM_REMOVE
Definition: winuser.h:1182
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:407
#define HTTPD_RESUME
Definition: httpd.h:16
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
void SplitUri(const LPSTR lpsUri, LPSTR lpsHost, LPSTR lpsResource, LPSTR lpsParams)
Definition: httpd.cpp:41