Commit Graph

494 Commits

Author SHA1 Message Date
Daniel Lowrey
5223a36b25 Fix polling for STDIO and crypto socket handles 2015-02-03 01:15:30 -05:00
Bob Weinand
25fa65eebe Make ext/sockets optional 2015-01-23 22:56:57 +01:00
Daniel Lowrey
544b69442c Fix broken uv_fs_read() functionality 2015-01-22 16:06:22 -05:00
Bob Weinand
7bc813596d Fixed missing refcount increment 2015-01-21 17:04:49 +01:00
Bob Weinand
f5b1e9d14e Fix accidental regression in checking for invalid resource 2015-01-21 16:16:26 +01:00
Bob Weinand
74096ae99c Fix buffer overflow 2015-01-18 18:51:49 +01:00
Bob Weinand
4751e80a65 Fix various bugs... 2015-01-18 17:24:13 +01:00
Bob Weinand
4332fe7aa1 Current, broken PHP 7 port... 2015-01-18 02:58:40 +01:00
Steve Rhoades
605a20a568 merging offset changes from PR #60 2014-11-23 18:02:03 +00:00
Steve Rhoades
42361ad0c5 fix segfault issue caused by uv_unref deleting resource, resource is freed by destruct_uv 2014-11-17 16:48:57 +00:00
Steve Rhoades
2408f16a7a Fix issue #36, Fix issue #56, uv_poll no longer allows plainfiles or php related streams resolving a SIGABRT as epoll doesn't support those stream types 2014-11-14 02:01:07 +00:00
Steve Rhoades
dd9aac9abb Fix Issue #59 segfault on null passed as handle to uv_stdio_new 2014-11-13 02:20:21 +00:00
Steve Rhoades
73a295abc9 cleanup uv_fs_scandir 2014-11-12 15:52:08 +00:00
Steve Rhoades
459b61462a fix uv_fs_scandir 2014-11-12 15:49:12 +00:00
Daniel Lowrey
a25595f43a Add $offset param to uv_fs_read() to allow seeking on open handles
This change modifies the uv_fs_read() function signature slightly by adding
a new $offset parameter. This allows the same file handle to be reused for
multiple reads. Previously the only way to access a section of a file that
had already been read was to open a new handle.

Old:
uv_fs_read(resoruce $loop, zval $fd, long $length, callable $callback)

New:
uv_fs_read(resoruce $loop, zval $fd, long $offest, long $length, callable $callback)

This change represents a minor BC break for existing code using uv_fs_read().
2014-11-11 10:47:44 -05:00
Steve Rhoades
59f74ea017 fix issue with uv_loop_new based on 1.0 migration guide, add additional tests 2014-11-10 04:30:57 +00:00
Steve Rhoades
1ea6c5aca4 update for libuv 1.0.0rc2, updated tests for api changes 2014-11-07 21:42:17 +00:00
Steve Rhoades
84d7e09ce6 saving changes, still 3 failing tests 2014-11-07 18:40:12 +00:00
Tjerk Meesters
bdaf5a0bb8 Enabled http parser again 2014-08-21 08:31:25 +08:00
Tjerk Meesters
39a7fe3c7e Fixed off-by-one buffer issue in uv_exepath() 2014-08-20 22:10:40 +08:00
Tjerk Meesters
91ee8f491a Fixed off-by-one overflow, updated test case 2014-08-20 22:10:40 +08:00
Tjerk Meesters
90f12cb77f Moving parser functionality in a separate file (part 1) 2014-08-20 18:44:55 +08:00
Daniel Lowrey
cf36261e3e Fix accidental chmod changes 2014-06-11 19:09:32 -04:00
Daniel Lowrey
79853fb161 Don't crash if work queue function fatals in thread 2014-06-10 10:58:34 -04:00
Daniel Lowrey
1fbd585948 Fix copy/paste error message typo 2014-06-10 10:58:34 -04:00
Daniel Lowrey
1e32c24608 Add signal handling support
- resource uv_signal_init([resource $loop])
- void uv_signal_start(resource $sigHandle, callable $onSignal, int $signal)
- void uv_signal_stop($signalResource)

