smb: add READ_RAW for ~20× faster file copies#366
Merged
Conversation
Win95's redirector was falling back to ~2.8KB core READs (no raw mode advertised), so a 200KB copy took ~360 round-trips through the emulated NIC/TCP stack (~10s). With READ_RAW it pulls up to 64KB per round-trip. - server.ts: readRaw() handler (raw bytes only, 0-byte frame on error); negotiate now sets MaxRawSize=65535 + CAP_RAW_MODE (NT) and RawMode bit 0 (LM); per-packet hex capture gated on WIN95_SMB_CAPTURE - smb.ts: CMD_READ_RAW constant - test-standalone.ts: READ_RAW happy-path + bad-fid tests (57 pass)
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.
Win95's redirector was falling back to ~2.8 KB core
READs because we advertised no raw mode, so copying a 200 KB file took ~360 round-trips through the emulated ne2k/TCP stack (~10 s). WithSMB_COM_READ_RAWit pulls up to 64 KB per round-trip.Changes
readRaw()handler (response is raw bytes only, no SMB header; 0-byte NetBIOS frame on error/EOF per [MS-CIFS] §2.2.4.24). Negotiate now advertisesMaxRawSize=65535+CAP_RAW_MODE(NT dialect) andRawModebit 0 (LM dialect). Per-packet hex capture is now gated onWIN95_SMB_CAPTUREinstead of always-on.CMD_READ_RAW = 0x1aTest