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
[8372cc0b81]
- Socket operations now functional in Win32 port. Added quotes around the filename portion of the command to edit thus working of windows in paths where the temp directory contains spaces. Added -all flag to clean command. If not specified each file is prompted for before removing.
by
jnc on
2007-09-22 18:34:49.
Also file
src/cgi.c
part of check-in
[3c5482959c]
- Merge in the w32 changes.
by
drh on
2007-09-22 19:43:55.
[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 <winsock2.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.