Example:

    <?php
    $sigHandle = uv_signal_init();
    $onSigint = function($sigHandle, $sigNum) {
        printf("Caught signal: %d\n", $sigNum);
        uv_signal_stop($sigHandle);
        uv_stop();
    };
    uv_signal_start($sigHandle, $onSigint, UV::SIGINT);
    uv_run();

New signal constants (these vary by OS):

    <?php
    $refl = new ReflectionClass('UV');
    print_r($refl->getConstants());
2014-06-10 10:56:32 -04:00
Daniel Lowrey
096eedc215 Add uv_stop() 2014-06-10 09:11:38 -04:00
Shuhei Tanuma
2b04d12970 [http parser] add http version 2014-02-27 16:48:53 +09:00
Shuhei Tanuma
951622a3aa improve http parser:
* support multiple line header field and value.
* support http upgrade mechanism (you have to parse websocket protocol manually)
2014-02-25 17:17:34 +09:00
Shuhei Tanuma
fe317d62c0 add upgrade key 2014-02-25 16:13:00 +09:00
Shuhei Tanuma
edf8f7fab1 add note 2014-01-04 18:36:14 +09:00
Shuhei Tanuma
7d210d8033 check thread feature 2014-01-04 02:37:26 +09:00
Shuhei Tanuma
5fea385ded remove inline flag 2014-01-03 16:27:08 +09:00
Shuhei Tanuma
6f4331d0f5 improve several things 2014-01-03 15:37:18 +09:00
brettlangdon
a7e9031c60 uv_run now needs a mode, use UV_RUN_DEFAULT 2014-01-02 18:22:12 -05:00
Shuhei Tanuma
389bb44c2f initialize finished flag for 5.2 env 2013-09-09 16:19:09 +09:00
Shuhei Tanuma
9ab5074c77 add 5.2 support 2013-09-09 15:59:20 +09:00
Shuhei Tanuma
49f1f7d469 fix typo 2013-04-13 23:37:55 +09:00
Shuhei Tanuma
5d58144648 uv_http_parser_execute: fix #46 change function behavior.
result variable was set every function call.
2013-04-13 23:37:26 +09:00
Shuhei Tanuma
baed1c4758 fix segmentation fault when using uv_udp_recv_start #43 2013-03-18 22:19:36 +09:00
Shuhei Tanuma
aa399f2487 switch libuv version to stable version. #40 2013-02-28 21:52:43 +09:00
Andrey Kalinovsky
2081b0d459 Landing pull request #39. fix uv_run_once + added a return value.
More Details:
 - https://github.com/chobie/php-uv/pull/39
