Branch: Tag:

2016-04-01

2016-04-01 01:29:32 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Ensure queries have been fully started before closing the fd.

356:    protected void destroy() {    if(nostash) {    catch { +  while(sizeof(closecallbacks)) +  foreach(closecallbacks;function(void|mixed:void) closecb;) +  closecb();    destruct(nostash);    PD("%d>Close socket\n",socket->query_fd());    socket->close(); -  foreach(closecallbacks;function(void|mixed:void) closecb;) -  closecb(); -  closecallbacks=(<>); +     };    }    connectfail=0;
515:    _ddescribe=Thread.Condition();    _ddescribemux=Thread.Mutex();    closemux=Thread.Mutex(); -  c->closecallbacks+=(<destroy>); +     portalbuffersize=_portalbuffersize;    alltext = !alltyped;    _params = params;
523:    _state = PORTALINIT;    timeout = _timeout;    gottimeout = _pgsqlsess->cancelquery; +  c->closecallbacks+=(<destroy>);    }       //! Returns the command-complete status for this query.