pike.git / lib / modules / Sql.pmod / pgsql_util.pmod

version» Context lines:

pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:328:    towrite-=output_to(socket,towrite);    }    } while(0);    lock=started=0;    return;    };    lock=0;    catch(connectfail());    }    -  final void sendterminate() { -  Thread.MutexKey lock=i->fillreadmux->lock(); -  if(i->fillread) // Delayed close() after flushing the output buffer -  i->fillread.signal(), i->fillread=0; -  lock=0; -  } -  +     final int close() {    int ret; -  +  { Thread.MutexKey lock=i->fillreadmux->lock(); +  if(i->fillread) { // Delayed close() after flushing the output buffer +  i->fillread.signal(); +  i->fillread=0; +  lock=0; +  PD("%d>Close socket read, flush write\n",socket->query_fd()); +  ret=socket->close("r"); +  i->read_cb(socket->query_id(),0); +  return ret; +  } +  lock=0; +  }    destruct(nostash);    PD("%d>Close socket\n",socket->query_fd());    ret=socket->close(); -  sendterminate(); +     foreach(closecallbacks;function(void|mixed:void) closecb;)    closecb();    closecallbacks=(<>);    return ret;    }       protected void destroy() {    catch(close()); // Exceptions don't work inside destructors    connectfail=0;    }