llcorehttppolicyglobal.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * @file llcorehttppolicyglobal.h
  3. * @brief Declarations for internal class defining global policy option.
  4. *
  5. * $LicenseInfo:firstyear=2012&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2012, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef _LLCORE_HTTP_POLICY_GLOBAL_H_
  27. #define _LLCORE_HTTP_POLICY_GLOBAL_H_
  28. #include "llcorehttprequest.h"
  29. namespace LLCore
  30. {
  31. // Options struct for global policy options.
  32. //
  33. // Combines both raw blob data access with semantics-enforcing set/get
  34. // interfaces. For internal operations by the worker thread, just grab the
  35. // setting directly from instance and test/use as needed. When attached to
  36. // external APIs (the public API options interfaces) the set/get methods are
  37. // available to enforce correct ranges, data types, contexts, etc. and suitable
  38. // status values are returned.
  39. //
  40. // Threading: Single-threaded. In practice, init thread before worker starts,
  41. // worker thread after.
  42. class HttpPolicyGlobal
  43. {
  44. public:
  45. HttpPolicyGlobal();
  46. HttpPolicyGlobal& operator=(const HttpPolicyGlobal&);
  47. HttpPolicyGlobal(const HttpPolicyGlobal&) = delete;
  48. HttpStatus set(HttpRequest::EPolicyOption opt, long value);
  49. HttpStatus set(HttpRequest::EPolicyOption opt, const std::string& value);
  50. HttpStatus set(HttpRequest::EPolicyOption opt,
  51. HttpRequest::policyCallback_t value);
  52. HttpStatus get(HttpRequest::EPolicyOption opt, long* value) const;
  53. HttpStatus get(HttpRequest::EPolicyOption opt, std::string* value) const;
  54. HttpStatus get(HttpRequest::EPolicyOption opt,
  55. HttpRequest::policyCallback_t* value) const;
  56. public:
  57. long mConnectionLimit;
  58. long mTrace;
  59. long mUseLLProxy;
  60. std::string mCAPath;
  61. std::string mCAFile;
  62. std::string mHttpProxy;
  63. HttpRequest::policyCallback_t mSslCtxCallback;
  64. };
  65. } // End namespace LLCore
  66. #endif // _LLCORE_HTTP_POLICY_GLOBAL_H_