Branch: Tag:

2014-05-02

2014-05-02 14:54:36 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compat: 7.8::SSL: Improved robustness in destroy().

Applies the "SSL: Improved robustness in destroy()." fix from
Pike 7.8 in the Pike 7.8 compat SSL module:

The embedded stream may still be registered with a backend when the
sslfile object loses its last reference. Make sure not to trigger
the "In callback mode in a different backend." error in that case.

Fixes [bug 6958].

806:    // 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()) { +  // Make sure not to fail in ENTER below due to bad backend thread. +  // [bug 6958]. +  stream->set_backend(Pike.DefaultBackend); +  }    ENTER (0, 0) {    if (stream) {    if (close_state == STREAM_OPEN &&