Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/libexec/httpd Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/f537282e51b8
branches:  netbsd-7
changeset: 800124:f537282e51b8
user:      snj <snj%NetBSD.org@localhost>
date:      Sun Feb 12 22:07:17 2017 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1357):
        libexec/httpd/CHANGES: revision 1.25
        libexec/httpd/bozohttpd.8: revisions 1.63-1.65
        libexec/httpd/bozohttpd.c: revisions 1.85, 1.86
        libexec/httpd/bozohttpd.h: revision 1.47
        libexec/httpd/cgi-bozo.c: revisions 1.36, 1.37
        libexec/httpd/libbozohttpd/libbozohttpd.3: revision 1.4
        libexec/httpd/testsuite/Makefile: revision 1.7
        libexec/httpd/testsuite/html_cmp: revision 1.5
        libexec/httpd/testsuite/test-bigfile: revision 1.4
        libexec/httpd/testsuite/test-simple: revisions 1.3, 1.4
        libexec/httpd/testsuite/t11.in: revision 1.1
        libexec/httpd/testsuite/t11.out: revision 1.1
        libexec/httpd/testsuite/cgi-bin/empty: revision 1.1
Update bozohttpd to 20170201:
- fix an infinite loop in cgi processing
- fixes and clean up for the testsuite
- no longer sends encoding header for compressed formats

diffstat:

 libexec/httpd/CHANGES                     |   9 +++++++--
 libexec/httpd/bozohttpd.8                 |  18 +++++++++++-------
 libexec/httpd/bozohttpd.c                 |   6 +++---
 libexec/httpd/bozohttpd.h                 |   4 ++--
 libexec/httpd/cgi-bozo.c                  |   7 ++++---
 libexec/httpd/libbozohttpd/libbozohttpd.3 |   6 +++---
 libexec/httpd/testsuite/Makefile          |  10 ++++++++--
 libexec/httpd/testsuite/html_cmp          |  24 ++++++++++++++++--------
 libexec/httpd/testsuite/t11.in            |   3 +++
 libexec/httpd/testsuite/t11.out           |   1 +
 libexec/httpd/testsuite/test-bigfile      |  19 ++++++++++++-------
 libexec/httpd/testsuite/test-simple       |  28 +++++++++++++++++++---------
 12 files changed, 89 insertions(+), 46 deletions(-)

diffs (truncated from 362 to 300 lines):

diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/CHANGES
--- a/libexec/httpd/CHANGES     Mon Feb 06 07:31:50 2017 +0000
+++ b/libexec/httpd/CHANGES     Sun Feb 12 22:07:17 2017 +0000
@@ -1,7 +1,12 @@
-$NetBSD: CHANGES,v 1.19.2.4 2016/12/23 07:42:09 snj Exp $
+$NetBSD: CHANGES,v 1.19.2.5 2017/02/12 22:07:17 snj Exp $
+
+changes in bozohttpd 20170201:
+       o  fix an infinite loop in cgi processing
+       o  fixes and clean up for the testsuite
+       o  no longer sends encoding header for compressed formats
 
 changes in bozohttpd 20160517:
-       o add a bozo_get_version() function which returns the version number
+       o  add a bozo_get_version() function which returns the version number
 
 changes in bozohttpd 20160415:
        o  add search-word support for CGI
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/bozohttpd.8
--- a/libexec/httpd/bozohttpd.8 Mon Feb 06 07:31:50 2017 +0000
+++ b/libexec/httpd/bozohttpd.8 Sun Feb 12 22:07:17 2017 +0000
@@ -1,8 +1,8 @@
-.\"    $NetBSD: bozohttpd.8,v 1.46.4.7 2016/12/23 07:42:09 snj Exp $
+.\"    $NetBSD: bozohttpd.8,v 1.46.4.8 2017/02/12 22:07:17 snj Exp $
 .\"
 .\"    $eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\"
-.\" Copyright (c) 1997-2016 Matthew R. Green
+.\" Copyright (c) 1997-2017 Matthew R. Green
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd December 11, 2016
+.Dd February 1, 2017
 .Dt BOZOHTTPD 8
 .Os
 .Sh NAME
@@ -190,7 +190,7 @@
 is being accessed.
 The function is passed three tables as arguments, the server
 environment, the request headers, and the decoded query string
-plus any data that was send as application/x-www-form-urlencoded.
+plus any data that was sent as application/x-www-form-urlencoded.
 .It Fl M Ar suffix type encoding encoding11
 Adds a new entry to the table that converts file suffixes to
 content type and encoding.
@@ -384,7 +384,7 @@
 directory index support (NO_DIRINDEX_SUPPORT),
 daemon mode support (NO_DAEMON_MODE),
 dynamic MIME content (NO_DYNAMIC_CONTENT),
-Lua suport (NO_LUA_SUPPORT),
+Lua support (NO_LUA_SUPPORT),
 and SSL support (NO_SSL_SUPPORT)
 by defining the listed macros when building
 .Nm .
@@ -446,7 +446,7 @@
 on the compiler command line.
 .Ss COMPRESSION
 .Nm
