https.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. };
  35. #include <apt-pkg/strutl.h>
  36. URI Proxy;
  37. #endif