Thread

  1. non blocking mode bug?

    Erik Hofman <erik@ehofman.com> — 2001-02-15T11:10:46Z

    
    Hi,
    
    I realy get into problems witht his one.
    
    I've made an Irix nss library which connects to postgresql.
    But somehow the backend doesn;t get into active status.
    
    The blocking PQconnectdb halts until timeout (if i ignore the
    errormessage, the results return right after the timeout has expired).
    
    By using the non blocking function PQconnectStart() and using a callback
    function and the select() mainloop of the nss daemon, the status of
    PQconnectPoll() doesn't turn into PGRESS_POLLING_OK.
    
    In the callback routine I check for PGRESS_POLLING_OK, but it never gets
    active!
    
    I put this little piece of code in the callback function for testing,
    but the syslogs says this routine is called 6300 times before timeout.
    
    It seems libpq is sending data to the socket as if it were ready, but it
    doesn't get the PGRESS_POLLING_OK status!
    
    nsd_callback_remove(PQsocket(pgc));
    
    if (pgs != PGRES_POLLING_OK) {
       nsd_callback_new(PQsocket(pgc), (void *)(ns_psql_ccb(file, pgc, s)),
    NSD_READ);
       return;
    }
    nsd_timeout_remove(file);
    
    Does anybody have any idea about this problem?
    
    I might be nss_daemon or even Irix reletaed, but i don't get a way to
    check this out :(
    
    Erik