Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
44ee92b
Stream hook
arnaud-lb May 25, 2026
7c3be3b
stream_socket_accept()
arnaud-lb Jun 3, 2026
6f99c6b
Explore fclose() handling
arnaud-lb Jun 3, 2026
05d9e50
Prevent closing stream during hook invokation
arnaud-lb Jun 4, 2026
f5f68bb
Call the hook in php_pollfd_for
arnaud-lb Jun 4, 2026
46212d4
Cleanup
arnaud-lb Jun 5, 2026
da9868a
Prepare API for curl: Watch multiple handlers at once
arnaud-lb Jun 8, 2026
061aa6c
Timeout support and simplify poll() again
arnaud-lb Jun 8, 2026
9ae88c2
curl_exec() support
arnaud-lb Jun 8, 2026
3fc2d6b
Prevent concurrent access to streams
arnaud-lb Jun 24, 2026
dc81751
Context: Add ability to watch weakly
arnaud-lb Jun 26, 2026
c3845ce
Use zend_enum_get_case_by_id
arnaud-lb Jun 30, 2026
ef87bb5
Switch to non-blocking operations interally
arnaud-lb Jun 30, 2026
764bb3c
Update test scheduler to use EdgeTriggered mode
arnaud-lb Jun 30, 2026
d2b7fe6
Rename poll_multi() -> pollMulti()
arnaud-lb Jun 30, 2026
b50d15a
Hooks::sleep()
arnaud-lb Jun 30, 2026
789a484
Internal API
arnaud-lb Jul 3, 2026
6f8e015
Update pollMulti() signature
arnaud-lb Jul 3, 2026
dba9496
Adapt test scheduler to Context::wait() taking Time\Duration
bukka Sep 23, 2026
d3c11f7
Borrow php_deadline.h and ZEND_HRTIME_T_MAX from the EINTR PR
bukka Sep 23, 2026
5243d40
Introduce the IO operation model and the C poll queue
bukka Sep 23, 2026
632368c
Port the call sites to php_io_run() and add the userland operation API
bukka Sep 23, 2026
d6e1870
Adapt the hook tests to the operation model
bukka Sep 23, 2026
5325be0
Poll: timers, priority events and disarmed one-shot registrations
bukka Sep 23, 2026
28aa15c
Poll API additions: WeakHandle, TimerHandle, NotifyHandle, Event::Pri…
bukka Sep 23, 2026
79ac5b5
Tests for the Poll API additions and a provider on its own Context
bukka Sep 23, 2026
686a00f
Persistent operations and one registration per descriptor in the poll…
bukka Sep 23, 2026
491c073
curl: sockets as persistent operations with a reconcile step
bukka Sep 23, 2026
d3b263d
Tests for persistent operations and the slow-reader upload
bukka Sep 23, 2026
a863ed2
Poll: restart interrupted waits, NotifyHandle over a foreign descriptor
bukka Sep 23, 2026
91a8930
The Ring: main/ring over ior and the ring queue
bukka Sep 23, 2026
68bcf70
Io\Ring\Engine
bukka Sep 23, 2026
e7be899
Tests: the scheduler on both queues and the Ring's basics
bukka Sep 23, 2026
dd77055
Data operations: the syscall-first and direct ladders, freeze and orp…
bukka Sep 24, 2026
6eec6d4
Port socket, accept, connect and plain file call sites to data operat…
bukka Sep 24, 2026
2e3e902
Tests for the data operations
bukka Sep 24, 2026
110d658
DNS as operations: GetAddrInfo and GetNameInfo
bukka Sep 24, 2026
bbb42ad
stream_select() and curl_multi_select() on the Any op, DNS operation …
bukka Sep 24, 2026
99ab31d
Tests for DNS operations and the select functions
bukka Sep 24, 2026
65c70f5
Treat negative socket timeouts as no deadline in the op wrappers
bukka Sep 24, 2026
5337edb
Hand the stream_select hooks test a signal instead of a timing margin
bukka Sep 24, 2026
964b7cd
TLS through a stream BIO: Recv and Send operations for the TLS transport
bukka Sep 24, 2026
9a28de6
Follow ior's timeout and build changes
bukka Sep 24, 2026
1d0db62
Processes and signals as operations: WaitPid, SigWait, ProcessHandle,…
bukka Sep 24, 2026
7e98995
Process and signal sources on kqueue, and the fixes found on the way
bukka Sep 24, 2026
4883e65
Give a forked child a fresh core queue
bukka Sep 24, 2026
7bb0f31
CI: fetch and build ior for the IO hooks proof of concept
bukka Sep 24, 2026
d545971
Build and run on Windows, with ior linked from an install prefix
bukka Sep 24, 2026
42b5ec9
Overlapped plain files on Windows, so the ring can complete file ops
bukka Sep 24, 2026
df39def
Reflection test: the standard extension's class list now has the Io c…
bukka Sep 24, 2026
e99b431
Move the hooks and ring sources under main/io, include ior as <ior.h>
bukka Sep 24, 2026
0008cae
Windows build: follow the move of the hooks and ring sources under ma…
bukka Sep 24, 2026
f9d60f1
Give socket descriptors back in blocking mode when the stream lets go
bukka Sep 25, 2026
fbae356
Make the descriptor of socket_export_stream() streams non-blocking
bukka Sep 25, 2026
9cd3945
Let a signal interrupt stream_socket_accept() without a provider
bukka Sep 25, 2026
9594b8d
Let signals interrupt the sleep functions and saturate their durations
bukka Sep 25, 2026
a3982b8
Report timed_out on socket reads only when the timeout expired
bukka Sep 25, 2026
aaf69a4
Let blocking stream_socket_recvfrom() and sendto() wait without a tim…
bukka Sep 25, 2026
efe3d89
Retry a plain file read or write only once after EINTR
bukka Sep 25, 2026
f2ff73c
Reflection test: list the Io\Ring classes in a test of their own
bukka Sep 25, 2026
217d4cb
Reap the popen() child when its stream cannot be created
bukka Sep 25, 2026
f496664
Keep stream_copy_to_stream() on sockets and pipes out of the fd fast …
bukka Sep 25, 2026
6e74c6d
Unit tests: follow php_network_connect_socket() onto the operation queue
bukka Sep 25, 2026
70a6bab
No core queue after the request shutdown, reset the per-request IO state
bukka Sep 25, 2026
5f3b844
Guard IO hooks re-entrancy and validate what a provider completes
bukka Sep 25, 2026
a03af52
Concurrent stream access from internal code, Any members, drain first
bukka Sep 25, 2026
113da60
Non-blocking pipes, sigwait deadline, direct Connect answered Ready
bukka Sep 25, 2026
a1e211b
Windows: set the Winsock code for the errno values the IO wrappers re…
bukka Sep 25, 2026
3e25e4d
Seal Io\Operation, argument checks of the bridge methods
bukka Sep 25, 2026
ac74175
Io\Poll: deliver onWatcherRemoved from the next wait(), not the close…
bukka Sep 25, 2026
7ade33d
Poll: fall back to epoll_wait() when epoll_pwait2() is missing at run…
bukka Sep 25, 2026
92201ec
Io\Poll: report Event::Process and Event::Signal only when there is s…
bukka Sep 25, 2026
c97dc5b
Io\Poll\SignalHandle: keep its mask out of exec'd programs, refuse si…
bukka Sep 25, 2026
00bac39
Hooks: keep the reaped-child registry to the children it belongs to
bukka Sep 25, 2026
fa3495b
pcntl: guard rfork and forkx like fork, saturate the sigtimedwait tim…
bukka Sep 25, 2026
6172fa9
Poll: catch a periodic timer up in one step
bukka Sep 25, 2026
4bcf56a
Poll: no registrations armed with nothing, no silently dropped descri…
bukka Sep 25, 2026
fcef6b9
Io\Poll\ProcessHandle: say that a pid is too large, not that it must …
bukka Sep 25, 2026
46ec9c0
Io\Poll: document when onWatcherRemoved runs and what ProcessHandle r…
bukka Sep 25, 2026
eef7674
Io\Curl\SocketWeakHandle: refuse direct construction and cloning
bukka Sep 25, 2026
9ada50d
curl: keep libcurl's timer as a deadline and honour CURLOPT_MAXCONNECTS
bukka Sep 25, 2026
7eb59e2
curl: refuse to use a CurlHandle while curl_exec() on it is suspended
bukka Sep 25, 2026
6d356e9
curl: invalidate SocketWeakHandles still in the table when it is freed
bukka Sep 25, 2026
edc809b
curl: collect curl_multi_select() descriptors with curl_multi_waitfds()
bukka Sep 25, 2026
b4d6b9b
xp_ssl: drop an empty #ifdef PHP_WIN32 block in php_openssl_sockop_cl…
bukka Sep 25, 2026
588cfcf
xp_ssl: keep the TLS state consistent after cancelled and orphaned tr…
bukka Sep 25, 2026
38cbc62
Windows: wait for LockFileEx() on overlapped handles
bukka Sep 25, 2026
e54328d
Windows: open only binary disk files overlapped
bukka Sep 25, 2026
8a03549
CI: build a pinned ior commit, cached per runner image
bukka Sep 25, 2026
ad95787
Build: take --with-ior=DIR into account on both build systems
bukka Sep 25, 2026
f8f2bef
Ring: the record owns what the backend reads and writes for an op
bukka Sep 25, 2026
ec3635a
Ring: detach every op on destruction and keep draining through signals
bukka Sep 25, 2026
98f4185
Ring: wait for room instead of failing, and never lose a deadline or …
bukka Sep 25, 2026
a587282
Ring: report every Any member that is ready when the Any folds
bukka Sep 25, 2026
774002f
Declare php_io_waitpid() and php_io_sigwait() only where they are def…
bukka Sep 25, 2026
6396804
curl: use curl_easy_perform() in curl_exec() when no IO provider is a…
bukka Sep 25, 2026
7e222a5
Windows CI: build ior and the IO ring on the default x64 ZTS job
bukka Sep 25, 2026
d48f279
Emulate blocking mode for Sockets sharing a descriptor with a stream
bukka Sep 25, 2026
53368a6
Keep the old network PHPAPI signatures, add *_stream variants
bukka Sep 25, 2026
4d9ce4f
Leave the blocking mode to the process that changed it
bukka Sep 25, 2026
87c4c48
Ring: bounce data op buffers the stream does not own
bukka Sep 25, 2026
21e21d4
Ring: refuse an inherited ring in a forked child and close its descri…
bukka Sep 25, 2026
9e63288
Io\Poll\SignalHandle: refuse it under ZTS, keep the execution timeout…
bukka Sep 25, 2026
28d8dd7
IO hooks: no fiber switch while the provider's registration hooks run
bukka Sep 25, 2026
1b29f67
IO hooks: a wait woken by a signal PHP has a handler for returns early
bukka Sep 25, 2026
4da1f58
Streams: refuse to free a stream an op is suspended on
bukka Sep 25, 2026
0b51a73
IO hooks: stream_select() freezes the streams of its sets while it waits
bukka Sep 25, 2026
271ff39
Keep waiting through signals on the synchronous path, as master does
bukka Sep 25, 2026
b71dcdc
Io\Poll\SignalHandle: allow it in the CLI of thread-safe builds
bukka Sep 25, 2026
0a8c595
Zend tests: skip syslog() in the arginfo/zpp mismatch test
bukka Sep 25, 2026
181c333
Make pipes non-blocking for the IO hooks and give them back blocking
bukka Sep 25, 2026
0715b2b
Create the hooks ring with IOR_SETUP_FD_NONBLOCK
bukka Sep 25, 2026
a95941c
xp_ssl: Recv straight into OpenSSL's read buffer under a provider
bukka Sep 25, 2026
59f31ce
XMLReader: refuse use of a reader while one of its calls is reading
bukka Sep 25, 2026
898db7d
XMLWriter: refuse use of a writer while one of its calls is writing
bukka Sep 25, 2026
bf15ac7
Shorten comments in the IO hooks extension headers
bukka Sep 25, 2026
195dcb2
Shorten struct field comments in the IO hooks extension code
bukka Sep 25, 2026
279803d
Replace the IO hooks logic macros with static functions
bukka Sep 25, 2026
8dc3406
Drop a design document reference from a curl test title
bukka Sep 25, 2026
d430fa3
Replace the socket ladder macros with static functions
bukka Sep 25, 2026
088ae5a
Shorten the IO hooks and poll header comments and wrap long declarations
bukka Sep 25, 2026
f9426ff
Shorten comments in the IO hooks and poll sources
bukka Sep 25, 2026
5bc3bff
Include the IO hooks and ring headers from php_io.h
bukka Sep 25, 2026
fb394eb
Report no hook capabilities from the ring by default
bukka Sep 26, 2026
3627639
Run the Windows ring hooks tests again with Files and Direct
bukka Sep 26, 2026
4874892
Keep a stream error operation stack per fiber
bukka Sep 26, 2026
a0e2503
Find the stream error stack through the current fiber context
bukka Sep 26, 2026
42245a8
Use what the current ior provides in the ring wrapper
bukka Sep 27, 2026
ab26ba4
Build ior d310b66 in CI
bukka Sep 27, 2026
fb9c350
Send staged entries before the ring destroy waits
bukka Sep 27, 2026
1e64711
Add a stream cast for polling that leaves the buffers alone
bukka Sep 28, 2026
b4dd2ff
Replace persistent ops with registrations and split the direct capabi…
bukka Sep 28, 2026
156ef25
Keep the ring's Edge pairs armed with a multishot poll
bukka Sep 28, 2026
5a18dd2
Serve direct accepts on the ring from a multishot accept
bukka Sep 28, 2026
ef25e34
Poll the sets before stream_select() builds an Any
bukka Sep 28, 2026
4118247
Create a stream's handle on demand and keep it on the stream
bukka Sep 28, 2026
2b43a0f
Give ext/sockets its poll handles and make its blocking points operat…
bukka Sep 28, 2026
71641c7
Report Edge registrations and direct accepts as the ring's default
bukka Sep 28, 2026
a8d4e03
Start ext/sockets after ext/standard, whose poll handle interfaces it…
bukka Sep 28, 2026
becfe7b
Keep direct accepts opt-in: a provider that suspends per op takes one…
bukka Sep 28, 2026
b2c1957
Find a registered pair's queue record through the registration
bukka Sep 28, 2026
e43a091
The ring's notification handle cannot be notified, by design
bukka Sep 28, 2026
f86626c
Hand an operation completed at submit back to the submitter
bukka Sep 28, 2026
5ab2a90
Direct accepts back in the ring's default
bukka Sep 28, 2026
fffefee
CI: build ior for the Windows jobs too
bukka Sep 24, 2026
8df45f5
Windows CI: drop the duplicate ior build script
bukka Sep 28, 2026
6456495
Windows: follow the branch's latest changes
bukka Sep 28, 2026
78fc980
Windows CI: the direct capability is DirectData and DirectAccept now
bukka Sep 28, 2026
252b428
xp_ssl: recognise a cancelled transport op on Windows and keep OpenSS…
bukka Sep 28, 2026
dbb08d0
Windows: WaitPid as an operation for proc_close() and ProcessHandle
bukka Sep 28, 2026
1fab6f1
Windows: overlapped files only for Files providers, casts from a sync…
bukka Sep 28, 2026
6da3753
Windows: a cast turns an overlapped stream synchronous, EBADF for the…
bukka Sep 28, 2026
6dfc51e
Windows: overlapped files copy through the descriptor helper, one eve…
bukka Sep 28, 2026
bde2a55
Take a reaped child's process group while it is alive
bukka Sep 29, 2026
f950d6d
Hooks tests: report a refused add() once, libcurl may report a socket…
bukka Sep 29, 2026
4f768f0
Skip the SigWait requeue test where pcntl has no sigwaitinfo()
bukka Sep 29, 2026
d9f93e6
socket_connect() maps a provider timeout like the emulated wait, TLS …
bukka Sep 29, 2026
4d5cb1d
Merge remote-tracking branch 'upstream/master' into io_hooks_poc
bukka Sep 29, 2026
5e13f55
Follow master's removal of zend_atomic: atomic_load() on vm_interrupt
bukka Sep 29, 2026
0ef0e5a
static_assert() where master dropped ZEND_STATIC_ASSERT
bukka Sep 29, 2026
48a3172
CI: the poll queue's record freed under fire, sigtimedwait detected b…
bukka Sep 29, 2026
b3fb080
CI: a cancel's cqe after its target went, the kqueue kick in two step…
bukka Sep 29, 2026
eb9265c
Merge remote-tracking branch 'upstream/master' into io_hooks_poc
bukka Sep 29, 2026
31f8eca
Address feedback about ZEND_THIS, named_struct and more
bukka Sep 29, 2026
056d9f8
Remove the guards that will never fail
bukka Sep 29, 2026
2154a88
Block the signals of a SignalHandle while a context watches it
bukka Sep 30, 2026
b851dfd
Observe a child's exit without collecting it
bukka Sep 30, 2026
69595a5
Merge remote-tracking branch 'upstream/master' into io_hooks_poc
bukka Sep 30, 2026
8a6cf8f
Fix the output order race in process-ops-context.phpt
bukka Sep 30, 2026
f258640
Keep the bytes of a cancelled or orphaned ring read
bukka Sep 30, 2026
d620a52
Keep the bytes of a read cancelled after its completion
bukka Sep 30, 2026
0ee980f
Fix IO hooks issues found in review
bukka Sep 30, 2026
b05a2fd
Refuse closing a MySQL connection another fiber is suspended in
bukka Sep 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/apt-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ runs:
language-pack-de \
libgmp-dev \
libicu-dev \
liburing-dev \
cmake \
libtidy-dev \
libenchant-2-dev \
libbz2-dev \
Expand Down
64 changes: 64 additions & 0 deletions .github/actions/build-ior-windows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build ior (Windows)
# Temporary, for the IO hooks proof of concept only, like build-ior: builds a
# pinned commit of ior into a cached prefix laid out as win32/build/config.w32
# expects (include\ior\ior.h, lib\ior.lib) and exports it as IOR_PREFIX, which
# build_task.bat passes as --with-ior. The CI builds of PHP are release builds
# (/MD), so ior is built Release against the same DLL runtime.
inputs:
ref:
description: The ior commit to build, a full SHA
default: 2fb12e8ce012b8753258034de008266152742c13
required: false
arch:
description: x64 or x86
required: true
runs:
using: composite
steps:
- name: ior cache key
id: key
shell: pwsh
env:
IOR_REF: ${{ inputs.ref }}
IOR_ARCH: ${{ inputs.arch }}
run: |
"key=ior-$env:RUNNER_OS-$env:ImageOS-$env:PHP_BUILD_CRT-$env:IOR_ARCH-$env:IOR_REF" >> $env:GITHUB_OUTPUT
- name: Restore ior
id: cache
uses: actions/cache@v5
with:
path: C:\ior
key: ${{ steps.key.outputs.key }}
- name: Build ior
if: steps.cache.outputs.cache-hit != 'true'
shell: pwsh
env:
IOR_REF: ${{ inputs.ref }}
IOR_ARCH: ${{ inputs.arch }}
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
Set-PSDebug -Trace 1
$prefix = 'C:\ior'
$src = Join-Path $env:RUNNER_TEMP 'ior-src'
foreach ($dir in @($src, $prefix)) {
if (Test-Path $dir) { Remove-Item -Recurse -Force $dir }
}
git init -q $src
git -C $src fetch --depth 1 https://github.com/libior/ior.git $env:IOR_REF
git -C $src checkout -q FETCH_HEAD
$platform = if ($env:IOR_ARCH -eq 'x86') { 'Win32' } else { 'x64' }
# Static library, IOCP backend; tests and bench would need cmocka
cmake -S $src -B "$src\build" -A $platform `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL `
-DIOR_BUILD_TESTS=OFF `
-DIOR_BUILD_BENCH=OFF
cmake --build "$src\build" --config Release --parallel
cmake --install "$src\build" --config Release --prefix $prefix
- name: Export the ior prefix
shell: pwsh
run: |
if (-not (Test-Path 'C:\ior\include\ior\ior.h') -or -not (Test-Path 'C:\ior\lib\ior.lib')) {
throw 'ior install prefix is incomplete'
}
"IOR_PREFIX=C:\ior" >> $env:GITHUB_ENV
54 changes: 54 additions & 0 deletions .github/actions/build-ior/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build ior
# Temporary, for the IO hooks proof of concept only: the ring (main/io/php_io_ring.c)
# is built on the ior library, which will be bundled with php-src once the
# design settles. Until then CI builds a pinned commit of it into a cached
# prefix that ./configure finds through pkg-config (--with-ior).
inputs:
ref:
description: The ior commit to build, a full SHA
default: 2fb12e8ce012b8753258034de008266152742c13
required: false
runs:
using: composite
steps:
- name: ior cache key
id: key
shell: bash
env:
IOR_REF: ${{ inputs.ref }}
run: |
echo "key=ior-${RUNNER_OS}-${RUNNER_ARCH}-${ImageOS:-unknown}-${IOR_REF}" >> "$GITHUB_OUTPUT"
- name: Restore ior
id: cache
uses: actions/cache@v5
with:
path: ~/ior
key: ${{ steps.key.outputs.key }}
- name: Build ior
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
env:
IOR_REF: ${{ inputs.ref }}
run: |
set -x
IOR_PREFIX="$HOME/ior"
IOR_SRC="$RUNNER_TEMP/ior-src"
rm -rf "$IOR_SRC" "$IOR_PREFIX"
git init -q "$IOR_SRC"
git -C "$IOR_SRC" fetch --depth 1 https://github.com/libior/ior.git "$IOR_REF"
git -C "$IOR_SRC" checkout -q FETCH_HEAD
# Both Linux backends in one library, so IOR_BACKEND=threads can
# select the thread pool at run time; a no-op elsewhere
cmake -S "$IOR_SRC" -B "$IOR_SRC/build" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$IOR_PREFIX" \
-DIOR_WITH_THREADS=ON \
-DIOR_BUILD_TESTS=OFF \
-DIOR_BUILD_BENCH=OFF
cmake --build "$IOR_SRC/build" --parallel
cmake --install "$IOR_SRC/build"
- name: Point pkg-config at ior
shell: bash
run: |
IOR_PREFIX="$HOME/ior"
echo "PKG_CONFIG_PATH=$IOR_PREFIX/lib/pkgconfig:$IOR_PREFIX/lib64/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" >> "$GITHUB_ENV"
4 changes: 4 additions & 0 deletions .github/actions/configure-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ inputs:
runs:
using: composite
steps:
# Temporary for the IO hooks proof of concept, see the action
- name: Build ior
uses: ./.github/actions/build-ior
- shell: bash
run: |
set -x
Expand Down Expand Up @@ -53,6 +56,7 @@ runs:
--enable-sockets \
--with-bz2="$BREW_OPT"/bzip2 \
--with-openssl \
--with-ior \
--with-gmp="$BREW_OPT"/gmp \
--with-iconv="$BREW_OPT"/libiconv \
--enable-bcmath \
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/configure-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ inputs:
runs:
using: composite
steps:
# Temporary for the IO hooks proof of concept, see the action
- name: Build ior
uses: ./.github/actions/build-ior
- shell: bash
run: |
set -x
Expand Down Expand Up @@ -78,6 +81,7 @@ runs:
${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-ior \
${{ inputs.skipSlow == 'false' && '--with-pdo-firebird' || '' }} \
${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \
--enable-werror \
Expand Down
2 changes: 1 addition & 1 deletion .github/matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re
$jobs['SOLARIS'] = true;
}
if ($all_jobs || !$no_jobs || $test_windows) {
$matrix = [['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true]];
$matrix = [['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true, 'ior' => true]];
if ($all_variations) {
$matrix[] = ['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true];
$matrix[] = ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false];
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/windows/build_task.bat
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts
if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS%
if "%ASAN%" equ "1" set ADD_CONF=%ADD_CONF% --enable-sanitizer --enable-debug-pack
if "%CLANG_TOOLSET%" equ "1" set ADD_CONF=%ADD_CONF% --with-toolset=clang
if "%IOR_PREFIX%" neq "" set ADD_CONF=%ADD_CONF% --with-ior=%IOR_PREFIX%

rem C4018: comparison: signed/unsigned mismatch
rem C4146: unary minus operator applied to unsigned type
Expand Down
12 changes: 12 additions & 0 deletions .github/scripts/windows/test_task.bat
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ nmake test TESTS="%OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK %ASAN_OPTS% --no-progre

set EXIT_CODE=%errorlevel%

rem The IO hooks tests again, on the ring built on ior
if "%IOR_PREFIX%" neq "" (
set IO_HOOKS_QUEUE=ring
nmake test TESTS="-g FAIL,BORK,LEAK,XLEAK --no-progress -q --offline --show-diff --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL% ext\standard\tests\streams\hooks ext\standard\tests\poll ext\openssl\tests\stream_io_hooks.phpt ext\curl\tests"
if errorlevel 1 set EXIT_CODE=3
set IO_HOOKS_CAPS=files,directData,directAccept
nmake test TESTS="-g FAIL,BORK,LEAK,XLEAK --no-progress -q --offline --show-diff --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL% ext\standard\tests\streams\hooks ext\openssl\tests\stream_io_hooks.phpt ext\curl\tests"
if errorlevel 1 set EXIT_CODE=3
set IO_HOOKS_CAPS=
set IO_HOOKS_QUEUE=
)

nmake unregister_comtest
taskkill /f /im snmpd.exe

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,11 @@ jobs:
ref: ${{ fromJson(inputs.branch).ref }}
- name: Setup
uses: ./.github/actions/setup-windows
- name: Build ior
if: ${{ matrix.ior }}
uses: ./.github/actions/build-ior-windows
with:
arch: ${{ matrix.x64 && 'x64' || 'x86' }}
- name: Build
run: .github/scripts/windows/build.bat
- name: Test
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_hrtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ZEND_API extern mach_timebase_info_data_t zend_hrtime_timerlib_info;

#endif

#define ZEND_HRTIME_T_MAX UINT64_MAX
#define ZEND_NANO_IN_SEC UINT64_C(1000000000)

typedef uint64_t zend_hrtime_t;
Expand Down
30 changes: 30 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ AC_CHECK_FUNCS([
setitimer
shutdown
sigprocmask
sigtimedwait
splice
statfs
statvfs
Expand Down Expand Up @@ -620,6 +621,8 @@ AC_FUNC_STRERROR_R

dnl Check for functions inside their belonging headers.
AC_CHECK_HEADER([sys/prctl.h], [AC_CHECK_FUNCS([prctl])])
AC_CHECK_HEADERS([sys/signalfd.h sys/pidfd.h])
AC_CHECK_FUNCS([pidfd_open signalfd pipe2])
AC_CHECK_HEADER([sys/procctl.h], [AC_CHECK_FUNCS([procctl])])

AX_FUNC_WHICH_GETHOSTBYNAME_R
Expand Down Expand Up @@ -751,6 +754,30 @@ AS_VAR_IF([php_cv_have__asm_goto], [yes],
[AC_DEFINE([HAVE_ASM_GOTO], [1],
[Define to 1 if asm goto support is available.])])

dnl Check for the ior library the IO ring is built on.
PHP_ARG_WITH([ior],
[for ior support],
[AS_HELP_STRING([[--with-ior[=DIR]]],
[Build the IO ring on the ior library, found through pkg-config. The
optional DIR is the ior install prefix to take its pkg-config file from])],
[no],
[no])
AS_VAR_IF([PHP_IOR], [no],, [
php_ior_pkg_config_path=$PKG_CONFIG_PATH
AS_VAR_IF([PHP_IOR], [yes],, [
PKG_CONFIG_PATH="$PHP_IOR/lib/pkgconfig:$PHP_IOR/lib64/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
])
PKG_CHECK_MODULES([IOR], [ior])
IOR_LIBS=$($PKG_CONFIG --static --libs ior)
PKG_CONFIG_PATH=$php_ior_pkg_config_path
PHP_EVAL_INCLINE([$IOR_CFLAGS])
PHP_EVAL_LIBLINE([$IOR_LIBS])
AC_DEFINE([HAVE_IOR], [1], [Define to 1 if the ior library is available.])
PHP_ADD_SOURCES([main/io], [php_io_ring.c],
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
])

dnl Check Valgrind support.
PHP_ARG_WITH([valgrind],
[whether to enable Valgrind support],
Expand Down Expand Up @@ -1694,6 +1721,8 @@ PHP_ADD_SOURCES([main/io], m4_normalize([
php_io_copy_freebsd.c
php_io_copy_solaris.c
php_io_copy_macos.c
php_io_hooks.c
php_io_queue_poll.c
]),
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])

Expand All @@ -1705,6 +1734,7 @@ PHP_ADD_SOURCES([main/poll], m4_normalize([
poll_core.c
poll_fd_table.c
poll_handle.c
poll_source.c
]),
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])

Expand Down
11 changes: 11 additions & 0 deletions ext/curl/curl_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <curl/curl.h>
#include <curl/multi.h>

#include "main/php_deadline.h"

#define CURLOPT_RETURNTRANSFER 19913
#define CURLOPT_BINARYTRANSFER 19914 /* For Backward compatibility */
#define PHP_CURL_STDOUT 0
Expand Down Expand Up @@ -109,12 +111,20 @@ typedef struct {
struct _php_curl_send_headers header;
struct _php_curl_error err;
bool in_callback;
bool in_exec;
uint32_t* clone;
zval postfields;
/* For CURLOPT_PRIVATE */
zval private_data;
/* CurlShareHandle object set using CURLOPT_SHARE. */
struct _php_curlsh *share;
/* Sockets libcurl wants watched, keyed by curl_socket_t */
HashTable *io_sockets;
struct _php_curl_socket_entry *io_removed;
php_deadline io_timer;
/* Private multi handle driving curl_exec() */
CURLM *multi;
long maxconnects;
zend_object std;
} php_curl;

Expand Down Expand Up @@ -148,6 +158,7 @@ void _php_curl_cleanup_handle(php_curl *);
void _php_curl_multi_cleanup_list(void *data);
void _php_curl_verify_handlers(php_curl *ch, bool reporterror);
void _php_setup_easy_copy_handlers(php_curl *ch, php_curl *source);
bool php_curl_check_not_in_exec(php_curl *ch);

/* Consumes `zv` */
zend_long php_curl_get_long(zval *zv);
Expand Down
18 changes: 18 additions & 0 deletions ext/curl/curl_socket_handle.stub.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/** @generate-class-entries */

/**
* Identity of one socket in a multi handle's connection pool, from the first
* report to CURL_POLL_REMOVE; a pooled connection reused later gets a new one.
* Created by the extension's socket callback only, so userland sees it
* through operations and registrations.
* @strict-properties
* @not-serializable
*/
final class CurlSocketPollWeakHandle implements Io\Poll\WeakHandle
{
private function __construct() {}

public function isValid(): bool {}
}
28 changes: 28 additions & 0 deletions ext/curl/curl_socket_handle_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading