]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: muxes: Add exit status for errors about not implemented features
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 7 Dec 2020 10:24:37 +0000 (11:24 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Jan 2021 14:21:12 +0000 (15:21 +0100)
The MUX_ES_NOTIMPL_ERR exit status is added to allow the multiplexers to
report errors about not implemented features. This will be used by the H1
mux to return 501-not-implemented errors.

include/haproxy/connection-t.h
src/log.c

index 62bb81441250dbf001773ebf866d0152b6cd0421..7fa0611e44417088d7d288971bdf4759ebb4eccd 100644 (file)
@@ -323,6 +323,7 @@ enum mux_exit_status {
        MUX_ES_SUCCESS,      /* Success */
        MUX_ES_INVALID_ERR,  /* invalid input */
        MUX_ES_TOUT_ERR,     /* timeout */
+       MUX_ES_NOTIMPL_ERR,  /* not-implemented error */
        MUX_ES_INTERNAL_ERR, /* internal error */
        MUX_ES_UNKNOWN       /* unknown status (must be the last) */
 };
index a1de7e57a2efd8585b4b540ee65cd6b6dd02020b..c24fdbdeb0240f60f48ed68a659e130531597426 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -2168,6 +2168,10 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
                                status = 408;
                                s_flags = SF_ERR_CLITO | SF_FINST_R;
                                break;
+                       case MUX_ES_NOTIMPL_ERR:
+                               status = 501;
+                               s_flags = SF_ERR_PRXCOND | SF_FINST_R;
+                               break;
                        case MUX_ES_INTERNAL_ERR:
                                status = 500;
                                s_flags = SF_ERR_INTERNAL | SF_FINST_R;