httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davide Berti <dbe...@pillardata.com>
Subject SSL hangs if -X not specified/ code review qnx mods
Date Thu, 23 May 2002 01:39:36 GMT
Hello all

httpd-2.0.36, QNX 6.1 RTOS

I have made a modification to apache to get it to run
on qnx.  It kept hanging.  I traced it down and made
some changes to get it to run.  I wanted to proof
these changes with the apache community and get some
feedback as to the longterm consequences/ side effects
of these changes.  I am attaching a diff of the
changes that I made.

I also noticed that SSL doesn't seem to work unless
the -X flag is passed to httpd, any ideas.

Thanks
/Davide

diff:
--- httpd-2.0.35/srclib/apr/locks/unix/proc_mutex.c    Wed May  8 
15:56:52 2002
+++ httpd-2.0.36/srclib/apr/locks/unix/proc_mutex.c    Wed May  8 
16:04:51 2002
@@ -318,11 +318,9 @@
        if (munmap((caddr_t)mutex->pthread_interproc, 
sizeof(pthread_mutex_t))){
            return errno;
        }
-        /* qnx hack in pthread_create forced initialization of shm,
-        deinitialize it here DB */
-        if(shm_unlink("/datapoints"))
-            return errno;
-    }
+        if(shm_unlink("/datapoints")) // DB
+            return errno;
+    }
    return APR_SUCCESS;
}  
@@ -333,16 +331,17 @@
    int fd;
    pthread_mutexattr_t mattr;

-    //fd = open("/data", O_RDWR|O_CREAT,0777);
-    fd = shm_open("/datapoints",O_RDWR|O_CREAT,0777);
+    fd=shm_open("/datapoints",O_RDWR|O_CREAT,0777); //DB
    if (fd < 0)
-        return errno;
-   -    if(ftruncate(fd,sizeof(pthread_mutex_t))==-1)
-        return errno;
+        return errno;  
-    new_mutex->pthread_interproc = (pthread_mutex_t*)mmap(
-                                       NULL, //(caddr_t)0
+    if(ftruncate(fd,sizeof(pthread_mutex_t))==-1)  //DB
+        return errno;   +
+
+
+    new_mutex->pthread_interproc = (pthread_mutex_t *)mmap(
+                                       (caddr_t) 0,
                                       sizeof(pthread_mutex_t),
                                       PROT_READ | PROT_WRITE, MAP_SHARED,
                                       fd, 0);
@@ -370,12 +369,11 @@
                                               PTHREAD_MUTEX_ROBUST_NP))) {
#ifdef PTHREAD_SETS_ERRNO
        rv = errno;
-#endif
+#endif // DB
        proc_mutex_proc_pthread_cleanup(new_mutex);
        return rv;
    }
#endif
-
    if ((rv = pthread_mutexattr_setprotocol(&mattr, 
PTHREAD_PRIO_INHERIT))) {
#ifdef PTHREAD_SETS_ERRNO
        rv = errno;
@@ -383,16 +381,15 @@
        proc_mutex_proc_pthread_cleanup(new_mutex);
        return rv;
    }
-
-    if ((rv = pthread_mutex_destroy(new_mutex->pthread_interproc))) {
+    if ((rv = pthread_mutex_destroy(new_mutex->pthread_interproc))) { 
// DB
#ifdef PTHREAD_SETS_ERRNO
-        rv = errno;
+        rv = errno;
#endif
-        proc_mutex_proc_pthread_cleanup(new_mutex);
-        return rv;
-    }
+        proc_mutex_proc_pthread_cleanup(new_mutex);
+        return rv;
+    }

-    if ((rv = pthread_mutex_init(new_mutex->pthread_interproc, &mattr))) {
+    if ((rv = pthread_mutex_init(new_mutex->pthread_interproc, &mattr))) {
#ifdef PTHREAD_SETS_ERRNO
        rv = errno;
#endif
@@ -833,10 +830,8 @@
{
    apr_status_t rv;

-    if (new_mutex->scope != APR_INTRAPROCESS) {
-        if ((rv = proc_mutex_choose_method(new_mutex, mech)) != 
APR_SUCCESS) {
-            return rv;
-        }
+    if ((rv = proc_mutex_choose_method(new_mutex, mech)) != APR_SUCCESS) {
+        return rv;
    }

    new_mutex->meth = new_mutex->inter_meth;




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message