Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 apt-cacher-ng (3.2-3~bpo9+1) stretch-backports-sloppy; urgency=medium
 .
   * Straight rebuild for stretch-backports-sloppy
Author: Eduard Bloch <blade@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2019-11-14

--- apt-cacher-ng-3.2.orig/source/expiration.cc
+++ apt-cacher-ng-3.2/source/expiration.cc
@@ -806,6 +806,13 @@ bool expiration::ProcessRegular(const st
 			flags.eIdxType = EIDX_SHA256DILIST;
 			flags.vfile_ondisk = true;
 			flags.uptodate = false;
+
+			// the original source context will probably provide a viable source for
+			// this URL - it might go 404 if the whole folder is missing but then the
+			// referenced content would also be outdated/gone and not worth keeping
+			// in the cache anyway
+
+			flags.forgiveDlErrors = true;
 		}
 		// and last but not least - care only about the modern version of that index
 		m_metaFilesRel.erase(idir + "MD5SUMS");
--- apt-cacher-ng-3.2.orig/source/filereader.cc
+++ apt-cacher-ng-3.2/source/filereader.cc
@@ -31,7 +31,7 @@
 
 // must be something sensible, ratio impacts stack size by inverse power of 2
 #define BUFSIZEMIN 4095 // makes one page on i386 and should be enough for typical index files
-#define BUFSIZEMAX 16*4096
+#define BUFSIZEMAX 256*1024
 
 
 #ifdef MINIBUILD
--- apt-cacher-ng-3.2.orig/systemd/apt-cacher-ng.service.in
+++ apt-cacher-ng-3.2/systemd/apt-cacher-ng.service.in
@@ -1,6 +1,7 @@
 [Unit]
 Description=Apt-Cacher NG software download proxy
 After=network.target
+RequiresMountsFor=/var/cache/apt-cacher-ng
 
 [Service]
 # the SocketPath option can be removed if the inetd bridge functionality is not needed
