/* * SessionHttpMethods.hpp * * Copyright (C) 2021 by RStudio, PBC * * Unless you have received this program directly from RStudio pursuant * to the terms of a commercial license agreement with RStudio, then * this program is licensed to you under the terms of version 3 of the * GNU Affero General Public License. This program is distributed WITHOUT * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. * */ #ifndef SESSION_HTTP_METHODS_HPP #define SESSION_HTTP_METHODS_HPP #include #include #include #include #include namespace rstudio { namespace session { class ClientEvent; namespace http_methods { enum ConnectionType { ForegroundConnection, BackgroundConnection }; bool waitForMethod(const std::string& method, const boost::function& initFunction, const boost::function& allowSuspend, core::json::JsonRpcRequest* pRequest); bool waitForMethod(const std::string& method, const ClientEvent& initEvent, const boost::function& allowSuspend, core::json::JsonRpcRequest* pRequest); void waitForMethodInitFunction(const ClientEvent& initEvent); bool isJsonRpcRequest(boost::shared_ptr ptrConnection); bool isAsyncJsonRpcRequest(boost::shared_ptr ptrConnection); void handleConnection(boost::shared_ptr ptrConnection, ConnectionType connectionType); boost::shared_ptr handleAsyncRpc(boost::shared_ptr ptrConnection); core::WaitResult startHttpConnectionListenerWithTimeout(); void registerGwtHandlers(); std::string clientVersion(); std::string nextSessionUrl(); bool protocolDebugEnabled(); core::Error initialize(); } // namespace http_methods } // namespace session } // namespace rstudio #endif