diff options
author | Ermal <eri@pfsense.org> | 2010-08-18 14:34:09 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-08-18 14:35:46 +0000 |
commit | 19e3d450b3c3dad6404ff3131fd9483e1ccc7277 (patch) | |
tree | 35f6c099ac67e22a9637e1c7cb35054091f8302e | |
parent | 3f797235b9f66670f6e7fbf6791883be658f7482 (diff) | |
download | pfsense-19e3d450b3c3dad6404ff3131fd9483e1ccc7277.zip pfsense-19e3d450b3c3dad6404ff3131fd9483e1ccc7277.tar.gz |
Ticket #826. Add timeout of 1 second for all read/write actions performed on the socket. This should fix point 1) on the ticket.
-rw-r--r-- | etc/inc/openvpn.inc | 3 | ||||
-rw-r--r-- | usr/local/www/status_openvpn.php | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index c05105f..4606c89 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -733,6 +733,7 @@ function openvpn_get_active_servers() { /* open a tcp connection to the management port of each server */ $fp = @stream_socket_client($tcpsrv, $errval, $errstr, 1); if ($fp) { + stream_set_timeout($fp, 1); /* send our status request */ fputs($fp, "status 2\n"); @@ -809,7 +810,7 @@ function openvpn_get_active_clients() { /* open a tcp connection to the management port of each cli */ $fp = @stream_socket_client($tcpcli, $errval, $errstr, 1); if ($fp) { - + stream_set_timeout($fp, 1); /* send our status request */ fputs($fp, "state 1\n"); diff --git a/usr/local/www/status_openvpn.php b/usr/local/www/status_openvpn.php index 729ed70..8ee1eec 100644 --- a/usr/local/www/status_openvpn.php +++ b/usr/local/www/status_openvpn.php @@ -72,6 +72,7 @@ function kill_client($port, $remipp) { $fp = @stream_socket_client($tcpsrv, $errval, $errstr, 1); $killed = -1; if ($fp) { + stream_set_timeout($fp, 1); fputs($fp, "kill {$remipp}\n"); while (!feof($fp)) { $line = fgets($fp, 1024); |