Branch: Tag:

2014-05-02

2014-05-02 15:07:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compat: 7.8::SSL.sslfile: Improved propagation of write errors.

Applies the "SSL.sslfile: Improved propagation of write errors." fix
from Pike 7.8 in the Pike 7.8 compat SSL module:

The write callback needs to be called on write failure
if there's no close callback and even if there's data
buffered for writing.

Fixes Stdio.sendfile hanging on SSL.sslfiles where the
remote has closed the connection before reading all data.

Fixes remainder of [bug 6958].

2190:    }    }    -  else { -  if (write_callback && !sizeof (write_buffer) && !SSL_HANDSHAKING +  if (write_callback && !SSL_HANDSHAKING    && (close_state < NORMAL_CLOSE || cb_errno)) {    // errno() should return the error in the write callback - need    // to propagate it here.
2205:    return write_callback (callback_id);    }    } -  } +        if (close_state >= NORMAL_CLOSE &&    (close_packet_send_state >= CLOSE_PACKET_QUEUED_OR_DONE || cb_errno)) {