From 1d89351e83a61454208ce87bcdf7198458bf837a Mon Sep 17 00:00:00 2001 From: stsp Date: Thu, 17 Jul 2014 11:35:26 +0000 Subject: [PATCH] Move comment about strcasecmp() to a more suitable spot. ok reyk benno --- usr.sbin/httpd/server_http.c | 11 ++++++----- usr.sbin/relayd/relay_http.c | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c index 8bb8daefddc..07d042a80fd 100644 --- a/usr.sbin/httpd/server_http.c +++ b/usr.sbin/httpd/server_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_http.c,v 1.8 2014/07/16 10:25:28 reyk Exp $ */ +/* $OpenBSD: server_http.c,v 1.9 2014/07/17 11:35:26 stsp Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter @@ -787,10 +787,6 @@ server_httpmethod_byname(const char *name) /* Set up key */ method.method_name = name; - /* - * RFC 2616 section 5.1.1 says that the method is case - * sensitive so we don't do a strcasecmp here. - */ if ((res = bsearch(&method, http_methods, sizeof(http_methods) / sizeof(http_methods[0]) - 1, sizeof(http_methods[0]), server_httpmethod_cmp)) != NULL) @@ -820,6 +816,11 @@ server_httpmethod_cmp(const void *a, const void *b) { const struct http_method *ma = a; const struct http_method *mb = b; + + /* + * RFC 2616 section 5.1.1 says that the method is case + * sensitive so we don't do a strcasecmp here. + */ return (strcmp(ma->method_name, mb->method_name)); } diff --git a/usr.sbin/relayd/relay_http.c b/usr.sbin/relayd/relay_http.c index bd0449bde27..53d3af6d39c 100644 --- a/usr.sbin/relayd/relay_http.c +++ b/usr.sbin/relayd/relay_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay_http.c,v 1.31 2014/07/14 00:11:12 bluhm Exp $ */ +/* $OpenBSD: relay_http.c,v 1.32 2014/07/17 11:35:26 stsp Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter @@ -1133,10 +1133,6 @@ relay_httpmethod_byname(const char *name) /* Set up key */ method.method_name = name; - /* - * RFC 2616 section 5.1.1 says that the method is case - * sensitive so we don't do a strcasecmp here. - */ if ((res = bsearch(&method, http_methods, sizeof(http_methods) / sizeof(http_methods[0]) - 1, sizeof(http_methods[0]), relay_httpmethod_cmp)) != NULL) @@ -1166,6 +1162,11 @@ relay_httpmethod_cmp(const void *a, const void *b) { const struct http_method *ma = a; const struct http_method *mb = b; + + /* + * RFC 2616 section 5.1.1 says that the method is case + * sensitive so we don't do a strcasecmp here. + */ return (strcmp(ma->method_name, mb->method_name)); } -- 2.20.1