Conversation
0c9db88 to
6ecfebd
Compare
8670128 to
d9c3d49
Compare
| } | ||
| }; | ||
|
|
||
| static void writeValidPathInfo(ref<Store> store, unsigned int clientVersion, Sink & to, std::shared_ptr<const ValidPathInfo> info) { |
| to << store->printStorePath(pathInfo->path); | ||
| writeValidPathInfo(store, clientVersion, to, pathInfo); | ||
|
|
||
| } else { |
There was a problem hiding this comment.
else branch is the unchanged previous protocol implementation.
| } | ||
|
|
||
|
|
||
| ref<const ValidPathInfo> RemoteStore::readValidPathInfo(ConnectionHandle & conn, const StorePath & path) { |
There was a problem hiding this comment.
Moved, unchanged except improved to use ref over shared_ptr
| } | ||
|
|
||
| void | ||
| ConnectionHandle::withFramedSink(std::function<void(Sink &sink)> fun) { |
| StorePath addToStore(const string & name, const Path & srcPath, | ||
| FileIngestionMethod method = FileIngestionMethod::Recursive, HashType hashAlgo = htSHA256, | ||
| PathFilter & filter = defaultPathFilter, RepairFlag repair = NoRepair) override; |
There was a problem hiding this comment.
Default implementation is used.
| Use with FramedSink, which also allows the logical stream to be terminated | ||
| in the event of an exception. | ||
| */ | ||
| struct FramedSource : Source |
There was a problem hiding this comment.
Updated comment, implemention moved and unchanged.
| The exception_ptr reference can be used to terminate the stream when you | ||
| detect that an error has occurred on the remote end. | ||
| */ | ||
| struct FramedSink : nix::BufferedSink |
There was a problem hiding this comment.
New comment, interface changed to take a BufferedSink instead of the whole Connection. Other than that, implementation unchanged.
Ericson2314
left a comment
There was a problem hiding this comment.
Baring those 2 little things, I cannot recommend this enough!
CC @edolstra
Co-authored-by: John Ericson <[email protected]>
Co-authored-by: John Ericson <[email protected]>
A ValidPathInfo is created anyway. By returning it we can save a roundtrip and we have a nicer interface.
Also checked that all usages satisfy the requirement and removed dead code.
52f21a8 to
ca30abb
Compare
|
Thanks! |
|
After merging this, commands like I think |
|
Fixed in 980edd1. |
RemoteStore::addToStoreFromDump. Closes Implement RemoteStore.addToStoreFromDump #4009addToStorein daemon. Closes WIP: Constant space daemonwopAddToStore-- contains #3801 #3802ContentAddressMethodwhich represents the labels that precede CA hashes but not the hashwopAddTextToStoreintowopAddToStore. Not super necessary but was easy with the above in place and fits well with the newContentAddress* stuffFramedSourceandFramedSinkare now reusable