Diff
Not logged in

Differences From:

File src/cgi.c part of check-in [a48936e834] - Changes to the way new repositories are created. Also make the CGI output blob available to all modules through a function call. by drh on 2007-08-03 23:04:05. Also file src/cgi.c part of check-in [f5e8b1d736] - Merge in and correct the changes to the new repository initialization. Also fix other misc bugs seen while testing. by drh on 2007-08-04 00:08:17. [view]

To:

File src/cgi.c part of check-in [83c876b447] - Win32 port: compiles, all tests pass but many functions fail due to path separators. Incomplete. Path fixes to come next by anonymous on 2007-09-21 21:53:28. [view]

@@ -27,18 +27,24 @@
 ** formatting function and its cousins, and routines to encode and
 ** decode strings in HTML or HTTP.
 */
 #include "config.h"
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <time.h>
-#include <sys/times.h>
-#include <sys/time.h>
-#include <sys/wait.h>
+#ifdef __MINGW32__
+#  include <windows.h>           /* for Sleep once server works again */
+#  include <winsock.h>           /* socket operations */
+#  define sleep Sleep            /* windows does not have sleep, but Sleep */
+#else
+#  include <sys/socket.h>
+#  include <netinet/in.h>
+#  include <arpa/inet.h>
+#  include <sys/times.h>
+#  include <sys/time.h>
+#  include <sys/wait.h>
+#  include <sys/select.h>
+#endif
+#include <time.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/select.h>
 #include <unistd.h>
 #include "cgi.h"
 
 #if INTERFACE
@@ -1077,8 +1083,12 @@
 ** out of this procedure call.  The child will handle the request.
 ** The parent never returns from this procedure.
 */
 void cgi_http_server(int iPort){
+#ifdef __MINGW32__
+  fprintf(stderr,"server not yet available in windows version of fossil\n");
+  exit(1);
+#else
   int listener;                /* The server socket */
   int connection;              /* A socket for each individual connection */
   fd_set readfds;              /* Set of file descriptors for select() */
   size_t lenaddr;              /* Length of the inaddr structure */
@@ -1143,8 +1153,9 @@
     }
   }
   /* NOT REACHED */
   exit(1);
+#endif
 }
 
 /*
 ** Name of days and months.