$!-----------------------------------------------------------------------------
$! ABCGI.COM
$!
$! CGI script wrapper for ApacheBench 1.3c
$!
$! To enable use: $ COPY WASD_ROOT:[SRC.UTILS]ABCGI.COM WASD_ROOT:[CGI-BIN]
$! $ COPY HT_EXE:AB.EXE CGI_EXE:AB.EXE
$!
$! 15-JAN-2003 MGD modified for WASD 8.1->
$! 24-JAN-2002 MGD initial
$!-----------------------------------------------------------------------------
$ say == "write sys$output"
$!
$ if WWW_QUERY_STRING .eqs. ""
$ then
$ type sys$input
Content-Type: text/html
abCGI
$ SAY "
$ exit
$ endif
$!
$ if f$type(WWW_FORM_CONCURRENCY) .eqs. "" then WWW_FORM_CONCURRENCY = 0
$ concurrency = f$integer(WWW_FORM_CONCURRENCY)
$ if f$type(WWW_FORM_NUMBER) .eqs. "" then WWW_FORM_NUMBER = 0
$ number = WWW_FORM_NUMBER
$ if f$type(WWW_FORM_URL) .eqs. "" then WWW_FORM_URL = ""
$ url = WWW_FORM_URL
$ keepalive = ""
$ if f$type(WWW_FORM_KEEPALIVE) .nes. "" then keepalive = " -k"
$ if concurrency .lt. 1 then goto paramerr
$ if number .lt. 1 then goto paramerr
$ if f$edit(f$extract(0,7,url),"lowercase") .nes. "http://" then goto paramerr
$ if f$element(2,"/",url) .eqs. "/" then goto paramerr
$ if f$element(3,"/",url) .eqs. "/" then url = url + "/"
$ url = url - """" - """" - """" - """" - """" - """" - """" - """" - """"
$ url = url - "'" - "'" - "'" - "'" - "'" - "'" - "'" - "'" - "'" - "'"
$!
$ ab == "$cgi-bin:[000000]ab"
$ say "Content-Type: text/html"
$ say ""
$ say "ApacheBench CGI"
$ set verify
$ ab -q -w -c 'concurrency' -n 'number''keepalive' "''url'"
$!'f$verify(0)
$ exit
$!
$ paramerr:
$ say "Status: 403 forbidden"
$ say "Content-Type: text/html"
$ say ""
$ say "Parameters not acceptable!"
$ say "
"
$ say "$ ab -c ''concurrency' -n ''number' " +-
"''url'"
$ exit
$!-----------------------------------------------------------------------------