Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package siege for openSUSE:Factory checked in at 2022-11-07 13:51:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/siege (Old) and /work/SRC/openSUSE:Factory/.siege.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "siege" Mon Nov 7 13:51:45 2022 rev:11 rq:1034081 version:4.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/siege/siege.changes 2021-05-20 19:25:36.645807046 +0200 +++ /work/SRC/openSUSE:Factory/.siege.new.1597/siege.changes 2022-11-07 13:51:51.567858215 +0100 @@ -1,0 +2,38 @@ +Tue Nov 1 10:58:47 UTC 2022 - Andrea Manzini <andrea.manz...@suse.com> + +- Update to version 4.1.5 + * src/browser.c Corrected deferred + * utils/Makefile.am Added manifier to the distro + * src/browser.c Made all threads cancel deferred + * src/ftp.c Catch 421: server accepts but doesn't handle + * src/timer.c Added a second to account for spool up + * src/memory.c Added xstrncpy, xstrncat + * src/memory.h Added xstrncpy, xstrncat + * src/cookies.c Implemented new x* functions + * src/ssl.c Silenced compiler warning + * src/main.c Added xstrncpy to silence warnings + * doc/siege.pod Fixed a typo in the man page + * src/parser.c Refined match for META redirect + * src/browser.c Fixed typos + * src/date.c Fixed typos + * src/url.c Fixed typos + * utils/siege2csv.in Fixed typos + * src/main.c Silenced statistics output on -g/--get + * src/cookies.c Improved domain matching, added my.get + * src/ssl.c Silenced a compiler warning + * src/browser.c Added HTTP response 201 handler + * src/response.c Added Content-Location handler + * src/response.h Added CONTENT_LOCATION value + * src/http.c Added Content-Location parser + * src/cfg.c Added an escape handler for $ in URLs + * src/eval.c Added function escape(str) to remove '\' + * src/ssl.c Put ERR_remove_state inside ssl version + * src/url.c Added fix for null path checking + * src/util.c Fixed np_phtread_usleep for Solaris + * src/url.c Removed leading / from ftp paths + * src/browser.c fixed: "--reps=once" + * src/main.c fixed: "--reps=once" + * src/init.c Fixed password parsing # can be in pwd + * src/auth.c Prettified credentials output for siege -C + +------------------------------------------------------------------- Old: ---- siege-4.0.9.tar.gz New: ---- siege-4.1.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ siege.spec ++++++ --- /var/tmp/diff_new_pack.YcAhGs/_old 2022-11-07 13:51:52.659864354 +0100 +++ /var/tmp/diff_new_pack.YcAhGs/_new 2022-11-07 13:51:52.663864376 +0100 @@ -1,7 +1,7 @@ # # spec file for package siege # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # Copyright (c) 2012 Pascal Bleser <pascal.ble...@opensuse.org> # # All modifications and additions to the file contributed by third parties @@ -18,7 +18,7 @@ Name: siege -Version: 4.0.9 +Version: 4.1.5 Release: 0 Summary: HTTP Regression Testing/Benchmarking Utility License: GPL-2.0-or-later ++++++ siege-4.0.9.tar.gz -> siege-4.1.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/ChangeLog new/siege-4.1.5/ChangeLog --- old/siege-4.0.9/ChangeLog 2021-04-17 16:06:41.000000000 +0200 +++ new/siege-4.1.5/ChangeLog 2022-08-02 19:02:11.000000000 +0200 @@ -1,6 +1,67 @@ To email a contributor remove "DELETE" from the email address. (The DELETEs are necessary as this list is published online.) +2022/08/02 Jeffrey Fulmer https://www.joedog.org/support/ + * src/browser.c Corrected deferred + * src/version. Version increment 4.1.5 + * utils/Makefile.am Added manifier to the distro + +2022/07/31 Jeffrey Fulmer https://www.joedog.org/support/ + * src/browser.c Made all threads cancel deferred + * src/ftp.c Catch 421: server accepts but doesn't handle + * src/timer.c Added a second to account for spool up + * src/version.c Version increment: 4.1.4 + +2022/04/18 Jeffrey Fulmer https://www.joedog.org/support/ + * src/memory.c Added xstrncpy, xstrncat + * src/memory.h Added xstrncpy, xstrncat + * src/cookies.c Implemented new x* functions + * src/ssl.c Silenced compiler warning + * src/main.c Added xstrncpy to silence warnings + * src/version.c Version increment: 4.1.3 + +2022/04/18 Frank Ledo via https://github.com/FrankLedo + * doc/siege.pod Fixed a typo in the man page + +2022/04/08 barryhunter via https://github.com/barryhunter + * src/parser.c Refined match for META redirect + +2022/03/21 cui fliter https://github.com/cuishuang + * src/browser.c Fixed typos + * src/date.c Fixed typos + * src/url.c Fixed typos + * utils/siege2csv.in Fixed typos + +2022/03/17 Jeffrey Fulmer https://www.joedog.org/support/ + * src/main.c Silenced statistics output on -g/--get + * src/cookies.c Improved domain matching, added my.get + * src/ssl.c Silenced a compiler warning + * src/version.c Version increment: 4.1.2 + +2021/07/14 Jeffrey Fulmer https://www.joedog.org/support/ + * src/browser.c Added HTTP response 201 handler + * src/response.c Added Content-Location handler + * src/response.h Added CONTENT_LOCATION value + * src/http.c Added Content-Location parser + * src/cfg.c Added an escape handler for $ in URLs + * src/eval.c Added function escape(str) to remove '\' + * src/ssl.c Put ERR_remove_state inside ssl version + * src/url.c Added fix for null path checking + * src/util.c Fixed np_phtread_usleep for Solaris + * src/version.c Version increment: 4.1.1 + +2021/07/07 Jeffrey Fulmer https://www.joedog.org/support/ + * src/url.c Removed leading / from ftp paths + +2021/07/07 midchildan https://github.com/midchildan + * src/browser.c fixed: "--reps=once" + * src/main.c fixed: "--reps=once" + +2021/07/04 Jeffrey Fulmer http://www.joedog.org/support/ + * src/init.c Fixed password parsing # can be in pwd + * src/auth.c Prettified credentials output for siege -C + * src/version.c Version increment: 4.1.0 + 2021/04/17 Jeffrey Fulmer http://www.joedog.org/support/ * src/cookie.c Added NULL checks for getters * version.c Version increment: 4.0.9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/acinclude.m4 new/siege-4.1.5/acinclude.m4 --- old/siege-4.0.9/acinclude.m4 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/acinclude.m4 2022-08-02 14:14:58.000000000 +0200 @@ -1122,7 +1122,7 @@ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - # We can hardcode non-existant directories. + # We can hardcode non-existent directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library @@ -6574,7 +6574,7 @@ osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the - # library depends on, so we explictly say `no'. + # library depends on, so we explicitly say `no'. libltdl_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/configure new/siege-4.1.5/configure --- old/siege-4.0.9/configure 2021-03-17 14:53:02.000000000 +0100 +++ new/siege-4.1.5/configure 2022-08-02 19:02:49.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for siege 4.0.8. +# Generated by GNU Autoconf 2.68 for siege 4.1.5. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -711,8 +711,8 @@ # Identity of this package. PACKAGE_NAME='siege' PACKAGE_TARNAME='siege' -PACKAGE_VERSION='4.0.8' -PACKAGE_STRING='siege 4.0.8' +PACKAGE_VERSION='4.1.5' +PACKAGE_STRING='siege 4.1.5' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1454,7 +1454,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures siege 4.0.8 to adapt to many kinds of systems. +\`configure' configures siege 4.1.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1524,7 +1524,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of siege 4.0.8:";; + short | recursive ) echo "Configuration of siege 4.1.5:";; esac cat <<\_ACEOF @@ -1635,7 +1635,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -siege configure 4.0.8 +siege configure 4.1.5 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2259,7 +2259,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by siege $as_me 4.0.8, which was +It was created by siege $as_me 4.1.5, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3083,7 +3083,7 @@ # Define the identity of the package. PACKAGE='siege' - VERSION='4.0.8' + VERSION='4.1.5' cat >>confdefs.h <<_ACEOF @@ -9751,7 +9751,7 @@ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then - # We can hardcode non-existant directories. + # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library @@ -13353,7 +13353,7 @@ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then - # We can hardcode non-existant directories. + # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library @@ -15914,7 +15914,7 @@ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then - # We can hardcode non-existant directories. + # We can hardcode non-existent directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library @@ -18478,7 +18478,7 @@ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then - # We can hardcode non-existant directories. + # We can hardcode non-existent directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library @@ -21932,7 +21932,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by siege $as_me 4.0.8, which was +This file was extended by siege $as_me 4.1.5, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21998,7 +21998,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -siege config.status 4.0.8 +siege config.status 4.1.5 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/doc/bombardment.1.in new/siege-4.1.5/doc/bombardment.1.in --- old/siege-4.0.9/doc/bombardment.1.in 2021-04-17 16:10:52.000000000 +0200 +++ new/siege-4.1.5/doc/bombardment.1.in 2022-08-02 19:02:50.000000000 +0200 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BOMBARDMENT 1" -.TH BOMBARDMENT 1 "2021-03-17" "JoeDog" "bombardment" +.TH BOMBARDMENT 1 "2022-08-02" "JoeDog" "bombardment" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/doc/siege.1.in new/siege-4.1.5/doc/siege.1.in --- old/siege-4.0.9/doc/siege.1.in 2021-04-17 16:10:52.000000000 +0200 +++ new/siege-4.1.5/doc/siege.1.in 2022-08-02 19:02:49.000000000 +0200 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "SIEGE 1" -.TH SIEGE 1 "2021-03-17" "JoeDog" "Siege Load Tester" +.TH SIEGE 1 "2022-08-02" "JoeDog" "Siege Load Tester" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -330,7 +330,13 @@ file. The URLs are listed one per line. Unlike URLs that are passed as a command-line argument, the URLs in this file should not be quoted. .Sp -\&\f(CW$_PROGRAM\fR's urls.txt parser supports comments and variables. +\&\f(CW$_PROGRAM\fR's urls.txt parser supports comments and variables. Since +\&\f(CW$_PROGRAM\fR uses the dollar sign ($) as a prefix for scalar variables, +you should escape any variable you want to send to the server: +.Sp +.Vb 1 +\& https://$(HOST)/siege/jsoner.php POST {"price": "\e$10 per mile"} +.Ve .IP "\fB\-R \s-1FILE\s0\fR, \fB\-\-rc=FILE\fR" 4 .IX Item "-R FILE, --rc=FILE" This directive allows you to set an alternative resource file. By @@ -345,7 +351,7 @@ .IX Item "-m string, --mark=string" This option allows you to log a message to the log file before your stats are written there. It is generally used to identify the -proceding run. You could, for example, mark the file with your +proceeding run. You could, for example, mark the file with your command-line parameters so it's understood what configuration generated the following data. .ie n .IP "\fB\-H ""header: value""\fR, \fB\-\-header=""Header: value""\fR" 4 @@ -491,7 +497,7 @@ \& Elapsed time \& The duration of the entire siege test. This is measured from the \& time the user invokes $_PROGRAM until the last simulated user -\& completes its transactions. Shown above, the test took 14.67 +\& completes its transactions. Shown above, the test took 58.57 \& seconds to complete. \& \& Data transferred diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/doc/siege.config.1.in new/siege-4.1.5/doc/siege.config.1.in --- old/siege-4.0.9/doc/siege.config.1.in 2021-04-17 16:10:52.000000000 +0200 +++ new/siege-4.1.5/doc/siege.config.1.in 2022-08-02 19:02:50.000000000 +0200 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "SIEGE.CONFIG 1" -.TH SIEGE.CONFIG 1 "2021-03-17" "JoeDog" "siege.config utility" +.TH SIEGE.CONFIG 1 "2022-08-02" "JoeDog" "siege.config utility" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/doc/siege.pod new/siege-4.1.5/doc/siege.pod --- old/siege-4.0.9/doc/siege.pod 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/doc/siege.pod 2022-08-02 14:14:58.000000000 +0200 @@ -213,7 +213,11 @@ file. The URLs are listed one per line. Unlike URLs that are passed as a command-line argument, the URLs in this file should not be quoted. -$_PROGRAM's urls.txt parser supports comments and variables. +$_PROGRAM's urls.txt parser supports comments and variables. Since +$_PROGRAM uses the dollar sign ($) as a prefix for scalar variables, +you should escape any variable you want to send to the server: + + https://$(HOST)/siege/jsoner.php POST {"price": "\$10 per mile"} =item B<-R FILE>, B<--rc=FILE> @@ -230,7 +234,7 @@ This option allows you to log a message to the log file before your stats are written there. It is generally used to identify the -proceding run. You could, for example, mark the file with your +proceeding run. You could, for example, mark the file with your command-line parameters so it's understood what configuration generated the following data. @@ -376,7 +380,7 @@ Elapsed time The duration of the entire siege test. This is measured from the time the user invokes $_PROGRAM until the last simulated user - completes its transactions. Shown above, the test took 14.67 + completes its transactions. Shown above, the test took 58.57 seconds to complete. Data transferred diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/doc/siege2csv.1.in new/siege-4.1.5/doc/siege2csv.1.in --- old/siege-4.0.9/doc/siege2csv.1.in 2021-04-17 16:10:52.000000000 +0200 +++ new/siege-4.1.5/doc/siege2csv.1.in 2022-08-02 19:02:50.000000000 +0200 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BOMBARDMENT 1" -.TH BOMBARDMENT 1 "2021-03-17" "JoeDog" "siege2csv" +.TH BOMBARDMENT 1 "2022-08-02" "JoeDog" "siege2csv" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/doc/siegerc.in new/siege-4.1.5/doc/siegerc.in --- old/siege-4.0.9/doc/siegerc.in 2021-04-17 16:08:49.000000000 +0200 +++ new/siege-4.1.5/doc/siegerc.in 2022-08-02 14:14:58.000000000 +0200 @@ -27,7 +27,7 @@ verbose = true # -# Color mode: This option works in conjuction with verbose mode. +# Color mode: This option works in conjunction with verbose mode. # It tells siege whether or not it should display its output in # color-coded output. (Enabled by default) # @@ -551,7 +551,7 @@ # # SSL-cert: This optional feature allows you to specify a path to a client -# certificate. It is not neccessary to specify a certificate in order to use +# certificate. It is not necessary to specify a certificate in order to use # https. If you don't know why you would want one, then you probably don't need # it. Use openssl to generate a certificate and key with the following command: # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/doc/urls.txt new/siege-4.1.5/doc/urls.txt --- old/siege-4.0.9/doc/urls.txt 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/doc/urls.txt 2022-08-02 14:14:58.000000000 +0200 @@ -10,7 +10,18 @@ # or POST content from a file: # http://www.whoohoo.com/melvin.jsp POST </home/jeff/haha # http://www.whoohoo.com/melvin.jsp POST <./haha -# You may also set and reference variables inside this file, -# for more information, man urls_txt +# +# You may also assign and reference variables inside this file: +# HOST=www.joedog.org +# PROT=https # Secure protocol +# PORT=443 # Default https port +# +# $(PROT)://$(HOST):$(PORT)/siege/jsoner.php?haha=papa +# $(PROT)://$(HOST)/siege/jsoner.php?day=%2332 +# $(PROT)://$(HOST)/siege/jsoner.php POST {haha:papa} +# +# Since $ is used to prefix scalar variables, you have to escape +# them if you want to pass them to the server: +# $(PROT)://$(HOST)/siege/jsoner.php?amount=\$10.00&cost=\$12.99 # ------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/auth.c new/siege-4.1.5/src/auth.c --- old/siege-4.0.9/src/auth.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/auth.c 2022-08-02 14:14:58.000000000 +0200 @@ -176,12 +176,15 @@ void auth_display(AUTH this, SCHEME scheme) { - size_t i; + size_t i; + char space[] = " "; + BOOLEAN first = TRUE; //XXX: Needs to be reformatted for siege -C for (i = 0; i < array_length(this->creds); i++) { CREDS tmp = array_get(this->creds, i); if (creds_get_scheme(tmp) == scheme) { - printf("credentials: %s:%s:%s\n", creds_get_username(tmp), creds_get_password(tmp), creds_get_realm(tmp)); + printf("%scredentials: %s:%s:%s\n", first==TRUE?"":space, creds_get_username(tmp), creds_get_password(tmp), creds_get_realm(tmp)); + first = FALSE; } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/browser.c new/siege-4.1.5/src/browser.c --- old/siege-4.0.9/src/browser.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/browser.c 2022-08-02 14:15:16.000000000 +0200 @@ -220,6 +220,7 @@ { int x; int y; + int max_y; int ret; int len; this->conn = NULL; @@ -233,22 +234,19 @@ sigemptyset(&this->sigs); sigaddset(&this->sigs, SIGUSR1); pthread_sigmask(SIG_UNBLOCK, &this->sigs, NULL); -#else/*CANCEL_CLIENT_PLATFORM*/ +#else /*CANCEL_CLIENT_PLATFORM*/ #if defined(_AIX) pthread_cleanup_push((void(*)(void*))__signal_cleanup, NULL); #else pthread_cleanup_push((void*)__signal_cleanup, this->conn); #endif - #if defined(sun) - pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, &this->type); - #elif defined(_AIX) - pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, &this->type); - #elif defined(hpux) || defined(__hpux) - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &this->type); - #else - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &this->type); - #endif + /** + * NOTE: Beginning with siege 4.1.4, all platforms are cancel + * deferred. Execution continues until control reaches + * a cancel point specified by pthread_testcancel(); + */ + pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, &this->type); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &this->state); #endif/*SIGNAL_CLIENT_PLATFORM*/ @@ -260,6 +258,7 @@ len = (my.reps == -1) ? (int)array_length(this->urls) : my.reps; y = (my.reps == -1) ? 0 : this->id * (my.length / my.cusers); + max_y = (int)array_length(this->urls); for (x = 0; x < len; x++, y++) { x = ((my.secs > 0) && ((my.reps <= 0)||(my.reps == MAXREPS))) ? 0 : x; if (my.internet == TRUE) { @@ -273,14 +272,14 @@ * with clean slate, ie. reset (delete) cookies (eg. to let a new * session start) */ - if (y >= my.length) { + if (y >= max_y) { y = 0; if (my.expire) { cookies_delete_all(my.cookies); } } } - if (y >= my.length || y < 0) { + if (y >= max_y || y < 0) { y = 0; } @@ -326,6 +325,11 @@ } /** + * This feels like a safe cancel point + */ + pthread_testcancel(); + + /** * Delay between interactions -D num /--delay=num */ if (my.delay >= 1) { @@ -603,6 +607,18 @@ redirect_url = url_destroy(redirect_url); } break; + case 201: + if (my.follow && response_get_location(resp) != NULL) { + redirect_url = url_normalize(U, response_get_location(resp)); + if (empty(url_get_hostname(redirect_url))) { + url_set_hostname(redirect_url, url_get_hostname(U)); + } + if ((__request(this, redirect_url)) == FALSE) { + redirect_url = url_destroy(redirect_url); + return FALSE; + } + } + break; case 301: case 302: case 303: @@ -735,7 +751,7 @@ { int pass; int fail; - int code = 0; // capture the relevent return code + int code = 0; // capture the relevant return code float etime; // elapsed time CONN *D = NULL; // FTP data connection size_t bytes = 0; // bytes from server @@ -772,7 +788,6 @@ if (url_get_password(U) == NULL || strlen(url_get_password(U)) < 1) { url_set_password(U, auth_get_ftp_password(my.auth, url_get_hostname(U))); } - if (ftp_login(this->conn, U) == FALSE) { if (my.verbose) { int color = __select_color(this->conn->ftp.code); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/cache.c new/siege-4.1.5/src/cache.c --- old/siege-4.0.9/src/cache.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/cache.c 2022-08-02 14:14:58.000000000 +0200 @@ -166,6 +166,7 @@ DATE e = NULL; char *key = NULL; char *exp = NULL; + char *ptr = NULL; char tmp[256]; /** @@ -208,7 +209,6 @@ memset(tmp, '\0', 256); switch (type) { - char *ptr = NULL; case C_ETAG: ptr = strdup(date_get_etag(d)); // need a local copy if (empty(ptr)) return ""; // should never happen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/cfg.c new/siege-4.1.5/src/cfg.c --- old/siege-4.0.9/src/cfg.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/cfg.c 2022-08-02 14:14:58.000000000 +0200 @@ -27,6 +27,7 @@ #include <perl.h> #include <memory.h> #include <notify.h> +#include <util.h> #include <joedog/defs.h> #include <joedog/boolean.h> @@ -66,6 +67,12 @@ trim(str); } +int +count(char* s, char c) +{ + return *s == '\0' ? 0 : count(s + 1, c) + (*s == c); +} + /** * Reads filename into memory and populates * the config_t struct with the result. Uses @@ -124,8 +131,9 @@ } parse(line); chomp(line); - if (strlen(line) == 0); - else if (is_variable_line(line)) { + if (strlen(line) == 0) { + ; + } else if (is_variable_line(line)) { char *tmp = line; option = tmp; while (*tmp && !ISSPACE((int)*tmp) && !ISSEPARATOR(*tmp)) @@ -139,9 +147,18 @@ *tmp++=0; hash_add(H, option, value); } else { - char *tmp = xstrdup(line); + char *tmp = xstrdup(line); + int r = 0; + int cnt = 0; + cnt += count(tmp, '$'); while (strstr(tmp, "$")) { - tmp = evaluate(H, tmp); + if (strstr(tmp, "\\$")) { + tmp = escape(tmp); + } else { + tmp = evaluate(H, tmp); + } + r++; + if (r == cnt) break; } l->line = (char**)realloc(l->line, sizeof(char *) * (l->index + 1)); l->line[l->index] = (char *)strdup(tmp); @@ -192,7 +209,6 @@ { char *pos, *x; char c; - /** * check for variable assignment; make sure that on the left side * of the = is nothing but letters, numbers, and/or underscores. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/cookies.c new/siege-4.1.5/src/cookies.c --- old/siege-4.0.9/src/cookies.c 2021-04-12 15:13:30.000000000 +0200 +++ new/siege-4.1.5/src/cookies.c 2022-08-02 14:14:58.000000000 +0200 @@ -26,9 +26,11 @@ char * file; }; + private NODE * __delete_node(NODE *node); private BOOLEAN __exists(char *file); private BOOLEAN __save_cookies(COOKIES this); +private BOOLEAN __endswith(const char *str, const char *suffix); COOKIES new_cookies() { @@ -65,31 +67,26 @@ cookies_add(COOKIES this, char *str, char *host) { size_t id = pthread_self(); - int hlen = 0; - int dlen = 0; + //int hlen = 0; + //int dlen = 0; NODE *cur = NULL; NODE *pre = NULL; NODE *new = NULL; BOOLEAN found = FALSE; BOOLEAN valid = FALSE; COOKIE oreo = new_cookie(str, host); - if (oreo == NULL) return FALSE; if (cookie_get_name(oreo) == NULL || cookie_get_value(oreo) == NULL) return FALSE; - - //pthread_mutex_lock(&(my.lock)); for (cur = pre = this->head; cur != NULL; pre = cur, cur = cur->next) { const char *domainptr = cookie_get_domain(cur->cookie); if (*domainptr == '.') ++domainptr; - hlen = host ? strlen(host) : 0; - dlen = domainptr ? strlen(domainptr) : 0; - if (! strcasecmp(host, domainptr)) { - valid = TRUE; // host level cookie found + //hlen = host ? strlen(host) : 0; + //dlen = domainptr ? strlen(domainptr) : 0; + if (__endswith(host, domainptr)){ + valid = TRUE; } - if (! valid && (dlen < hlen) && (! strcasecmp(host + (hlen - dlen), domainptr))) { - valid = TRUE; // domain level cookie found - } - if (valid && cur->threadID == id && !strcasecmp(cookie_get_name(cur->cookie), cookie_get_name(oreo))) { + if (valid && cur->threadID == id && + !strcasecmp(cookie_get_name(cur->cookie), cookie_get_name(oreo))) { cookie_reset_value(cur->cookie, cookie_get_value(oreo)); oreo = cookie_destroy(oreo); found = TRUE; @@ -107,8 +104,6 @@ else pre->next = new; } - //pthread_cond_wait(&my.cond, &my.lock); - //pthread_mutex_unlock(&(my.lock)); return TRUE; } @@ -168,8 +163,6 @@ char * cookies_header(COOKIES this, char *host, char *newton) { - int dlen; - int hlen; NODE *pre; NODE *cur; time_t tmp; @@ -179,7 +172,6 @@ size_t id = pthread_self(); memset(oreo, '\0', sizeof oreo); - hlen = strlen(host); tmp = time(NULL); gmtime_r(&tmp, &tm); @@ -192,36 +184,25 @@ */ const char *domainptr = cookie_get_domain(cur->cookie); if (*domainptr == '.') ++domainptr; - dlen = domainptr ? strlen(domainptr) : 0; - if (cur->threadID == id) { - if (!strcasecmp(domainptr, host)) { + if (my.get || cur->threadID == id) { + if (__endswith(host, domainptr)) { if (cookie_get_expires(cur->cookie) <= now && cookie_get_session(cur->cookie) != TRUE) { cookies_delete(this, cookie_get_name(cur->cookie)); continue; } - if (strlen(oreo) > 0) - strncat(oreo, ";", sizeof(oreo) - 10 - strlen(oreo)); - strncat(oreo, cookie_get_name(cur->cookie), sizeof(oreo) - 10 - strlen(oreo)); - strncat(oreo, "=", sizeof(oreo) - 10 - strlen(oreo)); - strncat(oreo, cookie_get_value(cur->cookie), sizeof(oreo) - 10 - strlen(oreo)); - } - if ((dlen < hlen) && (!strcasecmp(host + (hlen - dlen), domainptr))) { - if (cookie_get_expires(cur->cookie) <= now && cookie_get_session(cur->cookie) != TRUE) { - cookies_delete(this, cookie_get_name(cur->cookie)); - continue; + if (strlen(oreo) > 0) { + xstrncat(oreo, ";", sizeof(oreo) - 10 - strlen(oreo)); } - if (strlen(oreo) > 0) - strncat(oreo, ";", sizeof(oreo) - 10 - strlen(oreo)); - strncat(oreo, cookie_get_name(cur->cookie), sizeof(oreo) - 10 - strlen(oreo)); - strncat(oreo, "=", sizeof(oreo) - 10 - strlen(oreo)); - strncat(oreo, cookie_get_value(cur->cookie), sizeof(oreo) - 10 - strlen(oreo)); + xstrncat(oreo, cookie_get_name(cur->cookie), sizeof(oreo) - 10 - strlen(oreo)); + xstrncat(oreo, "=", sizeof(oreo) - 10 - strlen(oreo)); + xstrncat(oreo, cookie_get_value(cur->cookie), sizeof(oreo) - 10 - strlen(oreo)); } } } if (strlen(oreo) > 0) { - strncpy(newton, "Cookie: ", 8); - strncat(newton, oreo, MAX_COOKIE_SIZE); - strncat(newton, "\015\012", 2); + strncpy(newton, "Cookie: ", 9); + xstrncat(newton, oreo, MAX_COOKIE_SIZE); + xstrncat(newton, "\015\012", 2); } return newton; @@ -407,5 +388,21 @@ return TRUE; } return FALSE; +} + + +private BOOLEAN +__endswith(const char *str, const char *suffix) +{ + if (!str || !suffix) + return FALSE; + size_t lenstr = strlen(str); + size_t lensuffix = strlen(suffix); + if (lensuffix > lenstr) + return FALSE; + if (! strncmp(str + lenstr - lensuffix, suffix, lensuffix)) { + return TRUE; + } + return FALSE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/date.c new/siege-4.1.5/src/date.c --- old/siege-4.0.9/src/date.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/date.c 2022-08-02 14:14:58.000000000 +0200 @@ -456,7 +456,7 @@ (val < 1300) && (indate< date) && ((date[-1] == '+' || date[-1] == '-'))) { - /* four digits and a value less than 1300 and it is preceeded with + /* four digits and a value less than 1300 and it is preceded with a plus or minus. This is a time zone indication. */ found = TRUE; tzoff = (val/100 * 60 + val%100)*60; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/eval.c new/siege-4.1.5/src/eval.c --- old/siege-4.0.9/src/eval.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/eval.c 2022-08-02 14:14:58.000000000 +0200 @@ -34,6 +34,34 @@ #include <util.h> char * +escape(char *buf) +{ + size_t i = 0; + size_t len; + char *res; + char fin[BUFSIZE]; + + res = xrealloc(buf, BUFSIZE * sizeof(char)); + if (res != NULL) { + buf = res; + } + + len = strlen(buf); + while (i < len && buf[i] != '\\') { + i++; + } + + while (i < len) { + buf[i] = buf[i + 1]; + i++; + } + buf[len] = '\0'; + xstrncpy(fin, buf, len+1); + xstrncpy(res, fin, strlen(fin)+1); + return res; +} + +char * evaluate(HASH hash, char *buf) { int x = 0; @@ -74,14 +102,12 @@ } } - memset(final, '\0', sizeof final); - strncpy( final, buf, len); + xstrncpy(final, buf, len+1); if (string != NULL) { strcat(final, ENV==0?(char*)hash_get(hash, string):getenv(string)); } strcat(final, scan); - memset(result, '\0', BUFSIZE * sizeof(char)); - strncpy(result, final, strlen(final)); + xstrncpy(result, final, strlen(final)+1); xfree(string); return result; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/eval.h new/siege-4.1.5/src/eval.h --- old/siege-4.0.9/src/eval.h 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/eval.h 2022-08-02 14:14:58.000000000 +0200 @@ -28,6 +28,7 @@ #define BUFSIZE 40000 +char *escape(char *buf); char *evaluate(HASH hash, char *buf); #endif/*EVAL_H*/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/ftp.c new/siege-4.1.5/src/ftp.c --- old/siege-4.0.9/src/ftp.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/ftp.c 2022-08-02 14:14:58.000000000 +0200 @@ -44,7 +44,12 @@ code = __response(C); if (! okay(code)) { - NOTIFY(ERROR, "FTP: Server responded: %d", code); + C->ftp.code = code; + if (code == 421) { + DISPLAY(RED, "[ERROR] FTP: Server responded: 421 - Service unavailable"); + } else { + NOTIFY(ERROR, "FTP: Server responded: %d", code); + } return FALSE; } @@ -296,11 +301,17 @@ x++; } if (isdigit(C->chkbuf[0]) && (C->chkbuf[3] != '-')) break; + if (x == 0 && n == 0) break; } code = __response_code(C->chkbuf); if (C->chkbuf[3] == ' ') { cont = FALSE; } + if (strlen(C->chkbuf) == 0 && n == 0 && x == 0) { + // we connected but didn't get a response + code = 421; + cont = FALSE; + } } if (code > 499 && !my.quiet) { printf("%s\n", chomp(C->chkbuf)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/http.c new/siege-4.1.5/src/http.c --- old/siege-4.0.9/src/http.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/http.c 2022-08-02 14:14:58.000000000 +0200 @@ -491,6 +491,9 @@ if (strncasecmp(line, LOCATION, strlen(LOCATION)) == 0) { response_set_location(resp, line); } + if (strncasecmp(line, CONTENT_LOCATION, strlen(CONTENT_LOCATION)) == 0) { + response_set_location(resp, line); + } if (strncasecmp(line, LAST_MODIFIED, strlen(LAST_MODIFIED)) == 0) { response_set_last_modified(resp, line); char *date; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/init.c new/siege-4.1.5/src/init.c --- old/siege-4.0.9/src/init.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/init.c 2022-08-02 14:14:58.000000000 +0200 @@ -262,12 +262,14 @@ int readline(char **s, FILE *fp) { - int c; - int i; - int len = 0; - int size = 0; - char *tmp = NULL; - char *ptr = NULL; + int c; + int i; + int len = 0; + int size = 0; + char *tmp = NULL; + char *ptr = NULL; + char *txt = NULL; + BOOLEAN lop = TRUE; ptr = xmalloc(LINESZ); size = LINESZ; @@ -305,9 +307,22 @@ ptr = tmp; } ptr[len] = '\0'; - + + /** + * This condition is a band-aid. Some passwords + * contain '#' which are treated like comments in + * the siege.conf file. So if a line begins with + * login, we won't treat '#' as a comment. If lop + * is FALSE, we won't null out the line. + */ + txt = strdup(ptr); + trim(txt); + if (strncmp(txt, "login", 5) == 0) { + lop = FALSE; + } + xfree(txt); for (i = 0; ptr[i] != '\0'; i++) { - if (ptr[i] == '#') { + if (ptr[i] == '#' && lop == TRUE) { ptr[i] = '\0'; } } @@ -425,7 +440,7 @@ my.shlog = FALSE; } else if (strmatch(option, "logfile")) { - strncpy(my.logfile, value, sizeof(my.logfile)); + xstrncpy(my.logfile, value, sizeof(my.logfile)); } else if (strmatch(option, "concurrent")) { if (value != NULL) { @@ -503,14 +518,13 @@ } } else if (strmatch(option, "file")) { - memset(my.file, 0, sizeof(my.file)); - strncpy(my.file, value, sizeof(my.file)); + xstrncpy(my.file, value, sizeof(my.file)); } else if (strmatch(option, "url")) { my.url = stralloc(value); } else if (strmatch(option, "user-agent")) { - strncpy(my.uagent, value, sizeof(my.uagent)); + xstrncpy(my.uagent, value, sizeof(my.uagent)); } else if (strmatch(option, "accept-encoding")) { BOOLEAN compress = FALSE; @@ -520,7 +534,7 @@ if (compress == TRUE && zlib == FALSE) { NOTIFY(WARNING, "Zip encoding disabled; siege requires zlib support to enable it"); } else { - strncpy(my.encoding, value, sizeof(my.encoding)); + xstrncpy(my.encoding, value, sizeof(my.encoding)); } } #if 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/main.c new/siege-4.1.5/src/main.c --- old/siege-4.0.9/src/main.c 2021-04-17 16:02:56.000000000 +0200 +++ new/siege-4.1.5/src/main.c 2022-08-02 14:14:58.000000000 +0200 @@ -104,13 +104,12 @@ */ char name[128]; - memset(name, 0, sizeof name); - strncpy(name, program_name, strlen(program_name)); + xstrncpy(name, program_name, sizeof(name)); - if(my.debug){ + if (my.debug) { fprintf(stderr,"%s %s: debugging enabled\n\n%s\n", uppercase(name, strlen(name)), version_string, copyright); } else { - if(b == TRUE){ + if (b == TRUE) { fprintf(stderr,"%s %s\n\n%s\n", uppercase(name, strlen(name)), version_string, copyright); exit(EXIT_SUCCESS); } else { @@ -166,11 +165,11 @@ /** * our work is done, exit nicely */ - exit( EXIT_SUCCESS ); + exit(EXIT_SUCCESS); } /* Check the command line for the presence of the -R or --RC switch. We - * need to do this seperately from the other command line switches because + * need to do this separately from the other command line switches because * the options are initialized from the .siegerc file before the command line * switches are parsed. The argument index is reset before leaving the * function. */ @@ -242,8 +241,11 @@ case 'l': my.logging = TRUE; if (optarg) { - my.logfile[strlen(optarg)] = '\0'; - strncpy(my.logfile, optarg, strlen(optarg)); + if (strlen(optarg) > sizeof(my.logfile)) { + fprintf(stderr, "ERROR: -l/--logfile is limited to %ld in length", sizeof(my.logfile)); + exit(1); + } + xstrncpy(my.logfile, optarg, strlen(optarg)+1); } break; case 'm': @@ -268,9 +270,8 @@ parse_time(optarg); break; case 'f': - memset(my.file, 0, sizeof(my.file)); if(optarg == NULL) break; /*paranoia*/ - strncpy(my.file, optarg, strlen(optarg)); + xstrncpy(my.file, optarg, strlen(optarg)+1); break; case 'A': strncpy(my.uagent, optarg, 255); @@ -432,7 +433,6 @@ } cookies = load_cookies(my.cookies); - for (i = 0; i < my.cusers; i++) { char tmp[4096]; BROWSER B = new_browser(i); @@ -449,15 +449,19 @@ /** * Scenario: -r once/--reps=once */ - int len = (array_length(urls)/my.cusers); - ARRAY tmp = new_array(); - for (j = 0; j < ((i+1) * len) && j < (int)array_length(urls); j++) { + int n_urls = array_length(urls); + int per_user = n_urls / my.cusers; + int remainder = n_urls % my.cusers; + int begin_url = i * per_user + ((i < remainder) ? i : remainder); + int end_url = (i + 1) * per_user + ((i < remainder) ? (i + 1) : remainder); + ARRAY url_slice = new_array(); + for (j = begin_url; j < end_url && j < n_urls; j++) { URL u = array_get(urls, j); if (u != NULL && url_get_hostname(u) != NULL && strlen(url_get_hostname(u)) > 1) { - array_npush(tmp, array_get(urls, j), URLSIZE); + array_npush(url_slice, u, URLSIZE); } - } - browser_set_urls(B, urls); + } + browser_set_urls(B, url_slice); } array_npush(browsers, B, BROWSERSIZE); } @@ -522,7 +526,7 @@ pthread_usleep_np(10000); - if (!my.quiet) { + if (! my.quiet && ! my.get) { if (my.failures > 0 && my.failed >= my.failures) { fprintf(stderr, "%s aborted due to excessive socket failure; you\n", program_name); fprintf(stderr, "can change the failure threshold in $HOME/.%src\n", program_name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/memory.c new/siege-4.1.5/src/memory.c --- old/siege-4.0.9/src/memory.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/memory.c 2022-08-02 14:14:58.000000000 +0200 @@ -27,6 +27,29 @@ #include <string.h> #include <stdarg.h> +char * +xstrncpy(char* dest, const char*src, size_t len) +{ + memset(dest, '\0', len); + memcpy(dest, src, strnlen(src, len-1)); + return dest; +} + +char * +xstrncat(char *dest, const char *src, size_t len) +{ + if (src == NULL) { + NOTIFY(ERROR, "source string has no value!"); + return NULL; + } + if (dest == NULL) { + NOTIFY(ERROR, "source string has no value!"); + return NULL; + } + strncat(dest, src, len); + return dest; +} + char * xstrdup(const char *str) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/memory.h new/siege-4.1.5/src/memory.h --- old/siege-4.0.9/src/memory.h 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/memory.h 2022-08-02 14:14:58.000000000 +0200 @@ -26,6 +26,8 @@ char * xstrdup(const char *str); char * xstrcat(const char *arg1, ...); +char * xstrncat(char *dest, const char *src, size_t len); +char * xstrncpy(char* dest, const char *src, size_t len); void * xrealloc(void *, size_t); void * xmalloc (size_t); void * xcalloc (size_t, size_t); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/parser.c new/siege-4.1.5/src/parser.c --- old/siege-4.0.9/src/parser.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/parser.c 2022-08-02 14:14:58.000000000 +0200 @@ -157,7 +157,7 @@ for (ptr = strtok_r(NULL, CONTROL_TOKENS, &aid); ptr != NULL; ptr = strtok_r(NULL, CONTROL_TOKENS, &aid)) { if (strncasecmp(ptr, "content", 7) == 0) { for (ptr = strtok_r(NULL, CONTROL_TOKENS, &aid); ptr != NULL; ptr = strtok_r(NULL, CONTROL_TOKENS, &aid)) { - if (__strcasestr(ptr, "url") != NULL) { + if (__strcasestr(ptr, "; url=") != NULL || __strcasestr(ptr, ";url=") != NULL) { ptr = strtok_r(NULL, CONTROL_TOKENS_QUOTES, &aid); if (ptr != NULL) { URL U = url_normalize(base, ptr); @@ -227,8 +227,7 @@ if (strncasecmp(ptr, "href", 4) == 0) { ptr = strtok_r(NULL, CONTROL_TOKENS_QUOTES, &aid); if (ptr != NULL) { - memset(buf, '\0', sizeof(buf)); - strncpy(buf, ptr, strlen(ptr)); + xstrncpy(buf, ptr, strlen(ptr)+1); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/response.c new/siege-4.1.5/src/response.c --- old/siege-4.0.9/src/response.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/response.c 2022-08-02 14:14:58.000000000 +0200 @@ -302,6 +302,16 @@ hash_add(this->headers, REDIRECT, "true"); xfree(tmp); } + if (strncasecmp(line, CONTENT_LOCATION, strlen(CONTENT_LOCATION)) == 0) { + len = strlen(line); + tmp = xmalloc(len); + memset(tmp, '\0', len); + memmove(tmp, line+18, len-17); + tmp[len-18] = '\0'; + hash_add(this->headers, LOCATION, (void*)tmp); + hash_add(this->headers, REDIRECT, "true"); + xfree(tmp); + } return __boolean_value(this, REDIRECT, FALSE); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/response.h new/siege-4.1.5/src/response.h --- old/siege-4.0.9/src/response.h 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/response.h 2022-08-02 14:14:58.000000000 +0200 @@ -55,6 +55,7 @@ #define CONTENT_ENCODING "content-encoding" #define CONTENT_LENGTH "content-length" #define CONTENT_TYPE "content-type" +#define CONTENT_LOCATION "content-location" #define ETAG "etag" #define EXPIRES "expires" #define KEEPALIVE_MAX "keepalive-max" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/setup.h new/siege-4.1.5/src/setup.h --- old/siege-4.0.9/src/setup.h 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/setup.h 2022-08-02 14:14:58.000000000 +0200 @@ -150,74 +150,74 @@ */ struct CONFIG { - BOOLEAN logging; /* boolean, log transactions to log file */ - BOOLEAN shlog; /* show log file configuration directive. */ - int limit; /* Limits the thread count to int */ - char *url; /* URL for the single hit invocation. */ - char logfile[128]; /* alternative user defined simbot.log */ - BOOLEAN verbose; /* boolean, verbose output to screen */ - BOOLEAN quiet; /* boolean, turn off all output to screen */ - BOOLEAN parser; /* boolean, turn on/off the HTML parser */ - BOOLEAN csv; /* boolean, display verbose output in CSV */ - BOOLEAN fullurl; /* boolean, display full url in verbose */ - BOOLEAN display; /* boolean, display the thread id verbose */ - BOOLEAN config; /* boolean, prints the configuration */ - BOOLEAN color; /* boolean, true for color, false for not */ - int cusers; /* default concurrent users value. */ - float delay; /* range for random time delay, see -d */ - int timeout; /* socket connection timeout value, def:10 */ - BOOLEAN bench; /* signifies a benchmarking run, no delay */ - BOOLEAN internet; /* use random URL selection if TRUE */ - BOOLEAN timestamp; /* timestamp the output */ - int time; /* length of the siege in hrs, mins, secs */ - int secs; /* time value for the lenght of the siege */ - int reps; /* reps to run the test, default infinite */ - char file[128]; /* urls.txt file, default in joepath.h */ - int length; /* length of the urls array, made global */ - LINES * nomap; /* list of hosts to not follow */ - BOOLEAN debug; /* boolean, undocumented debug command */ - BOOLEAN chunked; /* boolean, accept chunked encoding */ - BOOLEAN unique; /* create unique files for upload */ - BOOLEAN get; /* get header information for debugging */ - BOOLEAN print; /* get header and page for debugging */ - BOOLEAN mark; /* signifies a log file mark req. */ - char *markstr; /* user defined string value to mark file */ - int protocol; /* 0=HTTP/1.0; 1=HTTP/1.1 */ - COOKIES cookies; /* cookies */ - char uagent[256]; /* user defined User-Agent string. */ - char encoding[256]; /* user defined Accept-Encoding string. */ - char conttype[256]; /* user defined default content type. */ - int bids; /* W & P authorization bids before failure */ + BOOLEAN logging; /* boolean, log transactions to log file */ + BOOLEAN shlog; /* show log file configuration directive. */ + int limit; /* Limits the thread count to int */ + char *url; /* URL for the single hit invocation. */ + char logfile[4096]; /* alternative logfile defined in siegerc */ + BOOLEAN verbose; /* boolean, verbose output to screen */ + BOOLEAN quiet; /* boolean, turn off all output to screen */ + BOOLEAN parser; /* boolean, turn on/off the HTML parser */ + BOOLEAN csv; /* boolean, display verbose output in CSV */ + BOOLEAN fullurl; /* boolean, display full url in verbose */ + BOOLEAN display; /* boolean, display the thread id verbose */ + BOOLEAN config; /* boolean, prints the configuration */ + BOOLEAN color; /* boolean, true for color, false for not */ + int cusers; /* default concurrent users value. */ + float delay; /* range for random time delay, see -d */ + int timeout; /* socket connection timeout value, def:10 */ + BOOLEAN bench; /* signifies a benchmarking run, no delay */ + BOOLEAN internet; /* use random URL selection if TRUE */ + BOOLEAN timestamp; /* timestamp the output */ + int time; /* length of the siege in hrs, mins, secs */ + int secs; /* time value for the lenght of the siege */ + int reps; /* reps to run the test, default infinite */ + char file[255]; /* urls.txt file, default in joepath.h */ + int length; /* length of the urls array, made global */ + LINES * nomap; /* list of hosts to not follow */ + BOOLEAN debug; /* boolean, undocumented debug command */ + BOOLEAN chunked; /* boolean, accept chunked encoding */ + BOOLEAN unique; /* create unique files for upload */ + BOOLEAN get; /* get header information for debugging */ + BOOLEAN print; /* get header and page for debugging */ + BOOLEAN mark; /* signifies a log file mark req. */ + char *markstr; /* user defined string value to mark file */ + int protocol; /* 0=HTTP/1.0; 1=HTTP/1.1 */ + COOKIES cookies; /* cookies */ + char uagent[256]; /* user defined User-Agent string. */ + char encoding[256]; /* user defined Accept-Encoding string. */ + char conttype[256]; /* user defined default content type. */ + int bids; /* W & P authorization bids before failure */ AUTH auth; - BOOLEAN keepalive; /* boolean, connection keep-alive value */ - int signaled; /* timed based testing notification bool. */ - char extra[2048]; /* extra http request headers */ + BOOLEAN keepalive; /* boolean, connection keep-alive value */ + int signaled; /* timed based testing notification bool. */ + char extra[2048]; /* extra http request headers */ #if 0 struct { - BOOLEAN required; /* boolean, TRUE == use a proxy server. */ - char *hostname; /* hostname for the proxy server. */ - int port; /* port number for proxysrv */ - char *encode; /* base64 encoded username and password */ + BOOLEAN required; /* boolean, TRUE == use a proxy server. */ + char *hostname; /* hostname for the proxy server. */ + int port; /* port number for proxysrv */ + char *encode; /* base64 encoded username and password */ } proxy; #endif - BOOLEAN login; /* boolean, client must login first. */ - char *loginurl; /* XXX: deprecated the initial login URL */ + BOOLEAN login; /* boolean, client must login first. */ + char *loginurl; /* XXX: deprecated the initial login URL */ ARRAY lurl; - int failures; /* number of failed attempts before abort. */ - int failed; /* total number of socket failures. */ - BOOLEAN escape; /* boolean, TRUE == url-escaping */ - BOOLEAN expire; /* boolean, TRUE == expire cookies ea. run */ - BOOLEAN follow; /* boolean, TRUE == follow 302 */ - BOOLEAN zero_ok; /* boolean, TRUE == zero bytes data is OK. */ - BOOLEAN spinner; /* boolean, TRUE == spin, FALSE not so much*/ - BOOLEAN cache; /* boolean, TRUE == cache revalidate */ - char rc[256]; /* filename of SIEGERC file */ - int ssl_timeout; /* SSL session timeout */ - char *ssl_cert; /* PEM certificate file for client auth */ - char *ssl_key; /* PEM private key file for client auth */ - char *ssl_ciphers; /* SSL chiphers to use : delimited */ - METHOD method; /* HTTP method for --get requests */ - BOOLEAN json_output; /* boolean, TRUE == print stats in json */ + int failures; /* number of failed attempts before abort. */ + int failed; /* total number of socket failures. */ + BOOLEAN escape; /* boolean, TRUE == url-escaping */ + BOOLEAN expire; /* boolean, TRUE == expire cookies ea. run */ + BOOLEAN follow; /* boolean, TRUE == follow 302 */ + BOOLEAN zero_ok; /* boolean, TRUE == zero bytes data is OK. */ + BOOLEAN spinner; /* boolean, TRUE == spin, FALSE not so much*/ + BOOLEAN cache; /* boolean, TRUE == cache revalidate */ + char rc[256]; /* filename of SIEGERC file */ + int ssl_timeout; /* SSL session timeout */ + char *ssl_cert; /* PEM certificate file for client auth */ + char *ssl_key; /* PEM private key file for client auth */ + char *ssl_ciphers; /* SSL chiphers to use : delimited */ + METHOD method; /* HTTP method for --get requests */ + BOOLEAN json_output; /* boolean, TRUE == print stats in json */ pthread_cond_t cond; pthread_mutex_t lock; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/ssl.c new/siege-4.1.5/src/ssl.c --- old/siege-4.0.9/src/ssl.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/ssl.c 2022-08-02 14:14:58.000000000 +0200 @@ -62,7 +62,7 @@ unsigned long SSL_pthreads_thread_id(void); #ifdef HAVE_SSL private void SSL_error_stack(void); -private void SSL_pthreads_locking_callback(int m, int t, char *f, int l); +public void SSL_pthreads_locking_callback(int mode, int type, char *file, int line); #endif/*HAVE_SSL*/ BOOLEAN @@ -222,14 +222,13 @@ lock_count=(long *)NULL; } CRYPTO_cleanup_all_ex_data(); - ERR_remove_state(0); ERR_free_strings(); EVP_cleanup(); CRYPTO_cleanup_all_ex_data(); -#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(OPENSSL_USE_DEPRECATED) - ERR_remove_state(0); -#else - ERR_remove_thread_state(NULL); +#if OPENSSL_VERSION_NUMBER >= 0x10000000L && OPENSSL_VERSION_NUMBER < 0x10100000L + ERR_remove_thread_state(NULL); +#elif OPENSSL_VERSION_NUMBER < 0x10000000L + ERR_remove_state(0); #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/timer.c new/siege-4.1.5/src/timer.c --- old/siege-4.0.9/src/timer.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/timer.c 2022-08-02 14:14:58.000000000 +0200 @@ -39,7 +39,7 @@ if (time(&now) < 0) { NOTIFY(FATAL, "unable to set the siege timer!"); } - timeout.tv_sec=now + my.secs; + timeout.tv_sec=now + my.secs + 1; timeout.tv_nsec=0; pthread_mutex_lock(&timer_mutex); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/url.c new/siege-4.1.5/src/url.c --- old/siege-4.0.9/src/url.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/url.c 2022-08-02 14:14:58.000000000 +0200 @@ -1,7 +1,7 @@ /** * URL Support * - * Copyright (C) 2013-2015 + * Copyright (C) 2013-2022 * Jeffrey Fulmer - <j...@joedog.org>, et al. * Copyright (C) 1999 by * Jeffrey Fulmer - <j...@joedog.org>. @@ -127,7 +127,9 @@ xfree(this->username); xfree(this->password); xfree(this->hostname); - xfree(this->path); + if (this->path != NULL && this->path[0] != '\0') { + xfree(this->path); + } xfree(this->file); xfree(this->query); xfree(this->frag); @@ -494,7 +496,7 @@ if ((location[0] != '/') && location[0] != '.' && (strchr(location, '.') != NULL && strchr(location, '/') != NULL)) { /** - * This is probably host/path; it doesn't start with relevent path + * This is probably host/path; it doesn't start with relevant path * indicators and it contains the hallmarks of host/path namely at * least one dot and slash */ @@ -699,20 +701,20 @@ if (!strncasecmp(url, "http:", 5)){ n = 7; - strncpy(scheme, "http", 4); + strncpy(scheme, "http", 5); } if (!strncasecmp(url, "https:", 6)){ n = 8; - strncpy(scheme, "https", 5); + strncpy(scheme, "https", 6); } if (!strncasecmp(url, "ftp:", 4)){ n = 6; - strncpy(scheme, "ftp", 3); + strncpy(scheme, "ftp", 4); } if (strlen(scheme) < 3) { // A scheme wasn't supplied; we'll use http by default. n = 7; - strncpy(scheme, "http", 4); + strncpy(scheme, "http", 5); } len = strlen(url)+5; @@ -949,7 +951,7 @@ private char * __url_set_path(URL this, char *str) { - int i; // capture the lenght of the path + int i; // capture the length of the path int j; // capture the length of the request (sans frag) char *c; @@ -974,17 +976,24 @@ for (j = 0; str[j] && (str[j] != '#' && !isspace(str[j])); j++); if (str[i] != '/') { - this->path = xmalloc(2); - this->request = xmalloc(2); - strncpy(this->path, "/", 2); - strncpy(this->request, "/", 2); - this->path[1] = '\0'; - this->request[1] = '\0'; + if (this->scheme == FTP) { + this->path = ""; + } else { + this->path = xmalloc(2); + this->request = xmalloc(2); + strncpy(this->path, "/", 2); + strncpy(this->request, "/", 2); + this->path[1] = '\0'; + this->request[1] = '\0'; + } } else { this->path = xmalloc(i+2); memcpy(this->path, str, i+1); this->path[i] = '/'; this->path[i + 1] = '\0'; + if (this->scheme == FTP && this->path[0] == '/') { + memmove(this->path, this->path+1, strlen(this->path)); + } } trim(this->request); str += i + 1; @@ -1031,7 +1040,9 @@ int i; if (str==NULL) return NULL; - if (this->params != NULL && strlen(this->params) > 1) return str; + if (this->params != NULL && strlen(this->params) > 1) { + return str; + } if (this->hasparams == FALSE) { this->params = ""; @@ -1320,15 +1331,13 @@ ins += rlen; tmp = p + nlen; } + if (strlen(buf) > strlen(url)){ str = (char *)realloc(url, strlen(buf)+1); if (str == NULL) { return; } url = str; - memset(url, '\0', strlen(buf)+1); - } else { - memset(url, '\0', strlen(url)); } - strncpy(url, buf, strlen(buf)); + xstrncpy(url, buf, strlen(buf)+1); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/util.c new/siege-4.1.5/src/util.c --- old/siege-4.0.9/src/util.c 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/src/util.c 2022-08-02 14:14:58.000000000 +0200 @@ -229,6 +229,7 @@ pthread_mutex_lock(&timer_mutex); err = pthread_cond_timedwait(&timer_cond, &timer_mutex, &timeout); + pthread_mutex_unlock(&timer_mutex); pthread_setcanceltype(type,NULL); pthread_testcancel(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/src/version.c new/siege-4.1.5/src/version.c --- old/siege-4.0.9/src/version.c 2021-04-17 16:03:10.000000000 +0200 +++ new/siege-4.1.5/src/version.c 2022-08-02 14:47:08.000000000 +0200 @@ -4,12 +4,12 @@ * used by configure to dynamically assign those values * to documentation files. */ -const char *version_string = "4.0.9"; +const char *version_string = "4.1.5"; const char *program_name = "siege"; const char *author_name = "Jeffrey Fulmer, et al."; const char *email_address = "j...@joedog.org"; -const char *years = "1999-2021"; -const char *copyright = "Copyright (C) 2021 by Jeffrey Fulmer, et al.\n\ +const char *years = "1999-2022"; +const char *copyright = "Copyright (C) 2022 by Jeffrey Fulmer, et al.\n\ This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS\n\ FOR A PARTICULAR PURPOSE.\n"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/utils/Makefile.am new/siege-4.1.5/utils/Makefile.am --- old/siege-4.0.9/utils/Makefile.am 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/utils/Makefile.am 2022-08-02 14:46:35.000000000 +0200 @@ -35,6 +35,7 @@ config.sub \ install-sh \ ltmain.sh \ +manifier \ mdate-sh \ missing \ mkinstalldirs \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/utils/Makefile.in new/siege-4.1.5/utils/Makefile.in --- old/siege-4.0.9/utils/Makefile.in 2021-04-17 16:10:52.000000000 +0200 +++ new/siege-4.1.5/utils/Makefile.in 2022-08-02 19:02:49.000000000 +0200 @@ -209,6 +209,7 @@ config.sub \ install-sh \ ltmain.sh \ +manifier \ mdate-sh \ missing \ mkinstalldirs \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/utils/manifier new/siege-4.1.5/utils/manifier --- old/siege-4.0.9/utils/manifier 1970-01-01 01:00:00.000000000 +0100 +++ new/siege-4.1.5/utils/manifier 2022-08-02 14:14:58.000000000 +0200 @@ -0,0 +1,14 @@ +#!/usr/bin/perl +use Pod::Man; +my $input = $ARGV[0] or barf(); +my $output = $ARGV[1] or barf(); +my $name = $ARGV[2] or barf(); +my $section = $ARGV[3] or barf(); + +my $parser = Pod::Man->new (release => $VERSION, center => $name, section => $section, release => 'JoeDog'); +$parser->parse_from_file ($input, $output); + +sub barf() { + print "usage: $0 <file.pod> <file.1> <section[num]>\n"; + exit(1); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/siege-4.0.9/utils/siege2csv.in new/siege-4.1.5/utils/siege2csv.in --- old/siege-4.0.9/utils/siege2csv.in 2021-03-17 14:46:40.000000000 +0100 +++ new/siege-4.1.5/utils/siege2csv.in 2022-08-02 14:14:58.000000000 +0200 @@ -1,6 +1,6 @@ #!%_PERL% #siege2csv.pl is a perl script that parses the output from bombardmnet.sh -#into comma seperated values for easy use with spreadsheets. +#into comma separated values for easy use with spreadsheets. #Copyright (C) 2001 Peter J. Hutnick #This program is distributed in the hope that it will be useful,