# # QS_ClientEventRequestLimit 2 # QS_ClientIpFromHeader X-Frwd-Address # # SetEnvIfPlus User-Agent ^QS_ClientEventRequestLimit QS_EventRequest=1 # # INCLUDE scripts/ports EXEC ./ctl.sh restart -D real_ip -D fromHeader >/dev/null CLIENT 2 _REQ localhost $QS_PORT_BASE __GET /cgi/sleep.cgi HTTP/1.1 __Host: localhost __Connection: keep-alive __User-Agent: QS_ClientEventRequestLimit __X-Frwd-Address: 183.123.12.3 __ _EXPECT . "200 OK" _EXPECT . "done" _WAIT END CLIENT _EXEC echo "[`date '+%a %b %d %H:%M:%S.000000 %Y'`] [test:notice] [pid $$:tid 0] htt: 053_QS_ClientEventLimitCount.htt" >> logs/error_log _SLEEP 200 _REQ localhost $QS_PORT_BASE __GET /cgi/sleep.cgi HTTP/1.1 __Host: localhost __Connection: keep-alive __User-Agent: QS_ClientEventRequestLimit __X-Frwd-Address: 183.123.12.3 __ _EXPECT . "!200 OK" _EXPECT . "503 Service Unavailable" _EXPECT . "custom error page" _EXPECT . "code=065" _WAIT _CLOSE _SLEEP 200 _EXPECT EXEC "mod_qos\(065\): access denied, QS_ClientEventRequestLimit rule: max=2, current=3, c=183.123.12.3" _EXEC tail -1 logs/error_log _SLEEP 3000 _REQ localhost $QS_PORT_BASE __GET /cgi/sleep.cgi HTTP/1.1 __Host: localhost __Connection: keep-alive __User-Agent: QS_ClientEventRequestLimit __X-Frwd-Address: 183.123.12.3 __ _EXPECT . "200 OK" _EXPECT . "done" _WAIT END CLIENT _SLEEP 200 _REQ localhost $QS_PORT_BASE __GET /cgi/sleep.cgi HTTP/1.1 __Host: localhost __Connection: keep-alive __User-Agent: QS_ClientEventRequestLimit __X-Frwd-Address: 123.48.2.7 __ _EXPECT . "200 OK" _EXPECT . "done" _WAIT END BLOCK FINALLY _EXEC ./ctl.sh restart 2>/dev/null 1>/dev/null END