projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix some missing nickname recognition
[brisk.git]
/
web
/
spush
/
brisk-spush.phh
diff --git
a/web/spush/brisk-spush.phh
b/web/spush/brisk-spush.phh
index
0f22baa
..
77b842a
100644
(file)
--- a/
web/spush/brisk-spush.phh
+++ b/
web/spush/brisk-spush.phh
@@
-24,7
+24,9
@@
$DOCUMENT_ROOT="";
$HTTP_HOST="dodo.birds.lan";
$DOCUMENT_ROOT="";
$HTTP_HOST="dodo.birds.lan";
-define('USOCK_PATH', "/tmp/brisk.sock");
+define('USOCK_PATH_PFX', "/tmp/brisk");
+define('USOCK_POOL_N', 10);
+define('SOCK_SHARD_N', 2);
define('PENDINGPAGE_CONTINUE', 0);
define('PENDINGPAGE_WAITDATA', 1);
define('PENDINGPAGE_CONTINUE', 0);
define('PENDINGPAGE_WAITDATA', 1);
@@
-52,7
+54,7
@@
class PendingPage {
function PendingPage($socket, $curtime, $kalive)
{
$this->socket = $socket;
function PendingPage($socket, $curtime, $kalive)
{
$this->socket = $socket;
- fprintf(STDERR, "SOCKET ADD: %s\n", $this->socket);
+
//
fprintf(STDERR, "SOCKET ADD: %s\n", $this->socket);
$this->kalive = $curtime + $kalive;
}
$this->kalive = $curtime + $kalive;
}
@@
-81,7
+83,7
@@
class PendingPage {
function to_continuing()
{
function to_continuing()
{
- printf("TRY FLUSH CREATE\n");
+
//
printf("TRY FLUSH CREATE\n");
$header = array();
$header['HTTP-Response'] = "100 Continue";
$hea = headers_render($header, 0);
$header = array();
$header['HTTP-Response'] = "100 Continue";
$hea = headers_render($header, 0);
@@
-136,7
+138,7
@@
class PendingPage {
function to_flushing($enc, &$header_out, $body)
{
function to_flushing($enc, &$header_out, $body)
{
- printf("TRY FLUSH CREATE: enc[%s]\n", $enc);
+
//
printf("TRY FLUSH CREATE: enc[%s]\n", $enc);
$body_out = ZLibStream::compress($enc, $body);
if ($enc != 'plain')
$header_out['Content-Encoding'] = $enc;
$body_out = ZLibStream::compress($enc, $body);
if ($enc != 'plain')
$header_out['Content-Encoding'] = $enc;
@@
-147,26
+149,26
@@
class PendingPage {
$this->status = PENDINGPAGE_FLUSH;
$this->msg = $hea.$body_out;
$this->msg_sz = $hea_sz + $body_out_sz;
$this->status = PENDINGPAGE_FLUSH;
$this->msg = $hea.$body_out;
$this->msg_sz = $hea_sz + $body_out_sz;
- printf("TRY FLUSH CREATE: enc[%s]\n", $enc);
+
//
printf("TRY FLUSH CREATE: enc[%s]\n", $enc);
}
/* return TRUE if is removable from it's list */
function try_flush($curtime)
{
}
/* return TRUE if is removable from it's list */
function try_flush($curtime)
{
- fprintf(STDERR, "IMPORTANT: TRY_FLUSH: start %d\n", $this->status);
+
//
fprintf(STDERR, "IMPORTANT: TRY_FLUSH: start %d\n", $this->status);
if ($this->status != PENDINGPAGE_FLUSH &&
$this->status != PENDINGPAGE_CONTINUE)
return (FALSE);
if ($this->kalive < $curtime) {
if ($this->status != PENDINGPAGE_FLUSH &&
$this->status != PENDINGPAGE_CONTINUE)
return (FALSE);
if ($this->kalive < $curtime) {
- printf("TRY FLUSH CLOSE 1\n");
+
//
printf("TRY FLUSH CLOSE 1\n");
@fclose($this->socket);
return TRUE;
}
$wret = @fwrite($this->socket, $this->msg, mb_strlen($this->msg, "ASCII"));
if ($wret == FALSE && $wret !== FALSE) {
@fclose($this->socket);
return TRUE;
}
$wret = @fwrite($this->socket, $this->msg, mb_strlen($this->msg, "ASCII"));
if ($wret == FALSE && $wret !== FALSE) {
- printf("TRY FLUSH PendingPage::try_flush: wret 0 but not FALSE [%d]\n", mb_strlen($this->msg, "ASCII"));
+
//
printf("TRY FLUSH PendingPage::try_flush: wret 0 but not FALSE [%d]\n", mb_strlen($this->msg, "ASCII"));
}
if ($wret == $this->msg_sz) {
if ($this->status == PENDINGPAGE_CONTINUE) {
}
if ($wret == $this->msg_sz) {
if ($this->status == PENDINGPAGE_CONTINUE) {
@@
-174,7
+176,7
@@
class PendingPage {
return FALSE;
}
else {
return FALSE;
}
else {
- printf("TRY FLUSH CLOSE 2\n");
+
//
printf("TRY FLUSH CLOSE 2\n");
fclose($this->socket);
return TRUE;
}
fclose($this->socket);
return TRUE;
}
@@
-182,7
+184,7
@@
class PendingPage {
$this->msg_sz -= $wret;
$this->msg = mb_substr($this->msg, $wret, $this->msg_sz, "ASCII");
$this->msg_sz -= $wret;
$this->msg = mb_substr($this->msg, $wret, $this->msg_sz, "ASCII");
- printf("TRY FLUSH RETURN FALSE\n");
+
//
printf("TRY FLUSH RETURN FALSE\n");
return FALSE;
}
return FALSE;
}