diff --git a/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java b/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java --- a/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java +++ b/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java @@ -1,3 +1,5 @@ package app.comm.android.fbjni; -public class NetworkModule { public static native void sendPong(); } +public class NetworkModule { + public static native void sendPong(); +} diff --git a/scripts/get_clang_paths.js b/scripts/get_clang_paths.js --- a/scripts/get_clang_paths.js +++ b/scripts/get_clang_paths.js @@ -7,27 +7,27 @@ excludes: ['_generated'], }, { - path: 'services/tunnelbroker/docker-server/contents/server/src', + path: 'services/tunnelbroker/src', extensions: ['cpp', 'h'], }, { - path: 'services/backup/docker-server/contents/server/src', + path: 'services/tunnelbroker/test', extensions: ['cpp', 'h'], }, { - path: 'services/backup/docker-server/contents/server/test', + path: 'services/backup/src', extensions: ['cpp', 'h'], }, { - path: 'services/backup/docker-server/contents/server/dev', + path: 'services/backup/test', extensions: ['cpp', 'h'], }, { - path: 'services/blob/docker-server/contents/server/src', + path: 'services/blob/src', extensions: ['cpp', 'h'], }, { - path: 'services/blob/docker-server/contents/server/test', + path: 'services/blob/test', extensions: ['cpp', 'h'], }, { diff --git a/services/backup/src/Reactors/BaseReactor.h b/services/backup/src/Reactors/BaseReactor.h --- a/services/backup/src/Reactors/BaseReactor.h +++ b/services/backup/src/Reactors/BaseReactor.h @@ -19,8 +19,10 @@ private: grpc::Status status = grpc::Status::OK; std::mutex statusAccessMutex; + protected: ReactorState state = ReactorState::NONE; + public: grpc::Status getStatus() { const std::unique_lock lock(this->statusAccessMutex); diff --git a/services/backup/src/Reactors/client/base-reactors/ClientBidiReactorBase.h b/services/backup/src/Reactors/client/base-reactors/ClientBidiReactorBase.h --- a/services/backup/src/Reactors/client/base-reactors/ClientBidiReactorBase.h +++ b/services/backup/src/Reactors/client/base-reactors/ClientBidiReactorBase.h @@ -9,8 +9,8 @@ namespace reactor { template -class ClientBidiReactorBase - : public grpc::ClientBidiReactor, public BaseReactor { +class ClientBidiReactorBase : public grpc::ClientBidiReactor, + public BaseReactor { std::shared_ptr response = nullptr; void nextWrite(); diff --git a/services/backup/src/Reactors/client/base-reactors/ClientReadReactorBase.h b/services/backup/src/Reactors/client/base-reactors/ClientReadReactorBase.h --- a/services/backup/src/Reactors/client/base-reactors/ClientReadReactorBase.h +++ b/services/backup/src/Reactors/client/base-reactors/ClientReadReactorBase.h @@ -12,6 +12,7 @@ class ClientReadReactorBase : public grpc::ClientReadReactor, public BaseReactor { Response response; + public: Request request; grpc::ClientContext context; diff --git a/services/backup/src/Reactors/client/base-reactors/ClientWriteReactorBase.h b/services/backup/src/Reactors/client/base-reactors/ClientWriteReactorBase.h --- a/services/backup/src/Reactors/client/base-reactors/ClientWriteReactorBase.h +++ b/services/backup/src/Reactors/client/base-reactors/ClientWriteReactorBase.h @@ -14,6 +14,7 @@ Request request; void nextWrite(); + public: Response response; grpc::ClientContext context; diff --git a/services/backup/src/Reactors/client/blob/BlobAppendHolderClientReactor.h b/services/backup/src/Reactors/client/blob/BlobAppendHolderClientReactor.h --- a/services/backup/src/Reactors/client/blob/BlobAppendHolderClientReactor.h +++ b/services/backup/src/Reactors/client/blob/BlobAppendHolderClientReactor.h @@ -7,9 +7,9 @@ #include +#include #include #include -#include namespace comm { namespace network { diff --git a/services/backup/src/Reactors/server/SendLogReactor.cpp b/services/backup/src/Reactors/server/SendLogReactor.cpp --- a/services/backup/src/Reactors/server/SendLogReactor.cpp +++ b/services/backup/src/Reactors/server/SendLogReactor.cpp @@ -1,7 +1,7 @@ #include "SendLogReactor.h" -#include "DatabaseManager.h" #include "Constants.h" +#include "DatabaseManager.h" #include "Tools.h" #include diff --git a/services/backup/src/Reactors/server/base-reactors/ServerReadReactorBase.h b/services/backup/src/Reactors/server/base-reactors/ServerReadReactorBase.h --- a/services/backup/src/Reactors/server/base-reactors/ServerReadReactorBase.h +++ b/services/backup/src/Reactors/server/base-reactors/ServerReadReactorBase.h @@ -17,8 +17,10 @@ class ServerReadReactorBase : public grpc::ServerReadReactor, public BaseReactor { Request request; + protected: Response *response; + public: ServerReadReactorBase(Response *response); void OnReadDone(bool ok) override; diff --git a/services/backup/src/Reactors/server/base-reactors/ServerWriteReactorBase.h b/services/backup/src/Reactors/server/base-reactors/ServerWriteReactorBase.h --- a/services/backup/src/Reactors/server/base-reactors/ServerWriteReactorBase.h +++ b/services/backup/src/Reactors/server/base-reactors/ServerWriteReactorBase.h @@ -24,6 +24,7 @@ protected: // this is a const ref since it's not meant to be modified const Request &request; + public: ServerWriteReactorBase(const Request *request); diff --git a/services/blob/src/Reactors/server/base-reactors/ServerReadReactorBase.h b/services/blob/src/Reactors/server/base-reactors/ServerReadReactorBase.h --- a/services/blob/src/Reactors/server/base-reactors/ServerReadReactorBase.h +++ b/services/blob/src/Reactors/server/base-reactors/ServerReadReactorBase.h @@ -17,8 +17,10 @@ class ServerReadReactorBase : public grpc::ServerReadReactor, public BaseReactor { Request request; + protected: Response *response; + public: ServerReadReactorBase(Response *response); void OnReadDone(bool ok) override; diff --git a/services/blob/src/Reactors/server/base-reactors/ServerWriteReactorBase.h b/services/blob/src/Reactors/server/base-reactors/ServerWriteReactorBase.h --- a/services/blob/src/Reactors/server/base-reactors/ServerWriteReactorBase.h +++ b/services/blob/src/Reactors/server/base-reactors/ServerWriteReactorBase.h @@ -14,19 +14,23 @@ namespace reactor { template -class ServerWriteReactorBase : public grpc::ServerWriteReactor, public BaseReactor { +class ServerWriteReactorBase : public grpc::ServerWriteReactor, + public BaseReactor { Response response; bool initialized = false; void nextWrite(); + protected: // this is a const ref since it's not meant to be modified const Request &request; + public: ServerWriteReactorBase(const Request *request); void start(); - virtual void initialize() {} + virtual void initialize() { + } void OnWriteDone(bool ok) override; void terminate(const grpc::Status &status); void OnDone() override; diff --git a/services/tunnelbroker/src/Constants.h b/services/tunnelbroker/src/Constants.h --- a/services/tunnelbroker/src/Constants.h +++ b/services/tunnelbroker/src/Constants.h @@ -35,8 +35,7 @@ const std::string AMQP_HEADER_FROM_DEVICEID = "fromDeviceid"; const std::string AMQP_HEADER_TO_DEVICEID = "toDeviceid"; -const int64_t AMQP_SHORTEST_RECONNECTION_ATTEMPT_INTERVAL = - 1000 * 60; // 1 min +const int64_t AMQP_SHORTEST_RECONNECTION_ATTEMPT_INTERVAL = 1000 * 60; // 1 min // DeviceID const size_t DEVICEID_CHAR_LENGTH = 64; diff --git a/services/tunnelbroker/test/TunnelBrokerTest.cpp b/services/tunnelbroker/test/TunnelBrokerTest.cpp --- a/services/tunnelbroker/test/TunnelBrokerTest.cpp +++ b/services/tunnelbroker/test/TunnelBrokerTest.cpp @@ -1,7 +1,6 @@ #include -class TunnelBrokerTest : public testing::Test -{ +class TunnelBrokerTest : public testing::Test { protected: virtual void SetUp() { //...