Repository navigation
Conversation
amitchone
changed the base branch from
main
to
userspace-7-socket-server-user-mode
December 2, 2026 16:55
garethpotter
reviewed
Dec 2, 2026
| unknown, | ||
| }; | ||
|
|
||
| /// @brief Tells whether a binary request is all there. |
Collaborator
There was a problem hiding this comment.
Slightly odd wording.
| /// @param request What has been received. | ||
| /// @param length The number of bytes received. | ||
| /// @return What there is of the request. | ||
| RequestExtent binaryRequestExtent(const uint8_t *request, size_t length); |
Collaborator
There was a problem hiding this comment.
getBinaryRequestExtent?
| whole, | ||
| /// @brief The request breaks off: the rest of it is still to come. | ||
| partial, | ||
| /// @brief It cannot be told. What there is does not start as a binary request does, |
| void adoptPendingSockets(); | ||
| /// Handler side - reads what is still to come of a request, of which TCP delivers as | ||
| /// much at a time as it pleases. Takes the number of bytes that have been read and | ||
| /// returns the number there are once the request is whole, or zero if it will not |
Collaborator
There was a problem hiding this comment.
...once the request is complete...
| /// Handler side - reads what is still to come of a request, of which TCP delivers as | ||
| /// much at a time as it pleases. Takes the number of bytes that have been read and | ||
| /// returns the number there are once the request is whole, or zero if it will not | ||
| /// be: it did not arrive in time, it is too long, or the client has gone. |
Comment on lines
+155
to
+164
| switch (skipItem(position, end)) { | ||
| case Skip::done: | ||
| break; | ||
| case Skip::truncated: | ||
| return RequestExtent::partial; | ||
| default: | ||
| return RequestExtent::unknown; | ||
| } | ||
| if (position == end) { | ||
| return RequestExtent::partial; |
Collaborator
There was a problem hiding this comment.
Trying to understand what this is for...
Comment on lines
+169
to
+172
| * TCP delivers bytes, not requests: a request may come in as many pieces as the network | ||
| * and the client please. The tests below send requests piece by piece, over a socket | ||
| * of their own. | ||
| */ |
Collaborator
There was a problem hiding this comment.
Getting rather tired of seeing TCP packetisation explained over and over again in comments.
| // binary update of the root: the ID 0x300 to 25.0 | ||
| static const uint8_t updateTo25[] = { (uint8_t)ThingSetBinaryRequestType::update, 0x00, 0xa1, 0x19, 0x03, 0x00, 0xfa, 0x41, 0xc8, 0x00, 0x00 }; | ||
|
|
||
| /// TCP delivers a request in as many pieces as it pleases. Nothing is done with |
Comment on lines
+482
to
+484
| /// Of a request that never arrives in full nothing is handled. The client is | ||
| /// told so and the connection is closed, as there is no telling where its next | ||
| /// request would start; the server is there for the next client. |
Collaborator
There was a problem hiding this comment.
As ever, rather florid.
| } | ||
| } | ||
|
|
||
| RequestExtent binaryRequestExtent(const uint8_t *request, size_t length) |
Collaborator
There was a problem hiding this comment.
Is the idea that it parses a whole request to check whether it has got the whole request? That seems quite...heavy?
amitchone
force-pushed
the
userspace-8-tcp-request-reassembly
branch
from
December 3, 2026 10:05
0d9880b to
d5a6f27
Compare
amitchone
force-pushed
the
userspace-8-tcp-request-reassembly
branch
from
December 3, 2026 11:12
d5a6f27 to
981128a
Compare
amitchone
force-pushed
the
userspace-8-tcp-request-reassembly
branch
from
December 3, 2026 11:47
981128a to
0f41408
Compare
amitchone
force-pushed
the
userspace-8-tcp-request-reassembly
branch
from
December 3, 2026 12:04
0f41408 to
4dc41ec
Compare
amitchone
force-pushed
the
userspace-8-tcp-request-reassembly
branch
from
December 3, 2026 16:06
4dc41ec to
a1fe9ee
Compare
amitchone
force-pushed
the
userspace-8-tcp-request-reassembly
branch
from
December 3, 2026 17:33
a1fe9ee to
1d50ade
Compare
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.
No description provided.