2013-02-27 02:01:37 +09:00
Shuhei Tanuma
0a7cb9757c fix #34. forget to initialize zval 2013-02-27 00:22:35 +09:00
Shuhei Tanuma
d600abc223 Merge pull request #35 from csaoh/fix_constants
Fix segfault in fs_stat
2013-02-13 01:13:48 -08:00
Andrey Kalinovsky
05bef15202 Fix codestyle 2013-02-13 10:11:16 +01:00
Andrey
57baf614f8 Fix segfault in fs_stat 2013-02-13 09:58:27 +01:00
Shuhei Tanuma
90c9db6905 update latest libuv and http-parser
Notes: ares functions are removed as uv removed that features. please use before commit
if you want to use ares features. currently, php ares extension seems not maintained.
please ask me when you met some troubles about ares feature.
2013-02-11 22:09:29 +09:00
Shuhei Tanuma
42bfa52b1a Merge pull request #26 from weltling/master
Windows fixes
2013-02-11 03:55:32 -08:00
Andrey
87a5b5d831 Fixed indentation 2013-02-07 16:15:41 +01:00
Andrey
97b329c164 Added a length parameter to read 2013-02-07 16:12:23 +01:00
Anatoliy Belsky
eaa75735e2 fixed NTS build, plus
- extended config.w32 to look for libs/includes in extra dirs
- fixed config.w32 to care about the sockets ext
- --enable-uv-httpparser is a better wording
- since non bundled library can be used, wording fixed in minfo
2012-11-18 21:56:26 +01:00
Shuhei Tanuma
b77f34833f common: fix BAD ADDRESS for callback 2012-08-09 12:20:55 +09:00
Shuhei Tanuma
800897c03c common: fix memory leak regarding handling callback zval 2012-08-05 21:42:06 +09:00
Shuhei Tanuma
6e3eb88f7c common: uv_write check resource type 2012-07-30 00:56:41 +09:00
Shuhei Tanuma
9f6fdbce52 common: uv_close check uv resource type 2012-07-30 00:53:57 +09:00
Shuhei Tanuma
7b03433f2d common: uv_read_Stop checks resource type 2012-07-30 00:46:07 +09:00
Shuhei Tanuma
7b2f075a12 common: uv_read_start checks resource type. 2012-07-30 00:45:21 +09:00
Shuhei Tanuma
17b1436023 unix: add type check for uv_shutdown 2012-07-30 00:40:55 +09:00
Shuhei Tanuma
89a46643ca fix compiler error 2012-07-28 02:02:41 +09:00
Shuhei Tanuma
69aeb9f89f listen: check uv resource types. 2012-07-28 02:02:27 +09:00
Shuhei Tanuma
1c0ed4c82c poll: checks uv resource type 2012-07-28 01:59:01 +09:00
Shuhei Tanuma
07122e463e httpparser: use uppercase keys 2012-07-26 12:36:25 +09:00
Shuhei Tanuma
0c6d859032 common: zval_to_fd macro should be return FALSE 2012-07-24 12:24:48 +09:00
Shuhei Tanuma
be03147188 stdio: fix unmatch cast 2012-07-24 12:15:55 +09:00
Shuhei Tanuma
03fa36a873 spawn: remove unused variable 2012-07-24 12:13:03 +09:00
Shuhei Tanuma
8b0269a3cb httpparser: fix it 2012-07-24 01:47:02 +09:00
Shuhei Tanuma
c591f130c6 httpparser: try to fix inconsistent hash 2012-07-24 01:45:13 +09:00
Shuhei Tanuma
f39db39e8e httpparser: fix inconsistent hash 2012-07-24 01:21:50 +09:00
Shuhei Tanuma
74a64409dc spawn: fix segv 2012-07-24 01:00:37 +09:00
Shuhei Tanuma
03e577c827 httpparser: result variable only update when parser finished. 2012-07-24 00:53:38 +09:00
Shuhei Tanuma
1dd205fe12 fs_poll: check resource type 2012-07-24 00:21:47 +09:00
Shuhei Tanuma
8569abc1f8 process: add type check for uv_process_kill 2012-07-24 00:15:56 +09:00
Shuhei Tanuma
c134d2fba2 tcp: check types 2012-07-24 00:12:56 +09:00
Shuhei Tanuma
7ac60188e9 tty: add type check 2012-07-23 23:13:10 +09:00
Shuhei Tanuma
5a941edd4a tty: don't raise E_ERROR 2012-07-23 23:08:12 +09:00
Shuhei Tanuma
9a55c5e270 spawn: fix memory leak when using file descriptor 2012-07-23 22:16:05 +09:00
Shuhei Tanuma
eac00b68fb spawn: opitons accepts uid and gid 2012-07-23 22:12:59 +09:00
Shuhei Tanuma
be24fe6155 docs: add uv_stdio_new function 2012-07-23 00:08:05 +09:00
Shuhei Tanuma
0a2b0751c1 spawn: change function signature. add uv_stdio_new function 2012-07-22 21:54:19 +09:00
Shuhei Tanuma
9a9de96cee docs: don't put docs into source code. too long 2012-07-22 14:06:52 +09:00
Shuhei Tanuma
c26419f3da uv_fs: don't raise E_ERROR 2012-07-22 13:38:29 +09:00
Shuhei Tanuma
f4d67706ad uv_fs: use common function 2012-07-22 13:36:32 +09:00
Shuhei Tanuma
be965f991f fixed compiler warnings 2012-07-21 21:10:15 +09:00
Shuhei Tanuma
cb40015ffd for now, move declarations 2012-07-21 20:54:45 +09:00
Shuhei Tanuma
4cb0b36775 don't use false 2012-07-21 20:51:22 +09:00
Shuhei Tanuma
4679654de7 uv_lock functions: use common function 2012-07-21 20:49:10 +09:00
Shuhei Tanuma
fb60200518 uv_async: add type check 2012-07-21 15:56:33 +09:00
Shuhei Tanuma
0ad997171b uv_udp: check resource type 2012-07-21 15:53:44 +09:00
Shuhei Tanuma
2fd3b35a29 uv_pipe: add type check 2012-07-21 13:22:59 +09:00
Shuhei Tanuma
201787a723 uv_prepare: check types 2012-07-21 09:26:21 +09:00
Shuhei Tanuma
42672626e5 uv_check: add type check 2012-07-21 08:58:14 +09:00
Shuhei Tanuma
bbee29313c uv_idle: add type check 2012-07-21 08:38:18 +09:00
Shuhei Tanuma
e101808e81 uv_timer: add type check and prevent freeze 2012-07-21 00:53:08 +09:00
Shuhei Tanuma
395806f1ea uv_timer_start: check timeout and repeat value 2012-07-21 00:32:35 +09:00
Shuhei Tanuma
5e4071ecf7 for now, use macro for initialize uv_timer_init resource 2012-07-21 00:12:24 +09:00
Shuhei Tanuma
5275104bcf uv_tcp_connect: add type check 2012-07-21 00:01:30 +09:00
Shuhei Tanuma
543a05c678 add comment [ci skip] 2012-07-20 23:46:44 +09:00
Shuhei Tanuma
3b3968292d refactor lock resource 2012-07-20 12:55:40 +09:00
Shuhei Tanuma
60db70f26b don't use meanless variable name 2012-07-20 12:34:40 +09:00
Shuhei Tanuma
a7bf3ac170 use macro 2012-07-20 12:32:51 +09:00
Shuhei Tanuma
02da1858bc don't access addr->is_ipv4 directly 2012-07-20 00:57:08 +09:00
Shuhei Tanuma
6344c4c07f don't access php_uv_sockaddr_t's sockaddr_in directly 2012-07-20 00:52:36 +09:00
Shuhei Tanuma
f6c7e40d20 uv_ip4_addr, uv_ip6_addr: add emalloc check 2012-07-20 00:42:44 +09:00
Shuhei Tanuma
7a37f8f3c1 uv_streror: type check and refactor 2012-07-20 00:24:17 +09:00
Shuhei Tanuma
693a8782c1 uv_tcp_bind, uv_udp_bind: check resource type 2012-07-20 00:09:33 +09:00
Shuhei Tanuma
4de840259b uv_strerror, uv_err_name: check error code 2012-07-19 23:37:55 +09:00
Shuhei Tanuma
f46f910141 do need to use ZEND_FETCH_RESOURCE_NORETURN macro here 2012-07-19 23:14:00 +09:00
Shuhei Tanuma
ee4e70610c use fetch loop macro 2012-07-19 23:11:58 +09:00
Shuhei Tanuma
ed379f738f check loop resource type 2012-07-19 23:09:34 +09:00
Shuhei Tanuma
2015dd41d6 add docs [ci skip] 2012-07-18 22:05:20 +09:00
Shuhei Tanuma
52b91e2b44 uv_ref and uv_unref supports uv_loop resource 2012-07-17 21:58:52 +09:00
Shuhei Tanuma
f3705a06a0 update docs [ci skip] 2012-07-17 21:48:35 +09:00
Shuhei Tanuma
6d3af6ba5a update readm [ci skip] 2012-07-17 12:42:03 +09:00
Shuhei Tanuma
ef600350e1 remove unused variable 2012-07-17 12:41:34 +09:00
Shuhei Tanuma
49ffc90d8d update docs [ci skip] 2012-07-17 00:52:06 +09:00
Shuhei Tanuma
dfef38cc69 update readme [ci skip] 2012-07-16 10:31:38 +09:00
Shuhei Tanuma
f3c315f917 add util function: uv_handle_type 2012-07-16 02:50:38 +09:00
Shuhei Tanuma
c919487ebe add uv_guess_handle 2012-07-16 02:06:05 +09:00
Shuhei Tanuma
ccd0c57305 update docs [ci skip] 2012-07-16 01:34:41 +09:00
Shuhei Tanuma
35d57e6b35 fixing markdown [ci skip] 2012-07-16 01:25:49 +09:00
Shuhei Tanuma
d458cd5905 add several function docs [ci skip] 2012-07-16 01:22:05 +09:00
Shuhei Tanuma
af6e179128 add uv_poll docs [ci skip] 2012-07-16 00:51:05 +09:00
Shuhei Tanuma
ed895be80c add uv_poll_init_socket 2012-07-16 00:32:29 +09:00
Shuhei Tanuma
01ba787a36 do not free here 2012-07-16 00:09:29 +09:00
Shuhei Tanuma
61a05cbc96 uv_fs*: callback parameter fd passes given PHPs stream, socket or file descriptor. 2012-07-15 23:47:49 +09:00
Shuhei Tanuma
157f6ca7e2 adjust fs_poll sample 2012-07-15 22:54:56 +09:00
Shuhei Tanuma
ff5f4023f4 add note for uv_read_start 2012-07-15 21:32:16 +09:00
Shuhei Tanuma
2454e91bda add http parser document. and fix constnats [ci skip] 2012-07-15 20:45:34 +09:00
Shuhei Tanuma
091eef8a6b update readme [ci skip] 2012-07-15 20:27:53 +09:00
Shuhei Tanuma
04c2fdb745 fix write2 proto docs [ci skip] 2012-07-15 20:21:11 +09:00
Shuhei Tanuma
933a05f0f5 update readme [ci skip] 2012-07-15 20:16:15 +09:00
Shuhei Tanuma
706ef03e74 change idle cb parameters 2012-07-15 20:10:07 +09:00
Shuhei Tanuma
b0d8e785b6 add several docs [ci skip] 2012-07-15 19:12:25 +09:00
Shuhei Tanuma
b927f15019 hmm... for now, add descriptions and parameters into source code. [ci skip] 2012-07-15 19:01:23 +09:00
Shuhei Tanuma
ddc4d3017d TODO: fix uv_spawn 2012-07-15 17:57:45 +09:00
Shuhei Tanuma
58feabb350 add uv_loop_new 2012-07-15 17:51:06 +09:00
Shuhei Tanuma
9c28657090 i don't have good solution for including php_sockets.h on windows box. for now comment out 2012-07-15 14:03:22 +09:00
Shuhei Tanuma
141de07e0e now, uv_fs functions accepts php's stream, socket and fd 2012-07-15 03:56:29 +09:00
Shuhei Tanuma
f5bf49b415 for now, add uv_walk function. but it does not work yet. 2012-07-15 01:40:34 +09:00
Shuhei Tanuma
0e8eb9fcbb for now, add uv_write2 2012-07-14 23:24:56 +09:00
Shuhei Tanuma
fb3f2e5930 Merge branch 'feature/dtrace-support' 2012-07-14 22:57:56 +09:00
Shuhei Tanuma
20ab459846 adjust dtrace support 2012-07-14 22:57:18 +09:00
Shuhei Tanuma
96c64de3da remove unused include line 2012-07-13 13:18:03 +09:00
Shuhei Tanuma
232ed1f90d dtrace just work on OSX box. Yay 2012-07-13 12:59:15 +09:00
Shuhei Tanuma
bd2d6ce7fe use common function for tcp_connect 2012-07-13 00:19:11 +09:00
Shuhei Tanuma
fcb6d907aa set no_separation = 1 2012-07-12 23:52:21 +09:00
Shuhei Tanuma
48dfbd42f6 for now, add files 2012-07-12 23:37:47 +09:00
Shuhei Tanuma
bfd6342971 clear old callback 2012-07-12 10:28:17 +09:00
Shuhei Tanuma
f2b56c8b76 remove unused zval 2012-07-12 10:27:08 +09:00
Shuhei Tanuma
985c304ad2 fix uv_read_start segv 2012-07-12 10:20:31 +09:00