In particular as server, the previous code might cause it to hang in
recv() if this case wasn't triggered by a close notify (followed by a
shutdown of the socket) but it e.g. failed processing a ServerHello and
responded with a fatal alert.
Fixes: 09fbaad6bd71 ("tls-socket: Don't fail reading if sending data failed")
case SUCCESS:
return TRUE;
default:
case SUCCESS:
return TRUE;
default:
- if (wr)
- {
- return FALSE;
+ if (!wr && this->app.in_done > 0)
+ { /* return data after proper termination via fatal close
+ * notify to which we responded with one */
+ this->eof = TRUE;
+ return TRUE;