https.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 Aquire 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 HttpsMethod : public pkgAcqMethod
  17. {
  18. virtual bool Fetch(FetchItem *);
  19. static size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp);
  20. static int progress_callback(void *clientp, double dltotal, double dlnow,
  21. double ultotal, double ulnow);
  22. void SetupProxy();
  23. CURL *curl;
  24. FetchResult Res;
  25. public:
  26. FileFd *File;
  27. HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig)
  28. {
  29. File = 0;
  30. curl = curl_easy_init();
  31. };
  32. };
  33. URI Proxy;
  34. #endif