doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sws.c
Go to the documentation of this file.
1 /***************************************************************************
2  * _ _ ____ _
3  * Project ___| | | | _ \| |
4  * / __| | | | |_) | |
5  * | (__| |_| | _ <| |___
6  * \___|\___/|_| \_\_____|
7  *
8  * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
9  *
10  * This software is licensed as described in the file COPYING, which
11  * you should have received as part of this distribution. The terms
12  * are also available at http://curl.haxx.se/docs/copyright.html.
13  *
14  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15  * copies of the Software, and permit persons to whom the Software is
16  * furnished to do so, under the terms of the COPYING file.
17  *
18  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19  * KIND, either express or implied.
20  *
21  * $Id: sws.c,v 1.44 2004/03/09 08:38:25 bagder Exp $
22  ***************************************************************************/
23 
24 /* sws.c: simple (silly?) web server
25 
26  This code was originally graciously donated to the project by Juergen
27  Wilke. Thanks a bunch!
28 
29  */
30 #include "setup.h" /* portability help from the lib directory */
31 
32 #include <stdio.h>
33 #include <stdlib.h>
34 #include <string.h>
35 #include <stdarg.h>
36 #include <unistd.h>
37 #include <signal.h>
38 #include <time.h>
39 #include <sys/time.h>
40 #include <sys/types.h>
41 #ifdef HAVE_SYS_SOCKET_H
42 #include <sys/socket.h>
43 #endif
44 #ifdef HAVE_NETINET_IN_H
45 #include <netinet/in.h>
46 #endif
47 #ifdef _XOPEN_SOURCE_EXTENDED
48 /* This define is "almost" required to build on HPUX 11 */
49 #include <arpa/inet.h>
50 #endif
51 #ifdef HAVE_NETDB_H
52 #include <netdb.h>
53 #endif
54 
55 #include "getpart.h"
56 
57 #ifndef FALSE
58 #define FALSE 0
59 #endif
60 #ifndef TRUE
61 #define TRUE 1
62 #endif
63 
64 #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
65 #include <windows.h>
66 #include <winsock2.h>
67 #define EINPROGRESS WSAEINPROGRESS
68 #define EWOULDBLOCK WSAEWOULDBLOCK
69 #define EISCONN WSAEISCONN
70 #define ENOTSOCK WSAENOTSOCK
71 #define ECONNREFUSED WSAECONNREFUSED
72 #endif
73 
74 #define REQBUFSIZ 150000
75 #define REQBUFSIZ_TXT "149999"
76 
77 struct httprequest {
78  char reqbuf[REQBUFSIZ]; /* buffer area for the incoming request */
79  int offset; /* size of the incoming request */
80  int testno; /* test number found in the request */
81  int partno; /* part number found in the request */
82  int open; /* keep connection open info, as found in the request */
83  bool auth_req; /* authentication required, don't wait for body unless
84  there's an Authorization header */
85 
86  bool auth; /* Authorization header present in the incoming request */
87  size_t cl; /* Content-Length of the incoming request */
88  bool digest; /* Authorization digest header found */
89  bool ntlm; /* Authorization ntlm header found */
90 };
91 
92 int ProcessRequest(struct httprequest *req);
93 void storerequest(char *reqbuf);
94 
95 #define DEFAULT_PORT 8999
96 
97 #ifndef DEFAULT_LOGFILE
98 #define DEFAULT_LOGFILE "log/sws.log"
99 #endif
100 
101 #define SWSVERSION "cURL test suite HTTP server/0.1"
102 
103 #define REQUEST_DUMP "log/server.input"
104 #define RESPONSE_DUMP "log/server.response"
105 
106 #define TEST_DATA_PATH "%s/data/test%d"
107 
108 /* very-big-path support */
109 #define MAXDOCNAMELEN 140000
110 #define MAXDOCNAMELEN_TXT "139999"
111 
112 #define REQUEST_KEYWORD_SIZE 256
113 
114 #define CMD_AUTH_REQUIRED "auth_required"
115 
116 /* global variable, where to find the 'data' dir */
117 const char *path=".";
118 
119 enum {
127 };
128 
129 
130 /* sent as reply to a QUIT */
131 static const char *docquit =
132 "HTTP/1.1 200 Goodbye\r\n"
133 "\r\n";
134 
135 /* sent as reply to a CONNECT */
136 static const char *docconnect =
137 "HTTP/1.1 200 Mighty fine indeed\r\n"
138 "\r\n";
139 
140 /* sent as reply to a "bad" CONNECT */
141 static const char *docbadconnect =
142 "HTTP/1.1 501 Forbidden you fool\r\n"
143 "\r\n";
144 
145 /* send back this on 404 file not found */
146 static const char *doc404 = "HTTP/1.1 404 Not Found\n"
147  "Server: " SWSVERSION "\n"
148  "Connection: close\n"
149  "Content-Type: text/html\n"
150  "\n"
151  "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
152  "<HTML><HEAD>\n"
153  "<TITLE>404 Not Found</TITLE>\n"
154  "</HEAD><BODY>\n"
155  "<H1>Not Found</H1>\n"
156  "The requested URL was not found on this server.\n"
157  "<P><HR><ADDRESS>" SWSVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
158 
159 #ifdef SIGPIPE
160 static volatile int sigpipe;
161 #endif
162 static FILE *logfp;
163 
164 static void logmsg(const char *msg, ...)
165 {
166  time_t t = time(NULL);
167  va_list ap;
168  struct tm *curr_time = localtime(&t);
169  char buffer[256]; /* possible overflow if you pass in a huge string */
170 
171  va_start(ap, msg);
172  vsprintf(buffer, msg, ap);
173  va_end(ap);
174 
175  fprintf(logfp, "%02d:%02d:%02d (%d) %s\n",
176  curr_time->tm_hour,
177  curr_time->tm_min,
178  curr_time->tm_sec, (int)getpid(), buffer);
179  fflush(logfp);
180 }
181 
182 
183 #ifdef SIGPIPE
184 static void sigpipe_handler(int sig)
185 {
186  (void)sig; /* prevent warning */
187  sigpipe = 1;
188 }
189 #endif
190 
191 #define END_OF_HEADERS "\r\n\r\n"
192 
193 static char *test2file(int testno)
194 {
195  static char filename[256];
196  sprintf(filename, TEST_DATA_PATH, path, testno);
197  return filename;
198 }
199 
200 
201 int ProcessRequest(struct httprequest *req)
202 {
203  char *line=req->reqbuf;
204  char chunked=FALSE;
205  static char request[REQUEST_KEYWORD_SIZE];
206  static char doc[MAXDOCNAMELEN];
207  char logbuf[256];
208  int prot_major, prot_minor;
209  char *end;
210  end = strstr(req->reqbuf, END_OF_HEADERS);
211 
212  /* try to figure out the request characteristics as soon as possible, but
213  only once! */
214  if((req->testno == DOCNUMBER_NOTHING) &&
215  sscanf(line, "%" REQBUFSIZ_TXT"s %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d",
216  request,
217  doc,
218  &prot_major,
219  &prot_minor) == 4) {
220  char *ptr;
221 
222  /* find the last slash */
223  ptr = strrchr(doc, '/');
224 
225  /* get the number after it */
226  if(ptr) {
227  FILE *stream;
228  char *filename;
229  char *cmd = NULL;
230  int cmdsize = 0;
231 
232  if((strlen(doc) + strlen(request)) < 200)
233  sprintf(logbuf, "Got request: %s %s HTTP/%d.%d",
234  request, doc, prot_major, prot_minor);
235  else
236  sprintf(logbuf, "Got a *HUGE* request HTTP/%d.%d",
237  prot_major, prot_minor);
238  logmsg(logbuf);
239 
240  if(!strncmp("/verifiedserver", ptr, 15)) {
241  logmsg("Are-we-friendly question received");
242  req->testno = DOCNUMBER_WERULEZ;
243  return 1; /* done */
244  }
245 
246  if(!strncmp("/quit", ptr, 15)) {
247  logmsg("Request-to-quit received");
248  req->testno = DOCNUMBER_QUIT;
249  return 1; /* done */
250  }
251 
252  ptr++; /* skip the slash */
253 
254  req->testno = strtol(ptr, &ptr, 10);
255 
256  if(req->testno > 10000) {
257  req->partno = req->testno % 10000;
258  req->testno /= 10000;
259  }
260  else
261  req->partno = 0;
262 
263  sprintf(logbuf, "Reqested test number %d part %d",
264  req->testno, req->partno);
265 
266  logmsg(logbuf);
267 
268  filename = test2file(req->testno);
269 
270  stream=fopen(filename, "rb");
271  if(!stream) {
272  logmsg("Couldn't open test file %d", req->testno);
273  return 0;
274  }
275  else {
276  /* get the custom server control "commands" */
277  cmd = (char *)spitout(stream, "reply", "servercmd", &cmdsize);
278  fclose(stream);
279 
280  if(cmdsize) {
281  logmsg("Found a reply-servercmd section!");
282 
283  if(!strncmp(CMD_AUTH_REQUIRED, cmd, strlen(CMD_AUTH_REQUIRED))) {
284  logmsg("instructed to require authorization header");
285  req->auth_req = TRUE;
286  }
287  }
288  }
289  }
290  else {
291  if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d",
292  doc, &prot_major, &prot_minor) == 3) {
293  sprintf(logbuf, "Receiced a CONNECT %s HTTP/%d.%d request",
294  doc, prot_major, prot_minor);
295  logmsg(logbuf);
296 
297  if(prot_major*10+prot_minor == 10)
298  req->open = FALSE; /* HTTP 1.0 closes connection by default */
299 
300  if(!strncmp(doc, "bad", 3))
301  /* if the host name starts with bad, we fake an error here */
303  else if(!strncmp(doc, "test", 4)) {
304  char *ptr = strchr(doc, ':');
305  if(ptr)
306  req->testno = atoi(ptr+1);
307  else
308  req->testno = DOCNUMBER_CONNECT;
309  }
310  else
311  req->testno = DOCNUMBER_CONNECT;
312  }
313  else {
314  logmsg("Did not find test number in PATH");
315  req->testno = DOCNUMBER_404;
316  }
317  }
318  }
319 
320  if(!end)
321  /* we don't have a complete request yet! */
322  return 0;
323 
324  /* **** Persistancy ****
325  *
326  * If the request is a HTTP/1.0 one, we close the connection unconditionally
327  * when we're done.
328  *
329  * If the request is a HTTP/1.1 one, we MUST check for a "Connection:"
330  * header that might say "close". If it does, we close a connection when
331  * this request is processed. Otherwise, we keep the connection alive for X
332  * seconds.
333  */
334 
335  do {
336  if(!req->cl && !strncasecmp("Content-Length:", line, 15)) {
337  /* If we don't ignore content-length, we read it and we read the whole
338  request including the body before we return. If we've been told to
339  ignore the content-length, we will return as soon as all headers
340  have been received */
341  req->cl = strtol(line+15, &line, 10);
342 
343  logmsg("Found Content-Legth: %d in the request", req->cl);
344  break;
345  }
346  else if(!strncasecmp("Transfer-Encoding: chunked", line,
347  strlen("Transfer-Encoding: chunked"))) {
348  /* chunked data coming in */
349  chunked = TRUE;
350  }
351 
352  if(chunked) {
353  if(strstr(req->reqbuf, "\r\n0\r\n"))
354  /* end of chunks reached */
355  return 1; /* done */
356  else
357  return 0; /* not done */
358  }
359 
360  line = strchr(line, '\n');
361  if(line)
362  line++;
363  } while(line);
364 
365  if(!req->auth && strstr(req->reqbuf, "Authorization:")) {
366  req->auth = TRUE; /* Authorization: header present! */
367  if(req->auth_req)
368  logmsg("Authorization header found, as required");
369  }
370 
371  if(!req->digest && strstr(req->reqbuf, "Authorization: Digest")) {
372  /* If the client is passing this Digest-header, we set the part number
373  to 1000. Not only to spice up the complexity of this, but to make
374  Digest stuff to work in the test suite. */
375  req->partno += 1000;
376  req->digest = TRUE; /* header found */
377  logmsg("Received Digest request, sending back data %d", req->partno);
378  }
379  else if(!req->ntlm &&
380  strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAD")) {
381  /* If the client is passing this type-3 NTLM header */
382  req->partno += 1002;
383  req->ntlm = TRUE; /* NTLM found */
384  logmsg("Received NTLM type-3, sending back data %d", req->partno);
385  }
386  else if(!req->ntlm &&
387  strstr(req->reqbuf, "Authorization: NTLM TlRMTVNTUAAB")) {
388  /* If the client is passing this type-1 NTLM header */
389  req->partno += 1001;
390  req->ntlm = TRUE; /* NTLM found */
391  logmsg("Received NTLM type-1, sending back data %d", req->partno);
392  }
393  if(strstr(req->reqbuf, "Connection: close"))
394  req->open = FALSE; /* close connection after this request */
395 
396  if(req->cl && (req->auth || !req->auth_req)) {
397  if(req->cl <= strlen(end+strlen(END_OF_HEADERS)))
398  return 1; /* done */
399  else
400  return 0; /* not complete yet */
401  }
402  return 1; /* done */
403 }
404 
405 /* store the entire request in a file */
406 void storerequest(char *reqbuf)
407 {
408  FILE *dump;
409 
410  dump = fopen(REQUEST_DUMP, "ab"); /* b is for windows-preparing */
411  if(dump) {
412  fwrite(reqbuf, 1, strlen(reqbuf), dump);
413 
414  fclose(dump);
415  logmsg("Wrote request input to " REQUEST_DUMP);
416  }
417  else {
418  logmsg("Failed to write request input to " REQUEST_DUMP);
419  }
420 }
421 
422 /* return 0 on success, non-zero on failure */
423 static int get_request(int sock, struct httprequest *req)
424 {
425  int fail= FALSE;
426  char *reqbuf = req->reqbuf;
427 
428  /*** Init the httpreqest structure properly for the upcoming request ***/
429 
430  memset(req, 0, sizeof(struct httprequest));
431 
432  /* here's what should not be 0 from the start */
433  req->testno = DOCNUMBER_NOTHING; /* safe default */
434  req->open = TRUE; /* connection should remain open and wait for more
435  commands */
436 
437  /*** end of httprequest init ***/
438 
439  while (req->offset < REQBUFSIZ) {
440  int got = sread(sock, reqbuf + req->offset, REQBUFSIZ - req->offset);
441  if (got <= 0) {
442  if (got < 0) {
443  perror("recv");
444  logmsg("recv() returned error");
445  return DOCNUMBER_INTERNAL;
446  }
447  logmsg("Connection closed by client");
448  return DOCNUMBER_INTERNAL;
449  }
450  req->offset += got;
451 
452  reqbuf[req->offset] = 0;
453 
454  if(ProcessRequest(req))
455  break;
456  }
457 
458  if (req->offset >= REQBUFSIZ) {
459  logmsg("Request buffer overflow, closing connection");
460  reqbuf[REQBUFSIZ-1]=0;
461  fail = TRUE;
462  /* dump the request to an external file anyway */
463  }
464  else
465  reqbuf[req->offset]=0;
466 
467  /* dump the request to an external file */
468  storerequest(reqbuf);
469 
470  return fail; /* success */
471 }
472 
473 /* returns -1 on failure */
474 static int send_doc(int sock, struct httprequest *req)
475 {
476  int written;
477  int count;
478  const char *buffer;
479  char *ptr;
480  FILE *stream;
481  char *cmd=NULL;
482  int cmdsize=0;
483  FILE *dump;
484  int persistant = TRUE;
485 
486  static char weare[256];
487 
488  char partbuf[80]="data";
489 
490  req->open = FALSE;
491 
492  logmsg("Send response number %d part %d", req->testno, req->partno);
493 
494  if(req->testno < 0) {
495  switch(req->testno) {
496  case DOCNUMBER_QUIT:
497  logmsg("Replying to QUIT");
498  buffer = docquit;
499  break;
500  case DOCNUMBER_WERULEZ:
501  /* we got a "friends?" question, reply back that we sure are */
502  logmsg("Identifying ourselves as friends");
503  sprintf(weare, "HTTP/1.1 200 OK\r\n\r\nWE ROOLZ: %d\r\n",
504  (int)getpid());
505  buffer = weare;
506  break;
507  case DOCNUMBER_INTERNAL:
508  logmsg("Bailing out due to internal error");
509  return -1;
510  case DOCNUMBER_CONNECT:
511  logmsg("Replying to CONNECT");
512  buffer = docconnect;
513  break;
515  logmsg("Replying to a bad CONNECT");
516  buffer = docbadconnect;
517  break;
518  case DOCNUMBER_404:
519  default:
520  logmsg("Replying to with a 404");
521  buffer = doc404;
522  break;
523  }
524  ptr = NULL;
525  stream=NULL;
526 
527  count = strlen(buffer);
528  }
529  else {
530  char *filename = test2file(req->testno);
531 
532  if(0 != req->partno)
533  sprintf(partbuf, "data%d", req->partno);
534 
535  stream=fopen(filename, "rb");
536  if(!stream) {
537  logmsg("Couldn't open test file");
538  return 0;
539  }
540  else {
541  buffer = spitout(stream, "reply", partbuf, &count);
542  ptr = (char *)buffer;
543  fclose(stream);
544  }
545 
546  /* re-open the same file again */
547  stream=fopen(filename, "rb");
548  if(!stream) {
549  logmsg("Couldn't open test file");
550  return 0;
551  }
552  else {
553  /* get the custom server control "commands" */
554  cmd = (char *)spitout(stream, "reply", "postcmd", &cmdsize);
555  fclose(stream);
556  }
557  }
558 
559  dump = fopen(RESPONSE_DUMP, "ab"); /* b is for windows-preparing */
560  if(!dump) {
561  logmsg("couldn't create logfile: " RESPONSE_DUMP);
562  return -1;
563  }
564 
565  /* If the word 'swsclose' is present anywhere in the reply chunk, the
566  connection will be closed after the data has been sent to the requesting
567  client... */
568  if(strstr(buffer, "swsclose") || !count) {
569  persistant = FALSE;
570  logmsg("connection close instruction swsclose found in response");
571  }
572 
573  do {
574  written = swrite(sock, buffer, count);
575  if (written < 0) {
576  logmsg("Sending response failed and we bailed out!");
577  return -1;
578  }
579  /* write to file as well */
580  fwrite(buffer, 1, written, dump);
581 
582  count -= written;
583  buffer += written;
584  } while(count>0);
585 
586  fclose(dump);
587 
588  logmsg("Response sent!");
589 
590  if(ptr)
591  free(ptr);
592 
593  if(cmdsize > 0 ) {
594  char command[32];
595  int num;
596  char *ptr=cmd;
597  do {
598  if(2 == sscanf(ptr, "%31s %d", command, &num)) {
599  if(!strcmp("wait", command))
600  sleep(num); /* wait this many seconds */
601  else
602  logmsg("Unknown command in reply command section");
603  }
604  ptr = strchr(ptr, '\n');
605  if(ptr)
606  ptr++;
607  else
608  ptr = NULL;
609  } while(ptr && *ptr);
610  }
611  if(cmd)
612  free(cmd);
613 
614  req->open = persistant;
615 
616  return 0;
617 }
618 
619 #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
620 static void win32_init(void)
621 {
622  WORD wVersionRequested;
623  WSADATA wsaData;
624  int err;
625  wVersionRequested = MAKEWORD(2, 0);
626 
627  err = WSAStartup(wVersionRequested, &wsaData);
628 
629  if (err != 0) {
630  perror("Winsock init failed");
631  fprintf(logfp, "Error initializing winsock -- aborting\n");
632  fclose(logfp);
633  exit(1);
634  }
635 
636  if ( LOBYTE( wsaData.wVersion ) != 2 ||
637  HIBYTE( wsaData.wVersion ) != 0 ) {
638 
639  WSACleanup();
640  perror("Winsock init failed");
641  fprintf(logfp, "No suitable winsock.dll found -- aborting\n");
642  fclose(logfp);
643  exit(1);
644  }
645 }
646 static void win32_cleanup(void)
647 {
648  WSACleanup();
649 }
650 #endif
651 
652 int main(int argc, char *argv[])
653 {
654  struct sockaddr_in me;
655  int sock, msgsock, flag;
656  unsigned short port = DEFAULT_PORT;
657  const char *logfile = DEFAULT_LOGFILE;
658  FILE *pidfile;
659  struct httprequest req;
660 
661  if(argc>1) {
662  port = atoi(argv[1]);
663 
664  if(argc>2) {
665  path = argv[2];
666  }
667  }
668 
669  logfp = fopen(logfile, "a");
670  if (!logfp) {
671  perror(logfile);
672  exit(1);
673  }
674 
675 #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
676  win32_init();
677 #endif
678 
679 #ifdef SIGPIPE
680 #ifdef HAVE_SIGNAL
681  signal(SIGPIPE, sigpipe_handler);
682 #endif
683 #ifdef HAVE_SIGINTERRUPT
684  siginterrupt(SIGPIPE, 1);
685 #endif
686 #endif
687 
688  sock = socket(AF_INET, SOCK_STREAM, 0);
689  if (sock < 0) {
690  perror("opening stream socket");
691  fprintf(logfp, "Error opening socket -- aborting\n");
692  fclose(logfp);
693  exit(1);
694  }
695 
696  flag = 1;
697  if (setsockopt
698  (sock, SOL_SOCKET, SO_REUSEADDR, (const void *) &flag,
699  sizeof(int)) < 0) {
700  perror("setsockopt(SO_REUSEADDR)");
701  }
702 
703  me.sin_family = AF_INET;
704  me.sin_addr.s_addr = INADDR_ANY;
705  me.sin_port = htons(port);
706  if (bind(sock, (struct sockaddr *) &me, sizeof me) < 0) {
707  perror("binding stream socket");
708  fprintf(logfp, "Error binding socket -- aborting\n");
709  fclose(logfp);
710  exit(1);
711  }
712 
713  pidfile = fopen(".http.pid", "w");
714  if(pidfile) {
715  fprintf(pidfile, "%d\n", (int)getpid());
716  fclose(pidfile);
717  }
718  else
719  fprintf(stderr, "Couldn't write pid file\n");
720 
721  /* start accepting connections */
722  listen(sock, 5);
723 
724  while (1) {
725  msgsock = accept(sock, NULL, NULL);
726 
727  if (msgsock == -1)
728  continue;
729 
730  logmsg("** New client connected");
731 
732  do {
733  if(get_request(msgsock, &req))
734  /* non-zero means error, break out of loop */
735  break;
736 
737  send_doc(msgsock, &req);
738 
739  if((req.testno < 0) && (req.testno != DOCNUMBER_CONNECT)) {
740  logmsg("special request received, no persistancy");
741  break;
742  }
743  if(!req.open) {
744  logmsg("instructed to close connection after server-reply");
745  break;
746  }
747 
748  if(req.open)
749  logmsg("persistant connection, awaits new request");
750  /* if we got a CONNECT, loop and get another request as well! */
751  } while(req.open || (req.testno == DOCNUMBER_CONNECT));
752 
753  logmsg("** Closing client connection");
754  sclose(msgsock);
755 
756  if (req.testno == DOCNUMBER_QUIT)
757  break;
758  }
759 
760  sclose(sock);
761  fclose(logfp);
762 
763 #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
764  win32_cleanup();
765 #endif
766 
767  return 0;
768 }
769 
#define sread(x, y, z)
Definition: setup.h:221
#define DEFAULT_PORT
Definition: sws.c:95
#define strcmp
Definition: Str.h:41
int partno
Definition: sws.c:81
#define DEFAULT_LOGFILE
Definition: sws.c:98
#define TRUE
Definition: sws.c:61
int strncasecmp(const char *, const char *, size_t)
#define LOBYTE(W)
Definition: jmemdos.c:483
#define REQBUFSIZ_TXT
Definition: sws.c:75
#define REQBUFSIZ
Definition: sws.c:74
#define REQUEST_KEYWORD_SIZE
Definition: sws.c:112
int offset
Definition: sws.c:79
bool ntlm
Definition: sws.c:89
#define HIBYTE(W)
Definition: jmemdos.c:482
#define REQUEST_DUMP
Definition: sws.c:103
#define SWSVERSION
Definition: sws.c:101
void storerequest(char *reqbuf)
Definition: sws.c:406
GLuint GLuint num
Definition: glext.h:5390
bool digest
Definition: sws.c:88
GLuint GLuint GLsizei count
Definition: glext.h:2845
#define MAXDOCNAMELEN_TXT
Definition: sws.c:110
GLuint GLuint end
Definition: glext.h:2845
int ProcessRequest(struct httprequest *req)
Definition: sws.c:201
#define NULL
Definition: Lib.h:88
GLuint buffer
Definition: glext.h:3108
bool auth
Definition: sws.c:86
const char * path
Definition: sws.c:117
int testno
Definition: sws.c:80
int open
Definition: sws.c:82
#define END_OF_HEADERS
Definition: sws.c:191
#define sclose(x)
Definition: setup.h:220
char reqbuf[REQBUFSIZ]
Definition: sws.c:78
static WindowRef ValidModeCallbackProc inCallback OSStatus err
#define swrite(x, y, z)
Definition: setup.h:222
const char * spitout(FILE *stream, const char *main, const char *sub, int *size)
Definition: getpart.c:66
size_t cl
Definition: sws.c:87
int vsprintf(idStr &string, const char *fmt, va_list argptr)
Definition: Str.cpp:1549
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
int main(int argc, char *argv[])
Definition: sws.c:652
#define CMD_AUTH_REQUIRED
Definition: sws.c:114
#define strncmp
Definition: Str.h:42
bool auth_req
Definition: sws.c:83
struct tm * localtime(const time_t *)
#define TEST_DATA_PATH
Definition: sws.c:106
#define FALSE
Definition: sws.c:58
size_t fwrite(const void *, size_t, size_t, FILE *)
int sprintf(idStr &string, const char *fmt,...)
Definition: Str.cpp:1528
#define RESPONSE_DUMP
Definition: sws.c:104
#define MAXDOCNAMELEN
Definition: sws.c:109
GLdouble GLdouble t
Definition: glext.h:2943