-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from rryqszq4/development
[pr] Add redis test and bug fix.
- Loading branch information
Showing
65 changed files
with
153 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,9 +47,9 @@ Installation | |
### Compile install | ||
|
||
```sh | ||
$ wget 'http://php.net/distributions/php-7.2.14.tar.gz' | ||
$ tar xf php-7.2.14.tar.gz | ||
$ cd php-7.2.14 | ||
$ wget 'http://php.net/distributions/php-7.3.10.tar.gz' | ||
$ tar xf php-7.3.10.tar.gz | ||
$ cd php-7.3.10 | ||
|
||
$ ./configure --prefix=/path/to/php --enable-embed | ||
$ make && make install | ||
|
@@ -160,7 +160,7 @@ http { | |
location = /ngx_socket2 { | ||
default_type 'application/json;charset=UTF-8'; | ||
content_by_php { | ||
content_by_php_block { | ||
$fd = ngx_socket_create(); | ||
yield ngx_socket_connect($fd, "hq.sinajs.cn", 80); | ||
|
@@ -265,6 +265,8 @@ Directives | |
* [body_filter_by_php_block](#body_filter_by_php_block) | ||
* [php_keepalive](#php_keepalive) | ||
* [php_set](#php_set) | ||
* [php_socket_keepalive](#php_socket_keepalive) | ||
* [php_socket_buffer_size](#php_socket_buffer_size) | ||
|
||
php_ini_path | ||
------------ | ||
|
@@ -420,6 +422,22 @@ php_set | |
|
||
Installs a php handler for the specified variable. | ||
|
||
php_socket_keepalive | ||
-------------------- | ||
**syntax:** `php_socket_keepalive`_`<size>`_ | ||
|
||
**default:** `0` | ||
|
||
**context:** `http, server` | ||
|
||
php_socket_buffer_size | ||
---------------------- | ||
**syntax:** `php_socket_buffer_size`_`<size>`_ | ||
|
||
**default:** `4k` | ||
|
||
**context:** `http, server, location, location if` | ||
|
||
Nginx API for php | ||
----------------- | ||
* [ngx_exit](#ngx_exit) | ||
|
@@ -758,6 +776,7 @@ Nginx non-blocking API for php | |
* [yield ngx_socket_close](#ngx_socket_close) | ||
* [yield ngx_socket_send](#ngx_socket_send) | ||
* [yield ngx_socket_recv](#ngx_socket_recv) | ||
* [yield ngx_socket_recvpage](#ngx_socket_recvpage) | ||
* [ngx_socket_recvsync](#ngx_socket_recvsync) | ||
* [ngx_socket_clear](#ngx_socket_clear) | ||
|
||
|
@@ -863,6 +882,17 @@ used to gather data from connected sockets. | |
buf is passed by reference, so it must be specified as a variable in the argument list. | ||
Data read from socket by ngx_socket_recv() will be returned in buf. | ||
|
||
ngx_socket_recvpage | ||
------------------- | ||
**syntax:** `( yield ngx_socket_recvpage(resource $socket, string &$buf, int &$rc) ) : int` | ||
|
||
**parameters:** | ||
- `socket: resource` | ||
- `buf: string` | ||
- `rc: int` | ||
|
||
**context:** `rewrite_by_php*, access_by_php*, content_by_php*` | ||
|
||
ngx_socket_recvsync | ||
------------------- | ||
**syntax:** `ngx_socket_recvsync(resource $socket, string &$buf, int $len) : int` | ||
|
@@ -977,7 +1007,7 @@ NGX_HTTP_INSUFFICIENT_STORAGE | 507 | |
Copyright and License | ||
--------------------- | ||
``` | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
@@ -565,6 +565,15 @@ ngx_http_php_socket_upstream_recv(ngx_http_request_t *r, | |
break; | ||
} | ||
|
||
#if 0 | ||
if (u->enabled_receive_page && rev->active && !rev->ready) { | ||
ngx_php_debug("c->read->active: %d, c->read->ready: %d, c->read->eof: %d, c->read->write: %d, c->read->posted: %d\n", | ||
c->read->active, c->read->ready, c->read->eof, c->read->write, c->read->posted); | ||
Z_LVAL_P(ctx->recv_code) = NGX_AGAIN; | ||
return NGX_AGAIN; | ||
} | ||
#endif | ||
|
||
n = c->recv(c, b->last, size); | ||
//ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "%d", n); | ||
ngx_php_debug("n = c->recv: %d\n", (int)n); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
============================================================================== | ||
Copyright (c) 2016-2019, rryqszq4 <[email protected]> | ||
Copyright (c) 2016-2020, rryqszq4 <[email protected]> | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
|
Oops, something went wrong.