Alexander Bluhm([email protected]) on 2017.11.15 18:08:07 +0100:
> On Tue, Nov 14, 2017 at 06:15:05PM +0100, Sebastian Benoit wrote:
> > +.It Ic http Ar option
> > +Set the HTTP options and session settings.
> > +This is only used if HTTP is enabled in the relay.
> 
> Could we check that the http option is not used for non-http configs?
> Then writing correct relayd.conf gets easier.
> 
> anyway OK bluhm@

Thanks, here is a diff on top of the last to check that.

If you manage to set the default headerlen on non http protocols, it does
not catch that, but i dont want to add another variable for that corner
case.

ok?

Index: parse.y
===================================================================
RCS file: /cvs/src/usr.sbin/relayd/parse.y,v
retrieving revision 1.217
diff -u -p -r1.217 parse.y
--- parse.y     15 Nov 2017 19:03:26 -0000      1.217
+++ parse.y     15 Nov 2017 19:10:11 -0000
@@ -1023,6 +1023,12 @@ proto            : relay_proto PROTO STRING      {
                                yyerror("invalid TLS protocol");
                                YYERROR;
                        }
+                       if ((proto->type != RELAY_PROTO_HTTP) &&
+                           proto->httpheaderlen != RELAY_DEFHEADERLENGTH) {
+                               yyerror("can set http options only for "
+                                   "http protocol");
+                               YYERROR;
+                       }
 
                        TAILQ_INSERT_TAIL(conf->sc_protos, proto, entry);
                }
 

Reply via email to