-supports a very basic form compression.
+supports a very basic form of compression.
 .Nm
 will serve the requested file postpended with
 .Dq Pa .gz
@@ -531,7 +531,7 @@
 and regular code audits.
 This manual documents
 .Nm
-version 20160720.
+version 20170201.
 .Sh AUTHORS
 .An -nosplit
 .Nm
@@ -631,6 +631,10 @@
 .Aq Mt jlam%NetBSD.org@localhost
 provided man page fixes
 .It
+.An Dennis Lindroos
+.Aq Mt denafcm%gmail.com@localhost
+provided a cgi-bin fix
+.It
 .An Julio Merino
 .Aq Mt jmmv%NetBSD.org@localhost
 Added the
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/bozohttpd.c
--- a/libexec/httpd/bozohttpd.c Mon Feb 06 07:31:50 2017 +0000
+++ b/libexec/httpd/bozohttpd.c Sun Feb 12 22:07:17 2017 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: bozohttpd.c,v 1.56.2.7 2016/12/23 07:42:09 snj Exp $   */
+/*     $NetBSD: bozohttpd.c,v 1.56.2.8 2017/02/12 22:07:17 snj Exp $   */
 
 /*     $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $      */
 
 /*
- * Copyright (c) 1997-2016 Matthew R. Green
+ * Copyright (c) 1997-2017 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -109,7 +109,7 @@
 #define INDEX_HTML             "index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE                "bozohttpd/20160720"
+#define SERVER_SOFTWARE                "bozohttpd/20170201"
 #endif
 #ifndef DIRECT_ACCESS_FILE
 #define DIRECT_ACCESS_FILE     ".bzdirect"
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/bozohttpd.h
--- a/libexec/httpd/bozohttpd.h Mon Feb 06 07:31:50 2017 +0000
+++ b/libexec/httpd/bozohttpd.h Sun Feb 12 22:07:17 2017 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: bozohttpd.h,v 1.33.2.5 2016/12/23 07:42:09 snj Exp $   */
+/*     $NetBSD: bozohttpd.h,v 1.33.2.6 2017/02/12 22:07:17 snj Exp $   */
 
 /*     $eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $       */
 
 /*
- * Copyright (c) 1997-2015 Matthew R. Green
+ * Copyright (c) 1997-2017 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/cgi-bozo.c
--- a/libexec/httpd/cgi-bozo.c  Mon Feb 06 07:31:50 2017 +0000
+++ b/libexec/httpd/cgi-bozo.c  Sun Feb 12 22:07:17 2017 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: cgi-bozo.c,v 1.25.2.6 2016/12/23 07:42:09 snj Exp $    */
+/*     $NetBSD: cgi-bozo.c,v 1.25.2.7 2017/02/12 22:07:17 snj Exp $    */
 
 /*     $eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $        */
 
 /*
- * Copyright (c) 1997-2015 Matthew R. Green
+ * Copyright (c) 1997-2017 Matthew R. Green
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -235,7 +235,8 @@
         */
        *args_len = 1;
        /* count '+' in str */
-       for (s = str; (s = strchr(s, '+')); (*args_len)++);
+       for (s = str; (s = strchr(s, '+')); (*args_len)++)
+               s++;
        
        args = bozomalloc(httpd, sizeof(*args) * (*args_len + 1));
  
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/libbozohttpd/libbozohttpd.3
--- a/libexec/httpd/libbozohttpd/libbozohttpd.3 Mon Feb 06 07:31:50 2017 +0000
+++ b/libexec/httpd/libbozohttpd/libbozohttpd.3 Sun Feb 12 22:07:17 2017 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: libbozohttpd.3,v 1.3 2014/03/18 18:20:38 riastradh Exp $
+.\" $NetBSD: libbozohttpd.3,v 1.3.10.1 2017/02/12 22:07:17 snj Exp $
 .\"
 .\" $eterna: libbozohttpd.3,v 1.2 2010/05/10 02:48:23 mrg Exp $
 .\"
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 5, 2009
+.Dd February 2, 2017
 .Dt LIBBOZOHTTPD 3
 .Os
 .Sh NAME
@@ -41,7 +41,7 @@
 .In bozohttpd.h
 .Ft int
 .Fo bozo_set_pref
-.Fa "bozoprefs_t *prefs" "char *name" "char *value"
+.Fa "bozohttpd_t *httpd" "bozoprefs_t *prefs" "char *name" "char *value"
 .Fc
 .Ft char *
 .Fo bozo_get_pref
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/testsuite/Makefile
--- a/libexec/httpd/testsuite/Makefile  Mon Feb 06 07:31:50 2017 +0000
+++ b/libexec/httpd/testsuite/Makefile  Sun Feb 12 22:07:17 2017 +0000
@@ -1,6 +1,7 @@
 #      $eterna: Makefile,v 1.14 2009/05/22 21:51:39 mrg Exp $
 
 SIMPLETESTS=   t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
