You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
net: do wii network transfers in blocks (#178) - #31
Thanks for picking this up. I reported the original issue in dborth/libsmb2#2 (real Wii, Samba 4, SMB2/3). I read through the diff and
have two observations:
Splitting into blocks fixes the IPC_ENOMEM (-22) on large requests, which
was one of the two problems I saw. The other was a hang right after the
TCP connect: libsmb2's read loop expects EAGAIN when no data is pending
on a non-blocking socket, but net_read() -> net_recvfrom() with flags 0
did not give me that. I worked around it by calling net_select() with a
zero timeout first and returning EAGAIN if nothing is readable. This
patch doesn't change that behaviour, so I'd expect the hang to remain.
In the new loop, if len > maxblocksize and the first block comes back
full, the loop calls recvfrom again immediately. If no more data is
pending, that call either blocks or returns -EAGAIN, and since ret = received overwrites the count, the data already read is lost.
Returning the bytes read so far (when ret > 0) would avoid that. The same
applies to net_sendto if a later block fails.
I haven't tested this PR build on hardware yet. Since dborth/libsmb2#2 was
closed in favour of this, I'd suggest keeping the EAGAIN/readability check
in mind until it's confirmed that the hang is gone with this change alone.
I'll report back with test results on hardware as soon as I'm home on
Friday.
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
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.
a PR was recently submitted to me - dborth/libsmb2#2
the problem - net_recvfrom and net_sendto are neither bound nor gracefully handle large sizes.
looks like others have hit this before so I pulled the working fix from dacotaco (devkitPro/libogc@f4dbfca)