Dear all,

                I’d like to provide you with very few examples to explain
what I was talking about:

 

These problems manifested themselves in the Win64 version

 

driver.c

 

void

NsWaitDriversShutdown(Ns_Time *toPtr)

{

    Driver *drvPtr = firstDrvPtr;

    int status = NS_OK;

 

    while (drvPtr != NULL) {

                Ns_MutexLock(&drvPtr->lock);

        while (!(drvPtr->flags & DRIVER_STOPPED) && status == NS_OK) {

                    status = Ns_CondTimedWait(&drvPtr->cond, &drvPtr->lock,
toPtr);

                }

                Ns_MutexUnlock(&drvPtr->lock);

                if (status != NS_OK) {

                    Ns_Log(Warning, "driver: shutdown timeout: %s",
drvPtr->module);

                } else {

                    Ns_Log(Notice, "driver: stopped: %s", drvPtr->module);

                    Ns_ThreadJoin(&drvPtr->thread, NULL);    ß WAITS FOREVER

                    drvPtr->thread = NULL;

                }

                drvPtr = drvPtr->nextPtr;

    }

}

 

And then:

 

static void

TriggerDriver(Driver *drvPtr)

{

    if (send(drvPtr->trigger[1], "", 1, 0) != 1) { ß ALWAYS ALWAYS RETURNS
AN ERROR

                Ns_Fatal("driver: trigger send() failed: %s",

                    ns_sockstrerror(ns_sockerrno));

    }

}

 

 

Ns.h

 

typedef struct Driver {

 

    /*

     * Visible in Ns_Driver.

     */

 

    void   *arg;                          /* Driver callback data. */

    char   *server;                   /* Virtual server name. */

    char   *module;                /* Driver module. */

    char        *name;                                /* Driver name, e.g.,
"nssock". */

    char        *location;           /* Location, e.g, "http://foo:9090"; */

    char        *address;           /* Address in location. */

    int        sendwait;               /* send() I/O timeout. */

    int        recvwait;                /* recv() I/O timeout. */

    int                       bufsize;                   /* Conn bufsize (0
for SSL) */

    int                       sndbuf;                   /* setsockopt()
SNDBUF option. */

    int                       rcvbuf;     /* setsockopt() RCVBUF option. */

 

    /*

     * Private to Driver.

     */

 

    struct Driver *nextPtr;                   /* Next in list of drivers. */

    struct NsServer *servPtr;             /* Driver virtual server. */

    char   *fullname;              /* Full name, i.e., server/module. */

    int          flags;             /* Driver state flags. */

    Ns_Thread      thread;                    /* Thread id to join on
shutdown. */

    Ns_Mutex      lock;                          /* Lock to protect lists
below. */

    Ns_Cond          cond;                        /* Cond to signal reader
threads,

                                                                     *
driver query, startup, and shutdown. */

    int        trigger[2];               /* Wakeup trigger pipe. */ ß Why is
this an int when it was a SOCKET (any justification????)

 

    Ns_DriverProc *proc;     /* Driver callback. */

    int                       opts;                         /* Driver
options. */

etc….

 

 

 

I have the feeling that we are not facing Windows specific stuff, but
somehow some general errors, mistakes that happen to manifest themselves
only on Windows (64).

 

 

Hope it clarifies the situation,

Maurizio

 



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<[email protected]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to