llcorehttppolicyclass.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * @file llcorehttppolicyclass.h
  3. * @brief Declarations for internal class defining policy class options.
  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_CLASS_H_
  27. #define _LLCORE_HTTP_POLICY_CLASS_H_
  28. #include "llcorehttprequest.h"
  29. namespace LLCore
  30. {
  31. // Options struct for per-class 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 HttpPolicyClass
  43. {
  44. public:
  45. HttpPolicyClass();
  46. HttpPolicyClass& operator=(const HttpPolicyClass&);
  47. HttpPolicyClass(const HttpPolicyClass&);
  48. HttpStatus set(HttpRequest::EPolicyOption opt, long value);
  49. HttpStatus get(HttpRequest::EPolicyOption opt, long* value) const;
  50. public:
  51. long mConnectionLimit;
  52. long mPerHostConnectionLimit;
  53. long mPipelining;
  54. long mThrottleRate;
  55. long mTrace;
  56. };
  57. } // End namespace LLCore
  58. #endif // _LLCORE_HTTP_POLICY_CLASS_H_