https.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
  3. // $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
  4. /* ######################################################################
  5. HTTP Acquire Method - This is the HTTP aquire method for APT.
  6. ##################################################################### */
  7. /*}}}*/
  8. #ifndef APT_HTTPS_H
  9. #define APT_HTTPS_H
  10. #include <iostream>
  11. #include <curl/curl.h>
  12. using std::cout;
  13. using std::endl;
  14. class HttpsMethod;
  15. class FileFd;
  16. class HttpsMethod : public pkgAcqMethod
  17. {
  18. // minimum speed in bytes/se that triggers download timeout handling
  19. static const int DL_MIN_SPEED = 10;
  20. virtual bool Fetch(FetchItem *);
  21. static size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp);
  22. static int progress_callback(void *clientp, double dltotal, double dlnow,
  23. double ultotal, double ulnow);
  24. void SetupProxy();
  25. CURL *curl;
  26. FetchResult Res;
  27. public:
  28. FileFd *File;
  29. HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig)
  30. {
  31. File = 0;
  32. curl = curl_easy_init();
  33. };
  34. ~HttpsMethod()
  35. {
  36. curl_easy_cleanup(curl);
  37. };
  38. };
  39. #include <apt-pkg/strutl.h>
  40. URI Proxy;
  41. #endif