summaryrefslogtreecommitdiff
path: root/methods/https.h
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-10-05 10:49:34 +0200
committerMichael Vogt <mvo@debian.org>2013-10-05 10:49:34 +0200
commit0fa3c89c9e5c2c61a70c714ef8e4ac9d2b7d6ae1 (patch)
tree54a79b695d236233a3f1db0f097b646adb858208 /methods/https.h
parentb821e492d6dc4e1e8fd1f83590e12e3fbccad717 (diff)
parentbe297c7ab3c16edcbdd6afc699c73a58e545b599 (diff)
Merge remote-tracking branch 'donkult/debian/sid' into debian/sid
Diffstat (limited to 'methods/https.h')
-rw-r--r--methods/https.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/methods/https.h b/methods/https.h
index 293e288e0..8632d6d02 100644
--- a/methods/https.h
+++ b/methods/https.h
@@ -14,24 +14,53 @@
#include <iostream>
#include <curl/curl.h>
+#include "server.h"
+
using std::cout;
using std::endl;
class HttpsMethod;
class FileFd;
+class HttpsServerState : public ServerState
+{
+ protected:
+ virtual bool ReadHeaderLines(std::string &Data) { return false; }
+ virtual bool LoadNextResponse(bool const ToFile, FileFd * const File) { return false; }
+
+ public:
+ virtual bool WriteResponse(std::string const &Data) { return false; }
+
+ /** \brief Transfer the data from the socket */
+ virtual bool RunData(FileFd * const File) { return false; }
+
+ virtual bool Open() { return false; }
+ virtual bool IsOpen() { return false; }
+ virtual bool Close() { return false; }
+ virtual bool InitHashes(FileFd &File) { return false; }
+ virtual Hashes * GetHashes() { return NULL; }
+ virtual bool Die(FileFd &File) { return false; }
+ virtual bool Flush(FileFd * const File) { return false; }
+ virtual bool Go(bool ToFile, FileFd * const File) { return false; }
+
+ HttpsServerState(URI Srv, HttpsMethod *Owner);
+ virtual ~HttpsServerState() {Close();};
+};
+
class HttpsMethod : public pkgAcqMethod
{
// minimum speed in bytes/se that triggers download timeout handling
static const int DL_MIN_SPEED = 10;
virtual bool Fetch(FetchItem *);
+ static size_t parse_header(void *buffer, size_t size, size_t nmemb, void *userp);
static size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp);
static int progress_callback(void *clientp, double dltotal, double dlnow,
double ultotal, double ulnow);
void SetupProxy();
CURL *curl;
FetchResult Res;
+ HttpsServerState *Server;
public:
FileFd *File;