#define STDC_HEADERS 1
/* Most recent revision number in the version control system */
-#define VCS_REVISION "168"
+#define VCS_REVISION "169"
/* Version number of package */
#define VERSION "2.9"
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-VCS_REVISION=168
+VCS_REVISION=169
cat >>confdefs.h <<_ACEOF
dnl This is the one location where the authoritative version number is stored
AC_INIT(shellinabox, 2.9, markus@shellinabox.com)
-VCS_REVISION=168
+VCS_REVISION=169
AC_SUBST(VCS_REVISION)
AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
[Most recent revision number in the version control system])
};
VT100.prototype.about = function() {
- alert("VT100 Terminal Emulator " + "2.9 (revision 168)" +
+ alert("VT100 Terminal Emulator " + "2.9 (revision 169)" +
"\nCopyright 2008-2009 by Markus Gutschke\n" +
"For more information check http://shellinabox.com");
};
};
ShellInABox.prototype.about = function() {
- alert("Shell In A Box version " + "2.9 (revision 168)" +
+ alert("Shell In A Box version " + "2.9 (revision 169)" +
"\nCopyright 2008-2009 by Markus Gutschke\n" +
"For more information check http://shellinabox.com" +
(typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?
// Create a new session, if the client did not provide an existing one
if (isNew) {
- if (cgiServer && cgiSessions++) {
- serverExitLoop(cgiServer, 1);
+ if (keys) {
+ bad_new_session:
abandonSession(session);
httpSendReply(http, 400, "Bad Request", NO_MSG);
return HTTP_DONE;
}
+
+ if (cgiServer && cgiSessions++) {
+ serverExitLoop(cgiServer, 1);
+ goto bad_new_session;
+ }
session->http = http;
if (launchChild(service->id, session) < 0) {
abandonSession(session);
};
VT100.prototype.about = function() {
- alert("VT100 Terminal Emulator " + "2.9 (revision 168)" +
+ alert("VT100 Terminal Emulator " + "2.9 (revision 169)" +
"\nCopyright 2008-2009 by Markus Gutschke\n" +
"For more information check http://shellinabox.com");
};
--- /dev/null
+#!/bin/bash -e
+
+PORT=4201
+PIDFILE=stresstest.pid
+
+rm -f "${PIDFILE}"
+trap '[ -r "${PIDFILE}" ] && kill "$(cat "${PIDFILE}")"; rm -f "${PIDFILE}"' \
+ EXIT INT TERM QUIT HUP
+
+./shellinaboxd -p "${PORT}" -s "/:$(id -u):$(id -g):${PWD}:/bin/bash -c \
+ 'while read i; do [ -z "${i}" ] && break; echo \" $i\"; done'" \
+ --background="${PIDFILE}"
+
+session() {
+ local data="$(wget -O- --post-data='' --quiet "http://localhost:${PORT}/")"
+ local session="${data##*\"session\":\"}"
+ session="${session%%\"*}"
+ while read -r i; do
+ local keys="$(echo -n "${i}" | od -tx1 -An -w1000)"
+ wget -O/dev/null --post-data="session=${session}&keys=${keys// /}" \
+ --quiet "http://localhost:${PORT}/"
+ kill -0 "$(cat "${PIDFILE}")" || break
+ [ -z "$i" ] && break
+ data="$(wget -O- --post-data="session=${session}" \
+ --quiet "http://localhost:${PORT}/")"
+ data=${data##*\"data\":\"}
+ data=${data%%\"*}
+ echo "${data}"
+ done <<'EOF'
+Hello world
+This is a test
+OK, that's it for now
+
+EOF
+}
+
+pids=""
+for i in `seq 100`; do
+ session &
+ pids="${pids} $!"
+ sleep 0.02
+ kill -0 "$(cat "${PIDFILE}")" || break
+done
+wait $pids >&/dev/null