diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
---|---|---|
committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
commit | 1b67dd855c41f5a0cda7ec2a68d98071986ca703 (patch) | |
tree | ab243607f74f78200787bba5b9b88f07ef1b966f /indra/llcorehttp/_httpoprequest.h | |
parent | 6d6eabca44d08d5b97bfe3e941d2b9687c2246ea (diff) | |
parent | e1623bb276f83a43ce7a197e388720c05bdefe61 (diff) |
Merge remote-tracking branch 'origin/main' into DRTVWR-600-maint-A
# Conflicts:
# autobuild.xml
# indra/cmake/CMakeLists.txt
# indra/cmake/GoogleMock.cmake
# indra/llaudio/llaudioengine_fmodstudio.cpp
# indra/llaudio/llaudioengine_fmodstudio.h
# indra/llaudio/lllistener_fmodstudio.cpp
# indra/llaudio/lllistener_fmodstudio.h
# indra/llaudio/llstreamingaudio_fmodstudio.cpp
# indra/llaudio/llstreamingaudio_fmodstudio.h
# indra/llcharacter/llmultigesture.cpp
# indra/llcharacter/llmultigesture.h
# indra/llimage/llimage.cpp
# indra/llimage/llimagepng.cpp
# indra/llimage/llimageworker.cpp
# indra/llimage/tests/llimageworker_test.cpp
# indra/llmessage/tests/llmockhttpclient.h
# indra/llprimitive/llgltfmaterial.h
# indra/llrender/llfontfreetype.cpp
# indra/llui/llcombobox.cpp
# indra/llui/llfolderview.cpp
# indra/llui/llfolderviewmodel.h
# indra/llui/lllineeditor.cpp
# indra/llui/lllineeditor.h
# indra/llui/lltextbase.cpp
# indra/llui/lltextbase.h
# indra/llui/lltexteditor.cpp
# indra/llui/lltextvalidate.cpp
# indra/llui/lltextvalidate.h
# indra/llui/lluictrl.h
# indra/llui/llview.cpp
# indra/llwindow/llwindowmacosx.cpp
# indra/newview/app_settings/settings.xml
# indra/newview/llappearancemgr.cpp
# indra/newview/llappearancemgr.h
# indra/newview/llavatarpropertiesprocessor.cpp
# indra/newview/llavatarpropertiesprocessor.h
# indra/newview/llbreadcrumbview.cpp
# indra/newview/llbreadcrumbview.h
# indra/newview/llbreastmotion.cpp
# indra/newview/llbreastmotion.h
# indra/newview/llconversationmodel.h
# indra/newview/lldensityctrl.cpp
# indra/newview/lldensityctrl.h
# indra/newview/llface.inl
# indra/newview/llfloatereditsky.cpp
# indra/newview/llfloatereditwater.cpp
# indra/newview/llfloateremojipicker.h
# indra/newview/llfloaterimsessiontab.cpp
# indra/newview/llfloaterprofiletexture.cpp
# indra/newview/llfloaterprofiletexture.h
# indra/newview/llgesturemgr.cpp
# indra/newview/llgesturemgr.h
# indra/newview/llimpanel.cpp
# indra/newview/llimpanel.h
# indra/newview/llinventorybridge.cpp
# indra/newview/llinventorybridge.h
# indra/newview/llinventoryclipboard.cpp
# indra/newview/llinventoryclipboard.h
# indra/newview/llinventoryfunctions.cpp
# indra/newview/llinventoryfunctions.h
# indra/newview/llinventorygallery.cpp
# indra/newview/lllistbrowser.cpp
# indra/newview/lllistbrowser.h
# indra/newview/llpanelobjectinventory.cpp
# indra/newview/llpanelprofile.cpp
# indra/newview/llpanelprofile.h
# indra/newview/llpreviewgesture.cpp
# indra/newview/llsavedsettingsglue.cpp
# indra/newview/llsavedsettingsglue.h
# indra/newview/lltooldraganddrop.cpp
# indra/newview/llurllineeditorctrl.cpp
# indra/newview/llvectorperfoptions.cpp
# indra/newview/llvectorperfoptions.h
# indra/newview/llviewerparceloverlay.cpp
# indra/newview/llviewertexlayer.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/macmain.h
# indra/test/test.cpp
Diffstat (limited to 'indra/llcorehttp/_httpoprequest.h')
-rw-r--r-- | indra/llcorehttp/_httpoprequest.h | 222 |
1 files changed, 111 insertions, 111 deletions
diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index 626064329d..b029bc740c 100644 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -24,11 +24,11 @@ * $/LicenseInfo$ */ -#ifndef _LLCORE_HTTP_OPREQUEST_H_ -#define _LLCORE_HTTP_OPREQUEST_H_ +#ifndef _LLCORE_HTTP_OPREQUEST_H_ +#define _LLCORE_HTTP_OPREQUEST_H_ -#include "linden_common.h" // Modifies curl/curl.h interfaces +#include "linden_common.h" // Modifies curl/curl.h interfaces #include <string> #include <curl/curl.h> @@ -68,65 +68,65 @@ class HttpOpRequest : public HttpOperation public: typedef std::shared_ptr<HttpOpRequest> ptr_t; - HttpOpRequest(); + HttpOpRequest(); - virtual ~HttpOpRequest(); // Use release() + virtual ~HttpOpRequest(); // Use release() private: - HttpOpRequest(const HttpOpRequest &); // Not defined - void operator=(const HttpOpRequest &); // Not defined + HttpOpRequest(const HttpOpRequest &); // Not defined + void operator=(const HttpOpRequest &); // Not defined public: - enum EMethod - { - HOR_GET, - HOR_POST, - HOR_PUT, + enum EMethod + { + HOR_GET, + HOR_POST, + HOR_PUT, HOR_DELETE, HOR_PATCH, HOR_COPY, HOR_MOVE - }; + }; static std::string methodToString(const EMethod &); - virtual void stageFromRequest(HttpService *); - virtual void stageFromReady(HttpService *); - virtual void stageFromActive(HttpService *); + virtual void stageFromRequest(HttpService *); + virtual void stageFromReady(HttpService *); + virtual void stageFromActive(HttpService *); + + virtual void visitNotifier(HttpRequest * request); - virtual void visitNotifier(HttpRequest * request); - public: - /// Setup Methods - /// - /// Basically an RPC setup for each type of HTTP method - /// invocation with one per method type. These are - /// generally invoked right after construction. - /// - /// Threading: called by application thread - /// - HttpStatus setupGet(HttpRequest::policy_t policy_id, - const std::string & url, - const HttpOptions::ptr_t & options, - const HttpHeaders::ptr_t & headers); - - HttpStatus setupGetByteRange(HttpRequest::policy_t policy_id, - const std::string & url, - size_t offset, - size_t len, + /// Setup Methods + /// + /// Basically an RPC setup for each type of HTTP method + /// invocation with one per method type. These are + /// generally invoked right after construction. + /// + /// Threading: called by application thread + /// + HttpStatus setupGet(HttpRequest::policy_t policy_id, + const std::string & url, + const HttpOptions::ptr_t & options, + const HttpHeaders::ptr_t & headers); + + HttpStatus setupGetByteRange(HttpRequest::policy_t policy_id, + const std::string & url, + size_t offset, + size_t len, const HttpOptions::ptr_t & options, - const HttpHeaders::ptr_t & headers); - - HttpStatus setupPost(HttpRequest::policy_t policy_id, - const std::string & url, - BufferArray * body, + const HttpHeaders::ptr_t & headers); + + HttpStatus setupPost(HttpRequest::policy_t policy_id, + const std::string & url, + BufferArray * body, const HttpOptions::ptr_t & options, - const HttpHeaders::ptr_t & headers); - - HttpStatus setupPut(HttpRequest::policy_t policy_id, - const std::string & url, - BufferArray * body, + const HttpHeaders::ptr_t & headers); + + HttpStatus setupPut(HttpRequest::policy_t policy_id, + const std::string & url, + BufferArray * body, const HttpOptions::ptr_t & options, - const HttpHeaders::ptr_t & headers); + const HttpHeaders::ptr_t & headers); HttpStatus setupDelete(HttpRequest::policy_t policy_id, const std::string & url, @@ -150,82 +150,82 @@ public: const HttpHeaders::ptr_t & headers); // Internal method used to setup the libcurl options for a request. - // Does all the libcurl handle setup in one place. - // - // Threading: called by worker thread - // - HttpStatus prepareRequest(HttpService * service); - - virtual HttpStatus cancel(); + // Does all the libcurl handle setup in one place. + // + // Threading: called by worker thread + // + HttpStatus prepareRequest(HttpService * service); + + virtual HttpStatus cancel(); protected: - // Common setup for all the request methods. - // - // Threading: called by application thread - // - void setupCommon(HttpRequest::policy_t policy_id, - const std::string & url, - BufferArray * body, + // Common setup for all the request methods. + // + // Threading: called by application thread + // + void setupCommon(HttpRequest::policy_t policy_id, + const std::string & url, + BufferArray * body, const HttpOptions::ptr_t & options, - const HttpHeaders::ptr_t & headers); - - // libcurl operational callbacks - // - // Threading: called by worker thread - // - static size_t writeCallback(void * data, size_t size, size_t nmemb, void * userdata); - static size_t readCallback(void * data, size_t size, size_t nmemb, void * userdata); + const HttpHeaders::ptr_t & headers); + + // libcurl operational callbacks + // + // Threading: called by worker thread + // + static size_t writeCallback(void * data, size_t size, size_t nmemb, void * userdata); + static size_t readCallback(void * data, size_t size, size_t nmemb, void * userdata); static int seekCallback(void *data, curl_off_t offset, int origin); - static size_t headerCallback(void * data, size_t size, size_t nmemb, void * userdata); - static CURLcode curlSslCtxCallback(CURL *curl, void *ssl_ctx, void *userptr); - static int sslCertVerifyCallback(X509_STORE_CTX *ctx, void *param); + static size_t headerCallback(void * data, size_t size, size_t nmemb, void * userdata); + static CURLcode curlSslCtxCallback(CURL *curl, void *ssl_ctx, void *userptr); + static int sslCertVerifyCallback(X509_STORE_CTX *ctx, void *param); - static int debugCallback(CURL *, curl_infotype info, char * buffer, size_t len, void * userdata); + static int debugCallback(CURL *, curl_infotype info, char * buffer, size_t len, void * userdata); protected: - unsigned int mProcFlags; - static const unsigned int PF_SCAN_RANGE_HEADER = 0x00000001U; - static const unsigned int PF_SAVE_HEADERS = 0x00000002U; - static const unsigned int PF_USE_RETRY_AFTER = 0x00000004U; + unsigned int mProcFlags; + static const unsigned int PF_SCAN_RANGE_HEADER = 0x00000001U; + static const unsigned int PF_SAVE_HEADERS = 0x00000002U; + static const unsigned int PF_USE_RETRY_AFTER = 0x00000004U; - HttpRequest::policyCallback_t mCallbackSSLVerify; + HttpRequest::policyCallback_t mCallbackSSLVerify; public: - // Request data - EMethod mReqMethod; - std::string mReqURL; - BufferArray * mReqBody; - off_t mReqOffset; - size_t mReqLength; - HttpHeaders::ptr_t mReqHeaders; + // Request data + EMethod mReqMethod; + std::string mReqURL; + BufferArray * mReqBody; + off_t mReqOffset; + size_t mReqLength; + HttpHeaders::ptr_t mReqHeaders; HttpOptions::ptr_t mReqOptions; - // Transport data - bool mCurlActive; - CURL * mCurlHandle; - HttpService * mCurlService; - curl_slist * mCurlHeaders; - size_t mCurlBodyPos; - char * mCurlTemp; // Scratch buffer for header processing - size_t mCurlTempLen; - - // Result data - HttpStatus mStatus; - BufferArray * mReplyBody; - off_t mReplyOffset; - size_t mReplyLength; - size_t mReplyFullLength; - HttpHeaders::ptr_t mReplyHeaders; - std::string mReplyConType; - int mReplyRetryAfter; - - // Policy data - int mPolicyRetries; - int mPolicy503Retries; - HttpTime mPolicyRetryAt; - int mPolicyRetryLimit; - HttpTime mPolicyMinRetryBackoff; // initial delay between retries (mcs) - HttpTime mPolicyMaxRetryBackoff; + // Transport data + bool mCurlActive; + CURL * mCurlHandle; + HttpService * mCurlService; + curl_slist * mCurlHeaders; + size_t mCurlBodyPos; + char * mCurlTemp; // Scratch buffer for header processing + size_t mCurlTempLen; + + // Result data + HttpStatus mStatus; + BufferArray * mReplyBody; + off_t mReplyOffset; + size_t mReplyLength; + size_t mReplyFullLength; + HttpHeaders::ptr_t mReplyHeaders; + std::string mReplyConType; + int mReplyRetryAfter; + + // Policy data + int mPolicyRetries; + int mPolicy503Retries; + HttpTime mPolicyRetryAt; + int mPolicyRetryLimit; + HttpTime mPolicyMinRetryBackoff; // initial delay between retries (mcs) + HttpTime mPolicyMaxRetryBackoff; }; // end class HttpOpRequest @@ -240,5 +240,5 @@ curl_slist * append_headers_to_slist(const HttpHeaders::ptr_t &, curl_slist * sl } // end namespace LLCore -#endif // _LLCORE_HTTP_OPREQUEST_H_ +#endif // _LLCORE_HTTP_OPREQUEST_H_ |