#ifndef APT_HTTP_H
#define APT_HTTP_H
-#define MAXLEN 360
-
#include <apt-pkg/strutl.h>
#include <string>
unsigned int Major;
unsigned int Minor;
unsigned int Result;
- char Code[MAXLEN];
+ char Code[360];
// These are some statistics from the last parsed header lines
unsigned long long Size;
bool HeaderLine(std::string Line);
bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
- void Reset() {Major = 0; Minor = 0; Result = 0; Size = 0; StartPos = 0;
- Encoding = Closes; time(&Date); ServerFd = -1;
- Pipeline = true;};
+ void Reset() {Major = 0; Minor = 0; Result = 0; Code[0] = '\0'; Size = 0;
+ StartPos = 0; Encoding = Closes; time(&Date); HaveContent = false;
+ State = Header; Persistent = false; ServerFd = -1;
+ Pipeline = true;};
/** \brief Result of the header acquire */
enum RunHeadersResult {
ERROR_UNRECOVERABLE,
/** \brief The server reported a error with a error content page */
ERROR_WITH_CONTENT_PAGE,
- /** \brief A error on the client side */
+ /** \brief An error on the client side */
ERROR_NOT_FROM_SERVER,
/** \brief A redirect or retry request */
TRY_AGAIN_OR_REDIRECT