condition, or a server crash or restart while
processing the request.
+ junk-response retry when the server returned something not looking
+ like a complete HTTP response. This includes partial
+ responses headers as well as non-HTTP contents. It
+ usually is a bad idea to retry on such events, which
+ may be caused a configuration issue (wrong server port)
+ or by the request being harmful to the server (buffer
+ overflow attack for example).
+
response-timeout the server timeout stroke while waiting for the server
to respond to the request. This may be caused by poor
network condition, the reuse of an idle connection
* reserved for eventual future status codes
*/
#define PR_RE_EARLY_ERROR 0x00010000 /* Retry if we failed at sending early data */
+#define PR_RE_JUNK_REQUEST 0x00020000 /* We received an incomplete or garbage response */
struct stream;
struct http_snapshot {
_HA_ATOMIC_ADD(&__objt_server(s->target)->counters.failed_resp, 1);
health_adjust(__objt_server(s->target), HANA_STATUS_HTTP_HDRRSP);
}
+ if ((s->be->retry_type & PR_RE_JUNK_REQUEST) &&
+ do_l7_retry(s, si_b) == 0)
+ return 0;
txn->status = 502;
s->si[1].flags |= SI_FL_NOLINGER;
htx_reply_and_close(s, txn->status, htx_error_message(s));
curpx->retry_type |= PR_RE_504;
else if (!strcmp(args[i], "0rtt-rejected"))
curpx->retry_type |= PR_RE_EARLY_ERROR;
+ else if (!strcmp(args[i], "junk-response"))
+ curpx->retry_type |= PR_RE_JUNK_REQUEST;
else if (!strcmp(args[i], "none")) {
if (i != 1 || *args[i + 1]) {
memprintf(err, "'%s' 'none' keyworld only usable alone", args[0]);