mirror of
https://github.com/kevachat/npsapp.git
synced 2025-01-28 07:44:16 +00:00
implement connection request iterator
This commit is contained in:
parent
6fb3045d62
commit
3ce5759389
@ -98,7 +98,7 @@
|
||||
"debug":
|
||||
{
|
||||
"enabled":true,
|
||||
"template":"[{time}] [message] {host}#{crid} captcha: {code} size: {size} bytes \n\r{sent}."
|
||||
"template":"[{time}] [message] {host}#{crid} captcha: {code} line: {iter} size: {size} bytes\n\r{sent}"
|
||||
}
|
||||
},
|
||||
"close":
|
||||
|
@ -104,6 +104,9 @@ class Ratchet implements MessageComponentInterface
|
||||
// Init connection confirmed
|
||||
$connection->confirmed = false;
|
||||
|
||||
// Init connection counter
|
||||
$connection->count = 0;
|
||||
|
||||
// Debug open event on enabled
|
||||
if ($config->event->open->debug->enabled)
|
||||
{
|
||||
@ -132,6 +135,14 @@ class Ratchet implements MessageComponentInterface
|
||||
\Ratchet\ConnectionInterface $connection,
|
||||
$request
|
||||
) {
|
||||
// Filter request
|
||||
$request = trim(
|
||||
$request
|
||||
);
|
||||
|
||||
// Increase connection counter
|
||||
$connection->count++;
|
||||
|
||||
// Init config namespace
|
||||
$config = $this->_config->nps->event->message;
|
||||
|
||||
@ -192,6 +203,7 @@ class Ratchet implements MessageComponentInterface
|
||||
'{host}',
|
||||
'{crid}',
|
||||
'{code}',
|
||||
'{iter}',
|
||||
'{sent}',
|
||||
'{size}'
|
||||
],
|
||||
@ -200,6 +212,7 @@ class Ratchet implements MessageComponentInterface
|
||||
(string) $connection->remoteAddress,
|
||||
(string) $connection->resourceId,
|
||||
(string) $connection->captcha,
|
||||
(string) $connection->count,
|
||||
(string) str_replace('%', '%%', $request),
|
||||
(string) mb_strlen($request)
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user