Summary: before the first setReadCallback(), the readCallback_ is nullptr. Thanks @siyengar for pointing out this!
Reviewed By: @siyengar
Differential Revision:
D2203489
void AsyncSSLSocket::setReadCB(ReadCallback *callback) {
#ifdef SSL_MODE_MOVE_BUFFER_OWNERSHIP
// turn on the buffer movable in openssl
- if (!isBufferMovable_ && readCallback_->isBufferMovable()) {
+ if (!isBufferMovable_ && callback != nullptr && callback->isBufferMovable()) {
SSL_set_mode(ssl_, SSL_get_mode(ssl_) | SSL_MODE_MOVE_BUFFER_OWNERSHIP);
isBufferMovable_ = true;
}
return minWriteSize_;
}
+ void setReadCB(ReadCallback* callback) override;
+
private:
void init();
// Inherit event notification methods from AsyncSocket except
// the following.
- void setReadCB(ReadCallback* callback) override;
void prepareReadBuffer(void** buf, size_t* buflen) noexcept override;
void handleRead() noexcept override;
void handleWrite() noexcept override;