stream_copy_to_stream: document offset and socket timeout behavior - #5860
Merged
lacatoire merged 1 commit intoSep 24, 2026
Merged
Conversation
A zero or negative offset keeps the current position, a positive one seeks from the start of the stream. Copying from a blocking socket stops when the stream timeout is reached, and false may be returned even though data has already been written to the destination.
lacatoire
force-pushed
the
stream-copy-to-stream-offset-timeout
branch
from
September 15, 2026 09:28
44dddeb to
95d91de
Compare
KentarouTakeda
added a commit
to KentarouTakeda/php-doc-ja
that referenced
this pull request
Sep 24, 2026
stream と sockets の 4 ファイルを原文の変更に追従しました。これで stream と sockets モジュールの未訳・要更新はなくなります。 - `socket_select()` に配列のキーが保持されることが追記され、配列を省略できるとしていた記述などが直されました。`stream_select()` には、`socket_select()` と同じには動かないことと、PHP 側のバッファにデータがあると `select()` を呼ばずに戻ることが追記されました(php/doc-en@3e6082f、php/doc-en#5829) - `stream_copy_to_stream()` に、`offset` が 0 以下なら現在の位置からコピーすることと、ブロックモードのソケットではタイムアウトでコピーが終わり、書き込み済みでも `false` が返ることがあることが追記されました(php/doc-en@a88dc81、php/doc-en#5860) - スタブだった `socket_sendmsg()` のページに、説明・パラメータ・例が書かれました(php/doc-en@30b010f、php/doc-en#2039) ## 対象ファイル reference/stream/ (2) — functions/stream-copy-to-stream.xml, functions/stream-select.xml reference/sockets/ (2) — functions/socket-select.xml, functions/socket-sendmsg.xml
KentarouTakeda
added a commit
to KentarouTakeda/php-doc-ja
that referenced
this pull request
Sep 24, 2026
stream と sockets の 4 ファイルを原文の変更に追従しました。これで stream と sockets モジュールの未訳・要更新はなくなります。 - `socket_select()` に配列のキーが保持されることが追記され、配列を省略できるとしていた記述などが直されました。`stream_select()` には、`socket_select()` と同じには動かないことと、PHP 側のバッファにデータがあると `select()` を呼ばずに戻ることが追記されました(php/doc-en@3e6082f、php/doc-en#5829) - `stream_copy_to_stream()` に、`offset` が 0 以下なら現在の位置からコピーすることと、ブロックモードのソケットではタイムアウトでコピーが終わり、書き込み済みでも `false` が返ることがあることが追記されました(php/doc-en@a88dc81、php/doc-en#5860) - スタブだった `socket_sendmsg()` のページに、説明・パラメータ・例が書かれました(php/doc-en@30b010f、php/doc-en#2039) ## 対象ファイル reference/stream/ (2) — functions/stream-copy-to-stream.xml, functions/stream-select.xml reference/sockets/ (2) — functions/socket-select.xml, functions/socket-sendmsg.xml
KentarouTakeda
added a commit
to KentarouTakeda/php-doc-ja
that referenced
this pull request
Sep 24, 2026
stream と sockets の 4 ファイルを原文の変更に追従しました。これで stream と sockets モジュールの未訳・要更新はなくなります。 - `socket_select()` に配列のキーが保持されることが追記され、配列を省略できるとしていた記述などが直されました。`stream_select()` には、`socket_select()` と同じには動かないことと、PHP 側のバッファにデータがあると `select()` を呼ばずに戻ることが追記されました(php/doc-en@3e6082f、php/doc-en#5829) - `stream_copy_to_stream()` に、`offset` が 0 以下なら現在の位置からコピーすることと、ブロックモードのソケットではタイムアウトでコピーが終わり、書き込み済みでも `false` が返ることがあることが追記されました(php/doc-en@a88dc81、php/doc-en#5860) - スタブだった `socket_sendmsg()` のページに、説明・パラメータ・例が書かれました(php/doc-en@30b010f、php/doc-en#2039) `socket_cmsg_space()` は原文が変わっていませんが、ancillary data の訳語を `socket_sendmsg()` と同じ「補助データ」に揃えています。 ## 対象ファイル reference/stream/ (2) — functions/stream-copy-to-stream.xml, functions/stream-select.xml reference/sockets/ (3) — functions/socket-cmsg-space.xml, functions/socket-select.xml, functions/socket-sendmsg.xml
KentarouTakeda
added a commit
to php/doc-ja
that referenced
this pull request
Sep 24, 2026
stream と sockets の 4 ファイルを原文の変更に追従しました。これで stream と sockets モジュールの未訳・要更新はなくなります。 - `socket_select()` に配列のキーが保持されることが追記され、配列を省略できるとしていた記述などが直されました。`stream_select()` には、`socket_select()` と同じには動かないことと、PHP 側のバッファにデータがあると `select()` を呼ばずに戻ることが追記されました(php/doc-en@3e6082f、php/doc-en#5829) - `stream_copy_to_stream()` に、`offset` が 0 以下なら現在の位置からコピーすることと、ブロックモードのソケットではタイムアウトでコピーが終わり、書き込み済みでも `false` が返ることがあることが追記されました(php/doc-en@a88dc81、php/doc-en#5860) - スタブだった `socket_sendmsg()` のページに、説明・パラメータ・例が書かれました(php/doc-en@30b010f、php/doc-en#2039) `socket_cmsg_space()` は原文が変わっていませんが、ancillary data の訳語を `socket_sendmsg()` と同じ「補助データ」に揃えています。 ## 対象ファイル reference/stream/ (2) — functions/stream-copy-to-stream.xml, functions/stream-select.xml reference/sockets/ (3) — functions/socket-cmsg-space.xml, functions/socket-select.xml, functions/socket-sendmsg.xml
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
offsetdescription didn't say that 0 (the default) keeps the current position while a positive value seeks from the start of the stream, and nothing mentioned that copying from a blocking socket stops on the stream timeout.Fixes: #2026
Fixes: #2046
Fixes: #2414