Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef HTTP_H
  5. #define HTTP_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //--------------------------------------------------------------------------------------------------------------
  10. /**
  11. * Status of the download thread, as set in RequestContext::status.
  12. */
  13. enum HTTPStatus_t
  14. {
  15. HTTP_INVALID = -1,
  16. HTTP_CONNECTING = 0,///< This is set in the main thread before the download thread starts.
  17. HTTP_FETCH, ///< The download thread sets this when it starts reading data.
  18. HTTP_DONE, ///< The download thread sets this if it has read all the data successfully.
  19. HTTP_ABORTED, ///< The download thread sets this if it aborts because it's RequestContext::shouldStop has been set.
  20. HTTP_ERROR ///< The download thread sets this if there is an error connecting or downloading. Partial data may be present, so the main thread can check.
  21. };
  22. //--------------------------------------------------------------------------------------------------------------
  23. /**
  24. * Error encountered in the download thread, as set in RequestContext::error.
  25. */
  26. enum HTTPError_t
  27. {
  28. HTTP_ERROR_NONE = 0,
  29. HTTP_ERROR_ZERO_LENGTH_FILE,
  30. HTTP_ERROR_CONNECTION_CLOSED,
  31. HTTP_ERROR_INVALID_URL, ///< InternetCrackUrl failed
  32. HTTP_ERROR_INVALID_PROTOCOL, ///< URL didn't start with http:// or https://
  33. HTTP_ERROR_CANT_BIND_SOCKET,
  34. HTTP_ERROR_CANT_CONNECT,
  35. HTTP_ERROR_NO_HEADERS, ///< Cannot read HTTP headers
  36. HTTP_ERROR_FILE_NONEXISTENT,
  37. HTTP_ERROR_MAX
  38. };
  39. #endif // HTTP_H