From: Art Cancro Date: Tue, 25 Nov 2003 03:32:53 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v7.86~5691 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=79e78e96a353dec51378481145e9e56ad1b223de *** empty log message *** --- diff --git a/ctdlphp/ctdlprotocol.php b/ctdlphp/ctdlprotocol.php index a104d03bb..52e09f7c1 100644 --- a/ctdlphp/ctdlprotocol.php +++ b/ctdlphp/ctdlprotocol.php @@ -43,7 +43,7 @@ function text_to_server($thetext, $convert_to_html) { $this_line = strtok($thetext, "\n"); - while ($this_line) { + while ($this_line !== FALSE) { $this_line = trim($this_line, "\n\r"); if ($this_line == "000") $this_line = "-000" ; serv_puts($this_line); diff --git a/ctdlphp/sessionproxy.php b/ctdlphp/sessionproxy.php index 0ace0b57e..75bd90243 100755 --- a/ctdlphp/sessionproxy.php +++ b/ctdlphp/sessionproxy.php @@ -18,8 +18,9 @@ // sock_gets() -- reads one line of text from a socket // function sock_gets($sock) { + socket_clear_error($msgsock); $buf = socket_read($sock, 4096, PHP_NORMAL_READ); - if ($buf == false) return false; + if (socket_last_error($buf)) return false; if (preg_match("'\n$'s", $buf)) { $buf = substr($buf, 0, strpos($buf, "\n")); @@ -157,8 +158,9 @@ do { // SEND_LISTING mode if (substr($talkback, 0, 1) == "4") do { + socket_clear_error($msgsock); $buf = sock_gets($msgsock); - if (!$buf) { + if (socket_last_error($msgsock)) { $buf = "000" ; } if (!fwrite($ctdlsock, $buf . "\n")) {