diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-04-10 12:34:15 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2020-04-10 13:58:00 +0200 |
commit | 28a9c4dc05646f32883387bd071ac79e853044d5 (patch) | |
tree | fe093b7de0ace4b13a8cfea83710acac8225f61f /net | |
parent | bc9f0579e3d78bbe9bcd92e769b9cfcf6698e650 (diff) |
Poll - cleanup method naming, and fix merge issues.
This mends several problems from commit
5710c8632383e92372e1d81b6e26acc975e25ec4.
Change-Id: I1b29f29ca81679608a2692488fa1ef22b2e62dfd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92032
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/DelaySocket.cpp | 4 | ||||
-rw-r--r-- | net/ServerSocket.hpp | 4 | ||||
-rw-r--r-- | net/Socket.cpp | 6 | ||||
-rw-r--r-- | net/Socket.hpp | 18 | ||||
-rw-r--r-- | net/SslSocket.hpp | 6 | ||||
-rw-r--r-- | net/WebSocketHandler.hpp | 2 |
6 files changed, 20 insertions, 20 deletions
diff --git a/net/DelaySocket.cpp b/net/DelaySocket.cpp index b07b46cc4..fe9478bca 100644 --- a/net/DelaySocket.cpp +++ b/net/DelaySocket.cpp @@ -77,8 +77,8 @@ public: // FIXME - really need to propagate 'noDelay' etc. // have a debug only lookup of delayed sockets for this case ? - int pgetPollEvents(std::chrono::steady_clock::time_point now, - int64_t &timeoutMaxMicroS) override + int getPollEvents(std::chrono::steady_clock::time_point now, + int64_t &timeoutMaxMicroS) override { if (_chunks.size() > 0) { diff --git a/net/ServerSocket.hpp b/net/ServerSocket.hpp index 65f826913..5316d3318 100644 --- a/net/ServerSocket.hpp +++ b/net/ServerSocket.hpp @@ -65,8 +65,8 @@ public: /// Returns a valid Socket shared_ptr on success only. virtual std::shared_ptr<Socket> accept(); - int pgetPollEvents(std::chrono::steady_clock::time_point /* now */, - int64_t & /* timeoutMaxMicroS */) override + int getPollEvents(std::chrono::steady_clock::time_point /* now */, + int64_t & /* timeoutMaxMicroS */) override { return POLLIN; } diff --git a/net/Socket.cpp b/net/Socket.cpp index 47ae1ad41..372f9ea1a 100644 --- a/net/Socket.cpp +++ b/net/Socket.cpp @@ -194,7 +194,7 @@ void SocketPoll::pollingThreadEntry() LOG_INF("Finished polling thread [" << _name << "]."); } -int SocketPoll::ppoll(int64_t timeoutMaxMicroS) +int SocketPoll::poll(int64_t timeoutMaxMicroS) { if (_runOnClientThread) checkAndReThread(); @@ -205,7 +205,7 @@ int SocketPoll::ppoll(int64_t timeoutMaxMicroS) std::chrono::steady_clock::now(); // The events to poll on change each spin of the loop. - psetupPollFds(now, timeoutMaxMicroS); + setupPollFds(now, timeoutMaxMicroS); const size_t size = _pollSockets.size(); int rc; @@ -529,7 +529,7 @@ void WebSocketHandler::dumpState(std::ostream& os) void StreamSocket::dumpState(std::ostream& os) { int64_t timeoutMaxMicroS = SocketPoll::DefaultPollTimeoutMicroS; - int events = pgetPollEvents(std::chrono::steady_clock::now(), timeoutMaxMicroS); + int events = getPollEvents(std::chrono::steady_clock::now(), timeoutMaxMicroS); os << "\t" << getFD() << "\t" << events << "\t" << _inBuffer.size() << "\t" << _outBuffer.size() << "\t" << " r: " << _bytesRecvd << "\t w: " << _bytesSent << "\t" diff --git a/net/Socket.hpp b/net/Socket.hpp index 852012424..199ea0a09 100644 --- a/net/Socket.hpp +++ b/net/Socket.hpp @@ -154,7 +154,7 @@ public: /// Prepare our poll record; adjust @timeoutMaxMs downwards /// for timeouts, based on current time @now. /// @returns POLLIN and POLLOUT if output is expected. - virtual int pgetPollEvents(std::chrono::steady_clock::time_point now, + virtual int getPollEvents(std::chrono::steady_clock::time_point now, int64_t &timeoutMaxMicroS) = 0; /// Handle results of events returned from poll @@ -370,8 +370,8 @@ public: /// Prepare our poll record; adjust @timeoutMaxMs downwards /// for timeouts, based on current time @now. /// @returns POLLIN and POLLOUT if output is expected. - virtual int pgetPollEvents(std::chrono::steady_clock::time_point now, - int64_t &timeoutMaxMicroS) = 0; + virtual int getPollEvents(std::chrono::steady_clock::time_point now, + int64_t &timeoutMaxMicroS) = 0; /// Do we need to handle a timeout ? virtual void checkTimeout(std::chrono::steady_clock::time_point /* now */) {} @@ -533,7 +533,7 @@ public: { while (continuePolling()) { - ppoll(DefaultPollTimeoutMicroS); + poll(DefaultPollTimeoutMicroS); } } @@ -576,7 +576,7 @@ public: /// Poll the sockets for available data to read or buffer to write. /// Returns the return-value of poll(2): 0 on timeout, /// -1 for error, and otherwise the number of events signalled. - int ppoll(int64_t timeoutMaxMicroS); + int poll(int64_t timeoutMaxMicroS); /// Write to a wakeup descriptor static void wakeup (int fd) @@ -695,7 +695,7 @@ private: const std::string &pathAndQuery); /// Initialize the poll fds array with the right events - void psetupPollFds(std::chrono::steady_clock::time_point now, + void setupPollFds(std::chrono::steady_clock::time_point now, int64_t &timeoutMaxMicroS) { const size_t size = _pollSockets.size(); @@ -704,7 +704,7 @@ private: for (size_t i = 0; i < size; ++i) { - int events = _pollSockets[i]->pgetPollEvents(now, timeoutMaxMicroS); + int events = _pollSockets[i]->getPollEvents(now, timeoutMaxMicroS); assert(events >= 0); // Or > 0 even? _pollFds[i].fd = _pollSockets[i]->getFD(); _pollFds[i].events = events; @@ -804,12 +804,12 @@ public: Socket::shutdown(); } - int pgetPollEvents(std::chrono::steady_clock::time_point now, + int getPollEvents(std::chrono::steady_clock::time_point now, int64_t &timeoutMaxMicroS) override { // cf. SslSocket::getPollEvents assertCorrectThread(); - int events = _socketHandler->pgetPollEvents(now, timeoutMaxMicroS); + int events = _socketHandler->getPollEvents(now, timeoutMaxMicroS); if (!_outBuffer.empty() || _shutdownSignalled) events |= POLLOUT; return events; diff --git a/net/SslSocket.hpp b/net/SslSocket.hpp index e6b7f908f..e7853c33f 100644 --- a/net/SslSocket.hpp +++ b/net/SslSocket.hpp @@ -126,11 +126,11 @@ public: return handleSslState(SSL_write(_ssl, buf, len)); } - int pgetPollEvents(std::chrono::steady_clock::time_point now, - int64_t & timeoutMaxMicroS) override + int getPollEvents(std::chrono::steady_clock::time_point now, + int64_t & timeoutMaxMicroS) override { assertCorrectThread(); - int events = getSocketHandler()->pgetPollEvents(now, timeoutMaxMicroS); + int events = getSocketHandler()->getPollEvents(now, timeoutMaxMicroS); if (_sslWantsTo == SslWantsTo::Read) { diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp index 24c3a839a..83a3fa244 100644 --- a/net/WebSocketHandler.hpp +++ b/net/WebSocketHandler.hpp @@ -430,7 +430,7 @@ public: } } - int pgetPollEvents(std::chrono::steady_clock::time_point now, + int getPollEvents(std::chrono::steady_clock::time_point now, int64_t & timeoutMaxMicroS) override { if (!_isClient) |