pike.git / lib / 7.8 / modules / SSL.pmod / sslfile.pike

version» Context lines:

pike.git/lib/7.8/modules/SSL.pmod/sslfile.pike:799:   //! risk blocking I/O here. You should call @[close] explicitly.   //!   //! @seealso   //! @[close]   {    SSL3_DEBUG_MSG ("SSL.sslfile->destroy()\n");       // We don't know which thread this will be called in if the refcount    // garb or the gc got here. That's not a race problem since it won't    // be registered in a backend in that case. -  if (stream && stream->query_backend()) { +  if (stream) {    // Make sure not to fail in ENTER below due to bad backend thread.    // [bug 6958]. -  stream->set_backend(Pike.DefaultBackend); +  stream->set_callbacks(0, 0, 0);    }    ENTER (0, 0) {    if (stream) {    if (close_state == STREAM_OPEN &&    // Don't bother with closing nicely if there's an error from    // an earlier operation. close() will throw an error for it.    !cb_errno) { -  set_nonblocking_keep_callbacks(); +  // We can't use our set_nonblocking() et al here, since we +  // might be associated with a backend in a different thread, +  // and update_internal_state() will install callbacks, which +  // in turn might trigger the tests in CHECK_CB_MODE(). +  stream->set_nonblocking(); // Make sure not to to block. +  nonblocking_mode = 0; // Make sure not to install any callbacks.    close (0, 0, 1);    }    else    shutdown();    }    } LEAVE;   }      string read (void|int length, void|int(0..1) not_all)   //! Read some (decrypted) data from the connection. Works like