]>
Commit | Line | Data |
---|---|---|
d546f98d MV |
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 | ||
ae58a985 | 6 | HTTP Acquire Method - This is the HTTP aquire method for APT. |
d546f98d MV |
7 | |
8 | ##################################################################### */ | |
9 | /*}}}*/ | |
10 | ||
f40db111 DK |
11 | #ifndef APT_HTTPS_H |
12 | #define APT_HTTPS_H | |
d546f98d | 13 | |
d546f98d MV |
14 | #include <iostream> |
15 | #include <curl/curl.h> | |
16 | ||
17 | using std::cout; | |
18 | using std::endl; | |
19 | ||
20 | class HttpsMethod; | |
472ff00e | 21 | class FileFd; |
d546f98d MV |
22 | |
23 | class HttpsMethod : public pkgAcqMethod | |
24 | { | |
5085e660 MV |
25 | // minimum speed in bytes/se that triggers download timeout handling |
26 | static const int DL_MIN_SPEED = 10; | |
d546f98d MV |
27 | |
28 | virtual bool Fetch(FetchItem *); | |
29 | static size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp); | |
30 | static int progress_callback(void *clientp, double dltotal, double dlnow, | |
31 | double ultotal, double ulnow); | |
21fd1746 | 32 | void SetupProxy(); |
d546f98d MV |
33 | CURL *curl; |
34 | FetchResult Res; | |
35 | ||
36 | public: | |
37 | FileFd *File; | |
38 | ||
39 | HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig) | |
40 | { | |
41 | File = 0; | |
42 | curl = curl_easy_init(); | |
43 | }; | |
45a9cc46 MV |
44 | |
45 | ~HttpsMethod() | |
46 | { | |
47 | curl_easy_cleanup(curl); | |
48 | }; | |
d546f98d MV |
49 | }; |
50 | ||
472ff00e | 51 | #include <apt-pkg/strutl.h> |
d546f98d MV |
52 | URI Proxy; |
53 | ||
54 | #endif |