summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Angelacos <nangel@alpinelinux.org>2008-12-17 00:04:57 +0000
committerNathan Angelacos <nangel@alpinelinux.org>2008-12-17 00:04:57 +0000
commit63570d1761822e4278df2eaa03068fb4ccb13432 (patch)
treef8bc5b434e313a6f50e9329ba5bc5ae5f364745e
parent57bf42be12123cfa34ff70e4985537582047c14e (diff)
downloadhaserl-63570d1761822e4278df2eaa03068fb4ccb13432.tar.bz2
haserl-63570d1761822e4278df2eaa03068fb4ccb13432.tar.xz
fix bug tracker bug 1959379; prepare for 0.9.25 release
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac2
-rw-r--r--src/haserl.c61
3 files changed, 41 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index 86256b3..d7cbaef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
-2008-04
+2008-12-16
0.9.25
* Somehow version control failed, and the -d debug short
option reverted to -D again. fixed.
+ * haserl.c - "command-line" handling was broken on OSX and BSD
+ fixed. (Mark Blythe)
+ * haserl.c - fix bug where CONTENT_LENGTH=0 would hang haserl
+ (bug tracker bug #1959379)
+ text data bss dec hex filename
+ 19273 824 172 20269 4f2d haserl
2008-04-14
0.9.24
* haserl.c - myputenv caused a segfault when a variable without
diff --git a/configure.ac b/configure.ac
index dde3fe2..1bcdadd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script.
-AC_INIT([haserl],[0.9.24],[Nathan Angelacos <nangel@users.sourceforge.net>],[haserl])
+AC_INIT([haserl],[0.9.25],[Nathan Angelacos <nangel@users.sourceforge.net>],[haserl])
AM_INIT_AUTOMAKE([haserl],[$PACKAGE_VERSION])
# Checks for programs.
diff --git a/src/haserl.c b/src/haserl.c
index 1d0a46d..532458f 100644
--- a/src/haserl.c
+++ b/src/haserl.c
@@ -437,8 +437,11 @@ ReadCGIPOSTValues (list_t * env)
sliding_buffer_t sbuf;
buffer_t token;
unsigned char *data;
+ const char *content_length_string = "CONTENT_LENGTH";
- if (getenv ("CONTENT_LENGTH") == NULL)
+
+ if ((getenv (content_length_string) == NULL) ||
+ (strtoul (getenv (content_length_string), NULL, 10) == 0))
return (0);
if (getenv ("CONTENT_TYPE"))
@@ -456,7 +459,7 @@ ReadCGIPOSTValues (list_t * env)
sbuf.fh = STDIN;
if (getenv ("CONTENT_LENGTH"))
{
- sbuf.maxread = strtoul (getenv ("CONTENT_LENGTH"), NULL, 10);
+ sbuf.maxread = strtoul (getenv (content_length_string), NULL, 10);
}
buffer_init (&token);
@@ -678,45 +681,47 @@ main (int argc, char *argv[])
#ifdef INCLUDE_LUASHELL
" and interpreted"
#endif
- ")\n"
+ ")\n"
#endif
#ifdef BASHEXTENSIONS
- "Unsupported bash extensions supplied by simnux enabled\n"
+ "Unsupported bash extensions supplied by simnux enabled\n"
#endif
);
return (0);
break;
- default: /* more than one */
+ default: /* more than one */
/* split combined #! args - linux bundles them as one */
command = argc_argv (argv[1], &av, "");
if (command > 1)
- {
- /* rebuild argv into new av2 */
- av2c = argc - 1 + command;
- av2 = xmalloc (sizeof (char *) * av2c);
- av2[0] = argv[0];
- for (count = 1; count <= command; count++)
- {
- av2[count] = av[count-1].string;
- }
- for (; count < av2c; count++) {
- av2[count] = argv[count - command + 1];
- }
- }
-
+ {
+ /* rebuild argv into new av2 */
+ av2c = argc - 1 + command;
+ av2 = xmalloc (sizeof (char *) * av2c);
+ av2[0] = argv[0];
+ for (count = 1; count <= command; count++)
+ {
+ av2[count] = av[count - 1].string;
+ }
+ for (; count < av2c; count++)
+ {
+ av2[count] = argv[count - command + 1];
+ }
+ }
+
parseCommandLine (av2c, av2);
free (av);
- if (av2 != argv) free (av2);
+ if (av2 != argv)
+ free (av2);
if (optind < av2c)
- {
- filename = av2[optind];
- }
+ {
+ filename = av2[optind];
+ }
else
- {
- die_with_message (NULL, NULL, "No script file specified");
- }
+ {
+ die_with_message (NULL, NULL, "No script file specified");
+ }
break;
}
@@ -728,7 +733,7 @@ main (int argc, char *argv[])
/* populate the function pointers based on the shell selected */
if (strcmp (global.shell, "lua") && strcmp (global.shell, "luac"))
- /* default to "bash" */
+ /* default to "bash" */
{
#ifdef INCLUDE_BASHSHELL
shell_exec = &bash_exec;
@@ -771,7 +776,7 @@ main (int argc, char *argv[])
global.var_prefix = "FORM.";
global.nul_prefix = "ENV.";
- if (global.shell[3] == 'c') /* luac only */
+ if (global.shell[3] == 'c') /* luac only */
#ifdef INCLUDE_LUACSHELL
shell_doscript = &luac_doscript;
#else