summaryrefslogtreecommitdiff
path: root/methods/server.h
diff options
context:
space:
mode:
Diffstat (limited to 'methods/server.h')
-rw-r--r--methods/server.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/methods/server.h b/methods/server.h
index 4dc6a1f2f..0f45ab994 100644
--- a/methods/server.h
+++ b/methods/server.h
@@ -12,7 +12,10 @@
#define APT_SERVER_H
#include <apt-pkg/strutl.h>
+#include <apt-pkg/acquire-method.h>
+#include <time.h>
+#include <iostream>
#include <string>
using std::cout;
@@ -32,7 +35,7 @@ struct ServerState
// These are some statistics from the last parsed header lines
unsigned long long Size;
- signed long long StartPos;
+ unsigned long long StartPos;
time_t Date;
bool HaveContent;
enum {Chunked,Stream,Closes} Encoding;
@@ -62,7 +65,7 @@ struct ServerState
/** \brief IO error while retrieving */
RUN_HEADERS_IO_ERROR,
/** \brief Parse error after retrieving */
- RUN_HEADERS_PARSE_ERROR,
+ RUN_HEADERS_PARSE_ERROR
};
/** \brief Get the headers before the data */
RunHeadersResult RunHeaders(FileFd * const File);
@@ -126,7 +129,7 @@ class ServerMethod : public pkgAcqMethod
static std::string FailFile;
static int FailFd;
static time_t FailTime;
- static void SigTerm(int);
+ static APT_NORETURN void SigTerm(int);
virtual bool Configuration(std::string Message);
virtual bool Flush() { return Server->Flush(File); };
@@ -137,7 +140,7 @@ class ServerMethod : public pkgAcqMethod
virtual ServerState * CreateServerState(URI uri) = 0;
virtual void RotateDNS() = 0;
- ServerMethod(const char *Ver,unsigned long Flags = 0) : pkgAcqMethod(Ver, Flags), PipelineDepth(0), AllowRedirect(false), Debug(false) {};
+ ServerMethod(const char *Ver,unsigned long Flags = 0) : pkgAcqMethod(Ver, Flags), Server(NULL), File(NULL), PipelineDepth(0), AllowRedirect(false), Debug(false) {};
virtual ~ServerMethod() {};
};