Skip to content

Correct what the TransmitFile comments say about EOF and the socket mode - #309

Merged
EdmondDantes merged 1 commit into
mainfrom
transmitfile-comments
Oct 1, 2026
Merged

EdmondDantes merged 1 commit into
mainfrom
transmitfile-comments

Conversation

@EdmondDantes

Copy link
Copy Markdown
Contributor

Comments only, in io_transmitfile_work_cb.

A probe of synchronous TransmitFile on Windows 11 26200 (NULL OVERLAPPED; a blocking socket and one set up as libuv's uv__tcp_set_socket does, same results):

  • A count or start past EOF fails with WSAEINVAL. It does not stop at EOF and report success, as the comment said: it sent none of a 4 KiB file and all or part of a 2 MiB one. A file that shrinks during the call therefore fails the transfer with UV_EINVAL; it is not counted whole.
  • The file pointer after the call stands 32 KiB in for any larger file, which is why counting from it (4102d7f) was wrong.
  • libuv's socket is non-blocking (FIONBIO) and the call is still synchronous with a NULL OVERLAPPED.

The clamp from 1521d69 stays; the code is unchanged. Recorded in true-async/server dev/DECISIONS.md (PR true-async/server#369).

A probe on Windows 11: a count or start past EOF fails with WSAEINVAL rather
than stopping at EOF, and libuv's socket is non-blocking (FIONBIO); the call
is still synchronous with a NULL OVERLAPPED.
@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@EdmondDantes
EdmondDantes merged commit ef85610 into main Oct 1, 2026
9 checks passed
@EdmondDantes
EdmondDantes deleted the transmitfile-comments branch October 1, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant