Hi All,

I have spend some hours trying to improve our Win32 Cherokee version, basically only a later version, and presented in a slightly different directory structure. So no bug were fixed by me other than getting it into a binary.


There are some problems left:

- Although I am able to build against a self compiled (CVS) version of PthreadW32. It seems for some reason that at the invocation of the first CHEROKEE_RWLOCK_INIT (this happens to be en regex.c). The execution stops, I did it with a statically linked version of the library so I was pretty sure it was actually in there.

- This implies Cherokee is threadless, and your requesters will have to wait for each other. Any hints and/or suggestions are welcome.

- The stuff related to signaling and wait_pid is still commented out.


I think some people could start to test the remaining win32 issues.


Developer notice; attached is the GPL compliance patch so I can distribute a zip file with the binary. (Why I want to do it is still a big mystery to me, I am no Win32 fan.)


User notice; The 'beta' installation got very simple, dump the zip file in your "Program Files" directory, now unzip. You will get a directory 'Octality', and in there 'Cherokee'. It is obvious you will have to double click on cherokee-worker.exe to get it to run. And it is also obvious Octality did not create the binary, but probably is be going to release a 1.0 version in forth coming months.


You will have to trust me it works, no screenshots today.

http://kinkrsoftware.nl/contrib/cherokee/cherokee-win32-r2734.zip
http://kinkrsoftware.nl/contrib/cherokee/cherokee-win32-r2734.patch



With kind regards,

Stefan de Konink
Crosscompile Technician at Kinkrsoftware ;)
Index: main_worker.c
===================================================================
--- main_worker.c       (revision 2734)
+++ main_worker.c       (working copy)
@@ -34,6 +34,10 @@
 #include "server-protected.h"
 #include "util.h"
 
+#ifdef _WIN32
+# include "unix4win32.h"
+#endif
+
 #ifdef HAVE_SYS_WAIT_H
 # include <sys/wait.h>
 #endif
@@ -89,6 +93,7 @@
 static ret_t common_server_initialization (cherokee_server_t *srv);
 
 
+#ifndef _WIN32
 static void
 wait_process (pid_t pid)
 {
@@ -142,13 +147,12 @@
 #endif
                cherokee_server_handle_panic (srv);
                break;
-
        default:
                PRINT_ERROR ("Unknown signal: %d\n", sig);
        }
 }
+#endif
 
-
 static ret_t
 test_configuration_file (void)
 {
@@ -167,6 +171,7 @@
 common_server_initialization (cherokee_server_t *srv)
 {
        ret_t            ret;
+#ifndef _WIN32
        struct sigaction act;
 
        /* Signals it handles
@@ -190,6 +195,7 @@
 #ifdef SIGBUS
        sigaction (SIGBUS,  &act, NULL);
 #endif
+#endif
 
        if (document_root != NULL) {
                cherokee_buffer_t tmp   = CHEROKEE_BUF_INIT;
@@ -329,7 +335,7 @@
 
        ret = cherokee_server_new (&srv);
        if (ret < ret_ok) return 1;
-       
+
        ret = process_parameters (argc, argv);
        if (ret != ret_ok) 
                exit (EXIT_OK_ONCE);
Index: threading.h
===================================================================
--- threading.h (revision 2734)
+++ threading.h (working copy)
@@ -26,8 +26,11 @@
 #define CHEROKEE_THREADING_H
 
 #include "common.h"
-#include <pthread.h>
 
+#ifdef HAVE_PTHREAD
+# include <pthread.h>
+#endif
+
 #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
 extern pthread_mutexattr_t cherokee_mutexattr_fast;
 #endif
@@ -42,7 +45,7 @@
 # define CHEROKEE_MUTEX_ERRORCHECK NULL
 #endif
 
-#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#if defined(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP) && 
defined(PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP)
 # define CHEROKEE_MUTEX_FAST (&cherokee_mutexattr_fast)
 #else
 # define CHEROKEE_MUTEX_FAST NULL
Index: unix4win32.h
===================================================================
--- unix4win32.h        (revision 2734)
+++ unix4win32.h        (working copy)
@@ -181,6 +181,7 @@
 
 /* Processes
  */
+#define statusp        NULL
 #define waitpid(pid,s,o) _cwait (statusp, pid, WAIT_CHILD)
 #define WAIT_T           int
 #define WTERMSIG(x)      ((x) & 0xff)        /* or: SIGABRT ?? */
Index: util.h
===================================================================
--- util.h      (revision 2734)
+++ util.h      (working copy)
@@ -147,10 +147,10 @@
 
 /* IO vectors
  */
-ret_t cherokee_iovec_skip_sent (struct iovec orig[], uint16_t  orig_len,
-                               struct iovec dest[], uint16_t *dest_len,
+ret_t cherokee_iovec_skip_sent (struct iovec *orig, uint16_t  orig_len,
+                               struct iovec *dest, uint16_t *dest_len,
                                size_t sent);
-ret_t cherokee_iovec_was_sent  (struct iovec orig[], uint16_t orig_len, size_t 
sent);
+ret_t cherokee_iovec_was_sent  (struct iovec *orig, uint16_t orig_len, size_t 
sent);
 
 /* Debug
  */
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to