cvs: pear /Net_Server Server.php /Net_Server/Server Driver.php /Net_Server/Server/Driver Fork.php Sequential.php
| From: | Stephan Schmidt | Date: | Fri, 02 Jan 2004 16:26:16 +0000 |
| Subject: | cvs: pear /Net_Server Server.php /Net_Server/Server Driver.php /Net_Server/Server/Driver Fork.php Sequential.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-15274@lists.php.net to get a copy of this message | ||
schst Fri Jan 2 11:26:16 2004 EDT
Modified files:
/pear/Net_Server Server.php
/pear/Net_Server/Server Driver.php
/pear/Net_Server/Server/Driver Fork.php Sequential.php
Log:
fixed some copy&paste bugs
Index: pear/Net_Server/Server.php
diff -u pear/Net_Server/Server.php:1.6 pear/Net_Server/Server.php:1.7
--- pear/Net_Server/Server.php:1.6 Fri Jan 2 11:04:22 2004
+++ pear/Net_Server/Server.php Fri Jan 2 11:26:14 2004
@@ -16,7 +16,7 @@
// | Authors: Stephan Schmidt <schst@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Server.php,v 1.6 2004/01/02 16:04:22 schst Exp $
+// $Id: Server.php,v 1.7 2004/01/02 16:26:14 schst Exp $
require_once 'PEAR.php';
@@ -65,10 +65,10 @@
* See Server/Handler.php for a baseclass that you can
* use to implement new handlers.
*
- * @version 0.10 alpha
+ * @version 0.11 alpha
* @author Stephan Schmidt <schst@php.net>
*/
-class Net_Server extends PEAR {
+class Net_Server {
/**
* create a new server
@@ -90,7 +90,7 @@
}
$type = ucfirst(strtolower($type));
- $driverFile = 'Net/Server/Drivers/' . $type . '.php';
+ $driverFile = 'Net/Server/Driver/' . $type . '.php';
$className = 'Net_Server_' . $type;
if (!@include_once $driverFile) {
Index: pear/Net_Server/Server/Driver.php
diff -u pear/Net_Server/Server/Driver.php:1.1 pear/Net_Server/Server/Driver.php:1.2
--- pear/Net_Server/Server/Driver.php:1.1 Fri Jan 2 11:04:23 2004
+++ pear/Net_Server/Server/Driver.php Fri Jan 2 11:26:15 2004
@@ -16,14 +16,14 @@
// | Authors: Stephan Schmidt <schst@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Driver.php,v 1.1 2004/01/02 16:04:23 schst Exp $
+// $Id: Driver.php,v 1.2 2004/01/02 16:26:15 schst Exp $
/**
* Base class for all drivers
*
* @author Stephan Schmidt <schst@php.net>
*/
-class Net_Server_Driver {
+class Net_Server_Driver extends PEAR {
/**
* port to listen
* @access private
@@ -125,9 +125,6 @@
$this->domain = $domain;
$this->port = $port;
-
- // this is only needed, when server is not run in CLI
- set_time_limit(0);
}
/**
@@ -175,13 +172,23 @@
while($buf = socket_read($this->clientFD[$clientId], $this->readBufferSize)) {
$data .= $buf;
- $endString = substr($buf, - strlen($this->readEndCharacter));
- if ($endString == $this->readEndCharacter) {
- break;
- }
if ($buf == null) {
break;
}
+
+ if ($this->readEndCharacter != null) {
+ $endString = substr($buf, - strlen($this->readEndCharacter));
+ if ($endString == $this->readEndCharacter) {
+ break;
+ }
+ } else {
+ /**
+ * readEndCharacter is set to null => autodetect
+ */
+ if( strlen( $buff ) < $this->readBufferSize ) {
+ break;
+ }
+ }
}
if ($buf === false) {
Index: pear/Net_Server/Server/Driver/Fork.php
diff -u pear/Net_Server/Server/Driver/Fork.php:1.1 pear/Net_Server/Server/Driver/Fork.php:1.2
--- pear/Net_Server/Server/Driver/Fork.php:1.1 Fri Jan 2 11:04:24 2004
+++ pear/Net_Server/Server/Driver/Fork.php Fri Jan 2 11:26:16 2004
@@ -16,7 +16,7 @@
// | Authors: Stephan Schmidt <schst@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Fork.php,v 1.1 2004/01/02 16:04:24 schst Exp $
+// $Id: Fork.php,v 1.2 2004/01/02 16:26:16 schst Exp $
/**
* needs the driver base class
@@ -36,7 +36,6 @@
* - onClose
* - onReceiveData
*
- * @version 0.10 alpha
* @author Stephan Schmidt <schst@php.net>
*/
class Net_Server_Fork extends Net_Server_Driver
Index: pear/Net_Server/Server/Driver/Sequential.php
diff -u pear/Net_Server/Server/Driver/Sequential.php:1.1
pear/Net_Server/Server/Driver/Sequential.php:1.2
--- pear/Net_Server/Server/Driver/Sequential.php:1.1 Fri Jan 2 11:04:24 2004
+++ pear/Net_Server/Server/Driver/Sequential.php Fri Jan 2 11:26:16 2004
@@ -16,7 +16,7 @@
// | Authors: Stephan Schmidt <schst@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Sequential.php,v 1.1 2004/01/02 16:04:24 schst Exp $
+// $Id: Sequential.php,v 1.2 2004/01/02 16:26:16 schst Exp $
/**
* needs the driver base class
@@ -42,7 +42,6 @@
* - onReceiveData
* - onShutdown
*
- * @version 0.10 alpha
* @author Stephan Schmidt <schst@php.net>
*/
class Net_Server_Sequential extends Net_Server_Driver