BUG/MEDIUM: http: continue to emit 503 on keep-alive to different server
Finn Arne Gangstad reported that commit 6b726adb35 ("MEDIUM: http: do
not report connection errors for second and further requests") breaks
support for serving static files by abusing the errorfile 503 statement.
Indeed, a second request over a connection sent to any server or backend
returning 503 would silently be dropped.
The proper solution consists in adding a flag on the session indicating
that the server connection was reused, and to only avoid the error code
in this case.
diff --git a/include/types/session.h b/include/types/session.h
index 9b5a5bf..02772a8 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -89,6 +89,7 @@
#define SN_IGNORE_PRST 0x00080000 /* ignore persistence */
#define SN_COMP_READY 0x00100000 /* the compression is initialized */
+#define SN_SRV_REUSED 0x00200000 /* the server-side connection was reused */
/* WARNING: if new fields are added, they must be initialized in session_accept()
* and freed in session_free() !