diff options
Diffstat (limited to 'methods')
-rw-r--r-- | methods/curl.cc | 4 | ||||
-rw-r--r-- | methods/ftp.cc | 4 | ||||
-rw-r--r-- | methods/http.cc | 16 |
3 files changed, 17 insertions, 7 deletions
diff --git a/methods/curl.cc b/methods/curl.cc index dfdd3b06b..a19318098 100644 --- a/methods/curl.cc +++ b/methods/curl.cc @@ -139,8 +139,8 @@ HttpsMethod::write_data(void *buffer, size_t size, size_t nmemb, void *userp) if (TotalWritten > me->https->Queue->MaximumSize) { me->https->SetFailReason("MaximumSizeExceeded"); - _error->Error("Writing more data than expected (%llu > %llu)", - TotalWritten, me->https->Queue->MaximumSize); + _error->Error(_("File is larger than expected (%llu > %llu). Mirror sync in progress?"), + TotalWritten, me->https->Queue->MaximumSize); return 0; } } diff --git a/methods/ftp.cc b/methods/ftp.cc index 9bfe72bc6..dd97458d0 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -940,8 +940,8 @@ bool FTPConn::Get(const char *Path,FileFd &To,unsigned long long Resume, if (MaximumSize > 0 && To.Tell() > MaximumSize) { Owner->SetFailReason("MaximumSizeExceeded"); - return _error->Error("Writing more data than expected (%llu > %llu)", - To.Tell(), MaximumSize); + return _error->Error(_("File is larger than expected (%llu > %llu). Mirror sync in progress?"), + To.Tell(), MaximumSize); } } diff --git a/methods/http.cc b/methods/http.cc index 9f01d15b3..9425145dd 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -267,6 +267,7 @@ bool CircleBuf::Write(string &Data) OutP += LeftWrite(); return true; } + /*}}}*/ // CircleBuf::Stats - Print out stats information /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -282,11 +283,12 @@ void CircleBuf::Stats() clog << "Got " << InP << " in " << Diff << " at " << InP/Diff << endl;*/ } /*}}}*/ -CircleBuf::~CircleBuf() +CircleBuf::~CircleBuf() /*{{{*/ { delete [] Buf; delete Hash; } + /*}}}*/ // UnwrapHTTPConnect - Does the HTTP CONNECT handshake /*{{{*/ // --------------------------------------------------------------------- @@ -590,7 +592,15 @@ bool HttpServerState::RunData(RequestState &Req) if (Req.JunkSize != 0) In.Limit(Req.JunkSize); else if (Req.DownloadSize != 0) + { + if (Req.MaximumSize != 0 && Req.DownloadSize > Req.MaximumSize) + { + Owner->SetFailReason("MaximumSizeExceeded"); + return _error->Error(_("File is larger than expected (%llu > %llu). Mirror sync in progress?"), + Req.DownloadSize, Req.MaximumSize); + } In.Limit(Req.DownloadSize); + } else if (Persistent == false) In.Limit(-1); @@ -827,8 +837,8 @@ bool HttpServerState::Go(bool ToFile, RequestState &Req) if (Req.MaximumSize > 0 && Req.File.IsOpen() && Req.File.Failed() == false && Req.File.Tell() > Req.MaximumSize) { Owner->SetFailReason("MaximumSizeExceeded"); - return _error->Error("Writing more data than expected (%llu > %llu)", - Req.File.Tell(), Req.MaximumSize); + return _error->Error(_("File is larger than expected (%llu > %llu). Mirror sync in progress?"), + Req.File.Tell(), Req.MaximumSize); } // Handle commands from APT |