https.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_HTTP_H
  9. #define APT_HTTP_H
  10. #define MAXLEN 360
  11. #include <iostream>
  12. #include <curl/curl.h>
  13. using std::cout;
  14. using std::endl;
  15. class HttpsMethod;
  16. class FileFd;
  17. class HttpsMethod : public pkgAcqMethod
  18. {
  19. // minimum speed in bytes/se that triggers download timeout handling
  20. static const int DL_MIN_SPEED = 10;
  21. virtual bool Fetch(FetchItem *);
  22. static size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp);
  23. static int progress_callback(void *clientp, double dltotal, double dlnow,
  24. double ultotal, double ulnow);
  25. void SetupProxy();
  26. CURL *curl;
  27. FetchResult Res;
  28. public:
  29. FileFd *File;
  30. HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig)
  31. {
  32. File = 0;
  33. curl = curl_easy_init();
  34. };
  35. };
  36. #include <apt-pkg/strutl.h>
  37. URI Proxy;
  38. #endif