+CGITESTS=      t11
 BIGFILETESTS=  partial4000 partial8000
 
 BOZOHTTPD?=    ../bozohttpd
@@ -22,11 +23,16 @@
                rm -f tmp.$$a.out tmp.$$a.err; \
        done
 
-check: check-simple check-bigfile
+check: check-simple check-cgi check-bigfile
 
 check-simple:
 .for a in $(SIMPLETESTS)
-       ${SILENT}$(.CURDIR)/test-simple "$a" "${BOZOHTTPD}" "${DATA}" "${VERBOSE}"
+       ${SILENT}$(.CURDIR)/test-simple "$a" "${BOZOHTTPD}" "${DATA}" "${.CURDIR}" "${VERBOSE}"
+.endfor
+
+check-cgi:
+.for a in $(CGITESTS)
+       ${SILENT}$(.CURDIR)/test-simple "$a" "${BOZOHTTPD}" "${DATA}" "${.CURDIR}" "${VERBOSE}" -c "${.CURDIR}/cgi-bin"
 .endfor
 
 check-bigfile:
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/testsuite/html_cmp
--- a/libexec/httpd/testsuite/html_cmp  Mon Feb 06 07:31:50 2017 +0000
+++ b/libexec/httpd/testsuite/html_cmp  Sun Feb 12 22:07:17 2017 +0000
@@ -2,12 +2,20 @@
 #
 #      $eterna: html_cmp,v 1.9 2011/11/17 22:18:02 mrg Exp $
 #
-# like cmp(1) but compares to files after making their `Date: ' headers
-# the same, to allow `now' and `then' to work properly.  it also tries
-# to find servername's that might be the local host and converts those
-# as well..
+# like cmp(1)/diff(1) but compares to files after making their
+# `Date: ' headers the same, to allow `now' and `then' to work properly.
+# it also tries to find servername's that might be the local host and
+# converts those as well..
 #
-# it must be called like `cmp file1 file1' *only*.  
+# it must be called like `html_cmp cmp|diff file1 file1' *only*.
+
+if [ "cmp" = "$1" ]; then
+       cmd="cmp -s"
+elif [ "diff" = "$1" ]; then
+       cmd="diff -u"
+else
+       exit 77
+fi
 
 h=`hostname || uname -n`
 
@@ -17,10 +25,10 @@
        s/^Server: .*/^Server: bozotic HTTP server version 5.08/;
        s/^Content-Length: .*/Content-Length: 223/;"
 
-sed -e "$sedcmd" < "$1" > "f1.tmp.$$"
-sed -e "$sedcmd" < "$2" > "f2.tmp.$$"
+sed -e "$sedcmd" < "$2" > "f1.tmp.$$"
+sed -e "$sedcmd" < "$3" > "f2.tmp.$$"
 
-cmp -s "f1.tmp.$$" "f2.tmp.$$"
+${cmd} "f1.tmp.$$" "f2.tmp.$$"
 rv=$?
 rm -f "f1.tmp.$$" "f2.tmp.$$"
 
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/testsuite/t11.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/libexec/httpd/testsuite/t11.in    Sun Feb 12 22:07:17 2017 +0000
@@ -0,0 +1,3 @@
+GET /cgi-bin/echo.bat?&dir+c:\\ HTTP/1.1
+Host: 
+
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/testsuite/t11.out
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/libexec/httpd/testsuite/t11.out   Sun Feb 12 22:07:17 2017 +0000
@@ -0,0 +1,1 @@
+HTTP/1.1 200 OK
diff -r 82dbda1c57e9 -r f537282e51b8 libexec/httpd/testsuite/test-bigfile
--- a/libexec/httpd/testsuite/test-bigfile      Mon Feb 06 07:31:50 2017 +0000
+++ b/libexec/httpd/testsuite/test-bigfile      Sun Feb 12 22:07:17 2017 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: test-bigfile,v 1.1.1.1.30.2 2016/12/23 07:42:09 snj Exp $
+# $NetBSD: test-bigfile,v 1.1.1.1.30.3 2017/02/12 22:07:17 snj Exp $
 
 test="$1"      # partial4000 or partial8000
 bozohttpd="$2"
@@ -7,30 +7,35 @@
 datadir="$4"
 verbose="$5"
 
+tmperr="tmp.$test.err"
+
 if [ "yes" = "$verbose" ]; then
        echo "Running test $test"
 else
-       exec 2>tmp.$test.err
+       exec 2>"$tmperr"
 fi
 
 bozotestport=11111
 
 # copy beginning file
-cp ${datadir}/bigfile.${test} ./bigfile
+cp "${datadir}/bigfile.${test}" ./bigfile
 
 # fire up bozohttpd
-${bozohttpd} -b -b -I ${bozotestport} -n -s -f ${datadir} &
+${bozohttpd} -b -b -I ${bozotestport} -n -s -f "${datadir}" &
 bozopid=$!
 
-${wget} -c http://localhost:${bozotestport}/bigfile
+"${wget}" -c http://localhost:${bozotestport}/bigfile



Home | Main Index | Thread Index | Old Index