summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-06-12 08:36:58 +0200
committerMichael Vogt <mvo@debian.org>2014-06-12 08:36:58 +0200
commitcfc7f735774ba30dbee1897248f8dfedf0229a4c (patch)
treeb4e0ac29a6b398045a803e890f5cdabcca189d6a /methods/http.cc
parenta0187f0f82a184b850b05b62e5a59b6a2055a506 (diff)
parent7701680af12a2c1a65121533c6ebcd635c013c25 (diff)
Merge tag '1.0.1ubuntu2' into ubuntu/trusty
Conflicts: configure.ac debian/changelog debian/control test/integration/framework
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc32
1 files changed, 12 insertions, 20 deletions
diff --git a/methods/http.cc b/methods/http.cc
index 42b31beeb..ed6e3517d 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -33,24 +33,21 @@
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/netrc.h>
+#include <apt-pkg/strutl.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <sys/select.h>
+#include <cstring>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
-#include <signal.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
-#include <climits>
#include <iostream>
-#include <map>
-
-// Internet stuff
-#include <netdb.h>
#include "config.h"
#include "connect.h"
-#include "rfc2553emu.h"
#include "http.h"
#include <apti18n.h>
@@ -61,7 +58,7 @@ unsigned long long CircleBuf::BwReadLimit=0;
unsigned long long CircleBuf::BwTickReadData=0;
struct timeval CircleBuf::BwReadTick={0,0};
const unsigned int CircleBuf::BW_HZ=10;
-
+
// CircleBuf::CircleBuf - Circular input buffer /*{{{*/
// ---------------------------------------------------------------------
/* */
@@ -87,8 +84,8 @@ void CircleBuf::Reset()
{
delete Hash;
Hash = new Hashes;
- }
-};
+ }
+}
/*}}}*/
// CircleBuf::Read - Read from a FD into the circular buffer /*{{{*/
// ---------------------------------------------------------------------
@@ -473,7 +470,7 @@ bool HttpServerState::WriteResponse(const std::string &Data) /*{{{*/
return Out.Read(Data);
}
/*}}}*/
-bool HttpServerState::IsOpen() /*{{{*/
+APT_PURE bool HttpServerState::IsOpen() /*{{{*/
{
return (ServerFd != -1);
}
@@ -484,16 +481,11 @@ bool HttpServerState::InitHashes(FileFd &File) /*{{{*/
In.Hash = new Hashes;
// Set the expected size and read file for the hashes
- if (StartPos >= 0)
- {
- File.Truncate(StartPos);
-
- return In.Hash->AddFD(File, StartPos);
- }
- return true;
+ File.Truncate(StartPos);
+ return In.Hash->AddFD(File, StartPos);
}
/*}}}*/
-Hashes * HttpServerState::GetHashes() /*{{{*/
+APT_PURE Hashes * HttpServerState::GetHashes() /*{{{*/
{
return In.Hash;
}