From 15e1a799147fdb5fb9471cb9e96c928b6cae31c3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 9 Apr 2013 01:12:51 +0900 Subject: [PATCH] Update TLSSession::checkDirection() doc Make it clear that TLS_WANT_READ must be returned if underlying SSL/TLS lib does not indicate I/O direction. This is because SocketCore sets wantRead_ = true when TLS_WANT_READ is returned and otherwise sets wantWrite_ = true. We only want to set wantWrite_ = true iff we have some pending data to send. --- src/TLSSession.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TLSSession.h b/src/TLSSession.h index ec06a142..42e4e1cb 100644 --- a/src/TLSSession.h +++ b/src/TLSSession.h @@ -79,8 +79,8 @@ public: // Returns TLS_WANT_READ if SSL/TLS session needs more data from // remote endpoint to proceed, or TLS_WANT_WRITE if SSL/TLS session // needs to write more data to proceed. If SSL/TLS session needs - // neither read nor write data at the moment, return value is - // undefined. + // neither read nor write data at the moment, TLS_WANT_READ must be + // returned. virtual int checkDirection() = 0; // Sends |data| with length |len|. This function returns the number