From 5c52b281c005e7d7a735bf2ffb6b3de14896cf2e Mon Sep 17 00:00:00 2001 From: Stepan Palamarchuk Date: Mon, 7 Nov 2016 12:37:52 -0800 Subject: [PATCH] Remove noexcept from AsyncSocket::prepareReadBuffer Summary: `prepareReadBuffer` is calling a callback function that is not a noexcept also `prepareReadBuffer` is being called only from one place, that wraps this function call with try/catch. Reviewed By: jmswen Differential Revision: D4138424 fbshipit-source-id: a05bdd6f741761567a7d0291017c285b0bf15522 --- folly/io/async/AsyncSSLSocket.cpp | 2 +- folly/io/async/AsyncSSLSocket.h | 2 +- folly/io/async/AsyncSocket.cpp | 2 +- folly/io/async/AsyncSocket.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/folly/io/async/AsyncSSLSocket.cpp b/folly/io/async/AsyncSSLSocket.cpp index 8a07c41d..8804b8d1 100644 --- a/folly/io/async/AsyncSSLSocket.cpp +++ b/folly/io/async/AsyncSSLSocket.cpp @@ -1180,7 +1180,7 @@ void AsyncSSLSocket::setBufferMovableEnabled(bool enabled) { bufferMovableEnabled_ = enabled; } -void AsyncSSLSocket::prepareReadBuffer(void** buf, size_t* buflen) noexcept { +void AsyncSSLSocket::prepareReadBuffer(void** buf, size_t* buflen) { CHECK(readCallback_); if (isBufferMovable_) { *buf = nullptr; diff --git a/folly/io/async/AsyncSSLSocket.h b/folly/io/async/AsyncSSLSocket.h index f2f9e7e7..6f8b1464 100644 --- a/folly/io/async/AsyncSSLSocket.h +++ b/folly/io/async/AsyncSSLSocket.h @@ -668,7 +668,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { // Inherit event notification methods from AsyncSocket except // the following. - void prepareReadBuffer(void** buf, size_t* buflen) noexcept override; + void prepareReadBuffer(void** buf, size_t* buflen) override; void handleRead() noexcept override; void handleWrite() noexcept override; void handleAccept() noexcept; diff --git a/folly/io/async/AsyncSocket.cpp b/folly/io/async/AsyncSocket.cpp index b1bbba24..652f90f5 100644 --- a/folly/io/async/AsyncSocket.cpp +++ b/folly/io/async/AsyncSocket.cpp @@ -1333,7 +1333,7 @@ AsyncSocket::performRead(void** buf, size_t* buflen, size_t* /* offset */) { } } -void AsyncSocket::prepareReadBuffer(void** buf, size_t* buflen) noexcept { +void AsyncSocket::prepareReadBuffer(void** buf, size_t* buflen) { // no matter what, buffer should be preapared for non-ssl socket CHECK(readCallback_); readCallback_->getReadBuffer(buf, buflen); diff --git a/folly/io/async/AsyncSocket.h b/folly/io/async/AsyncSocket.h index 30ae8d84..3f5d715d 100644 --- a/folly/io/async/AsyncSocket.h +++ b/folly/io/async/AsyncSocket.h @@ -767,7 +767,7 @@ class AsyncSocket : virtual public AsyncTransportWrapper { void ioReady(uint16_t events) noexcept; virtual void checkForImmediateRead() noexcept; virtual void handleInitialReadWrite() noexcept; - virtual void prepareReadBuffer(void** buf, size_t* buflen) noexcept; + virtual void prepareReadBuffer(void** buf, size_t* buflen); virtual void handleRead() noexcept; virtual void handleWrite() noexcept; virtual void handleConnect() noexcept; -- 2.34.1