Nhse o40 orkv.i141 silvermachine#3
Open
martinsumner wants to merge 55 commits intoopenriak-4.0from
Open
Conversation
WIP. A framework of modules and functions for SliverMachine.
Apply only to new files, or heavily altered files so that broader change history is maintained.
Also add callback module and unit test the sending of responses both streamed and whole.
Plus some further testing/formatting
Retain mohijson2 and mochinum to ease transition
Where URI starts "/" will add a leading <<>> to the split path - which is confusing and easy to forget about.
Address initial feedback
Also provides functions for converting Last Modified Date in KV GET.
Also compile the binary pattern, and cache in a persistent term to speed up parsing
This reverts commit 261afdc.
Just assume that it is empty
The uri_string:normalize is going to decode that path and the query params (resolve any percent encoding, then check the outcome is unicode). It will also handle any dot segments. If there are no dots, or percent encoding - this is unnecessary - the parsed outcome will be the same. This will normally be the case - so bypass normalization if possible. Paths can be quite long (with long bucket names, keys etc) - so avoiding this step has value.
Defaults to 1460 on OTP26 - and this means that not all data available in buffer
Nature of clock implementation changed - and so all tests may use cached clock - and so no longer a valid comparison.
Reuse Peer/Cert in all check_permissions callback on the connection.
128 aligns with mochiweb - otherwise some tests with riak_test that use large bursts of connections may fail
Without requiring knowledge when implementing routes of the routes priority relative to others.
ThomasArts
reviewed
May 7, 2026
| ) -> | ||
| ok. | ||
| add_routes(ServerName, Routes) -> | ||
| CurrentRoutes = persistent_term:get({?MODULE, ServerName}, []), |
Contributor
There was a problem hiding this comment.
This mislead me. The name of the variable should be Port not ServerName. The term you store is the Port or default and that should return the routes for that port.
The confusion came from the fact that you use
persistent_term:get(
{?MODULE, Port},
persistent_term:get({?MODULE, default}, [])
later on and I was afraid that that would clash between ServerName and Port.
For clarity, one should probably have an extra tag to make it clear what type of term you get (not to confuse it with cache_today which is not a port).
An extra tag in the tuple?
| {ok, PeerIP, Cert} = riak_api_web_socket:get_peer(Socket), | ||
| loop(Socket, <<>>, PeerIP, Cert, Port); | ||
| {error, timeout} -> | ||
| init(Server, Listener, Port); |
Contributor
There was a problem hiding this comment.
No max number of attempts?
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.
Switch HTTP API to use SilverMachine not WebMachine/Mochiweb.
Intentions are: