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