chiark / gitweb /
otter.git
3 years agospecs: Test ResetFromNamesSpec (adhoc)
Ian Jackson [Wed, 19 May 2021 22:20:19 +0000 (23:20 +0100)]
specs: Test ResetFromNamesSpec (adhoc)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agospecs: Support ResetFromNamesSpec
Ian Jackson [Wed, 19 May 2021 22:19:49 +0000 (23:19 +0100)]
specs: Support ResetFromNamesSpec

And the associated config.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Provide command-{json,ron} for adhoc commands
Ian Jackson [Wed, 19 May 2021 21:35:17 +0000 (22:35 +0100)]
otter(1): Provide command-{json,ron} for adhoc commands

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Move response iteration back into alter_game_adhoc
Ian Jackson [Wed, 19 May 2021 22:03:49 +0000 (23:03 +0100)]
otter(1): Move response iteration back into alter_game_adhoc

It turns out that commands want to print responses one at a time.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Fix description of alter-game-json
Ian Jackson [Wed, 19 May 2021 21:14:48 +0000 (22:14 +0100)]
otter(1): Fix description of alter-game-json

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Introduce a type alias
Ian Jackson [Wed, 19 May 2021 21:57:30 +0000 (22:57 +0100)]
otter(1): Introduce a type alias

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Drop some not-needed lifetime
Ian Jackson [Wed, 19 May 2021 21:55:45 +0000 (22:55 +0100)]
otter(1): Drop some not-needed lifetime

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Break out AdhocFormat
Ian Jackson [Wed, 19 May 2021 21:53:09 +0000 (22:53 +0100)]
otter(1): Break out AdhocFormat

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Provide alter-game-ron too
Ian Jackson [Wed, 19 May 2021 21:14:52 +0000 (22:14 +0100)]
otter(1): Provide alter-game-ron too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Generalise alter-game-json ad-hoc subcommand (2)
Ian Jackson [Wed, 19 May 2021 21:24:09 +0000 (22:24 +0100)]
otter(1): Generalise alter-game-json ad-hoc subcommand (2)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Generalise alter-game-json ad-hoc subcommand (1)
Ian Jackson [Wed, 19 May 2021 21:01:11 +0000 (22:01 +0100)]
otter(1): Generalise alter-game-json ad-hoc subcommand (1)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agootter(1): Provide alter-game-json ad-hoc subcommand
Ian Jackson [Wed, 19 May 2021 19:51:15 +0000 (20:51 +0100)]
otter(1): Provide alter-game-json ad-hoc subcommand

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoaccounts: Require Debug for Perm
Ian Jackson [Wed, 19 May 2021 19:51:33 +0000 (20:51 +0100)]
accounts: Require Debug for Perm

This makes debugging a bit easier.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocmdlistener: Fix MGI::Noop to require TestExistence
Ian Jackson [Wed, 19 May 2021 19:51:26 +0000 (20:51 +0100)]
cmdlistener: Fix MGI::Noop to require TestExistence

This saves an assertion failure when it's invoked!

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoaccounts: Add test for PermSet
Ian Jackson [Wed, 19 May 2021 20:32:17 +0000 (21:32 +0100)]
accounts: Add test for PermSet

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoaccounts: PermSet: Fix to actually shift (!)
Ian Jackson [Wed, 19 May 2021 19:52:05 +0000 (20:52 +0100)]
accounts: PermSet: Fix to actually shift (!)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agomgmtchannel: Better error from AlterGame failure
Ian Jackson [Wed, 19 May 2021 19:16:39 +0000 (20:16 +0100)]
mgmtchannel: Better error from AlterGame failure

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Explode: print the error chain too
Ian Jackson [Wed, 19 May 2021 19:16:22 +0000 (20:16 +0100)]
apitest: Explode: print the error chain too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agospecs: Pass a spec-obtainer closure to reset_game_from_spec
Ian Jackson [Tue, 18 May 2021 20:29:29 +0000 (21:29 +0100)]
specs: Pass a spec-obtainer closure to reset_game_from_spec

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agospecs: Parse the spec after accessing the game
Ian Jackson [Tue, 18 May 2021 20:21:59 +0000 (21:21 +0100)]
specs: Parse the spec after accessing the game

We're going to want to get at the game to get the spec from a bundle.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agospecs: Break out reset_game_from_spec
Ian Jackson [Tue, 18 May 2021 20:18:45 +0000 (21:18 +0100)]
specs: Break out reset_game_from_spec

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo update: Update to latest thirtyfour
Ian Jackson [Tue, 18 May 2021 01:29:17 +0000 (02:29 +0100)]
cargo update: Update to latest thirtyfour

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo update: Update to latest ArrayVec, const generics
Ian Jackson [Tue, 18 May 2021 01:20:17 +0000 (02:20 +0100)]
cargo update: Update to latest ArrayVec, const generics

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agobundles: Do not use ArrayVec to unpack a possibly-too-long thing
Ian Jackson [Tue, 18 May 2021 19:11:51 +0000 (20:11 +0100)]
bundles: Do not use ArrayVec to unpack a possibly-too-long thing

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo update; Use Url::Into<String> rather than into_string
Ian Jackson [Tue, 18 May 2021 01:13:37 +0000 (02:13 +0100)]
cargo update; Use Url::Into<String> rather than into_string

The latter is deprecated.  Suddenly, meaning the build fails.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Test new big bundle
Ian Jackson [Tue, 18 May 2021 00:57:36 +0000 (01:57 +0100)]
apitest: Test new big bundle

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: bundles: Abstract over bundle name
Ian Jackson [Tue, 18 May 2021 00:53:07 +0000 (01:53 +0100)]
apitest: bundles: Abstract over bundle name

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Move much bundle processing into main.rs
Ian Jackson [Tue, 18 May 2021 00:39:05 +0000 (01:39 +0100)]
apitest: Move much bundle processing into main.rs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Test save/load of a bundle
Ian Jackson [Tue, 18 May 2021 00:35:06 +0000 (01:35 +0100)]
apitest: Test save/load of a bundle

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Break out stop_and_restart_gameserver
Ian Jackson [Tue, 18 May 2021 00:34:13 +0000 (01:34 +0100)]
apitest: Break out stop_and_restart_gameserver

This will be for the bundle save/load test.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Delete and reintroduce a lemon
Ian Jackson [Tue, 18 May 2021 00:27:59 +0000 (01:27 +0100)]
apitest: Delete and reintroduce a lemon

This will be for the bundle save/load test.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocommands: Move MGI etc. into prelude
Ian Jackson [Tue, 18 May 2021 00:26:40 +0000 (01:26 +0100)]
commands: Move MGI etc. into prelude

apitest wants them.  Not sure why this wasn't global before.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Track whether library markers have been added
Ian Jackson [Tue, 18 May 2021 00:03:31 +0000 (01:03 +0100)]
apitest: Track whether library markers have been added

This lets us run some_library_add a second time.  (Although, right
now, the previous add's pieces would still be there.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Consolidate reset_game and provide in UsualCtx
Ian Jackson [Tue, 18 May 2021 00:02:38 +0000 (01:02 +0100)]
apitest: Consolidate reset_game and provide in UsualCtx

We are going to want to do some extra tracking

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Consolidate UsualCtx::prepare_game
Ian Jackson [Mon, 17 May 2021 23:55:45 +0000 (00:55 +0100)]
apitest: Consolidate UsualCtx::prepare_game

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Fold placing markers into some_library_add
Ian Jackson [Mon, 17 May 2021 23:45:58 +0000 (00:45 +0100)]
apitest: Fold placing markers into some_library_add

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: check_library_item: Check count of matches
Ian Jackson [Mon, 17 May 2021 18:37:54 +0000 (19:37 +0100)]
apitest: check_library_item: Check count of matches

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Break out check_library_item
Ian Jackson [Mon, 17 May 2021 18:32:10 +0000 (19:32 +0100)]
apitest: Break out check_library_item

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Move bundles test to at-bundles
Ian Jackson [Mon, 17 May 2021 18:23:10 +0000 (19:23 +0100)]
apitest: Move bundles test to at-bundles

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Make some methods public for reuse
Ian Jackson [Mon, 17 May 2021 18:22:56 +0000 (19:22 +0100)]
apitest: Make some methods public for reuse

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: at-bundles: Use UsualCtx
Ian Jackson [Mon, 17 May 2021 17:22:50 +0000 (18:22 +0100)]
apitest: at-bundles: Use UsualCtx

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Move setup code to apitest/main
Ian Jackson [Mon, 17 May 2021 17:19:55 +0000 (18:19 +0100)]
apitest: Move setup code to apitest/main

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Move a lot of code from at-otter to apitest/main
Ian Jackson [Mon, 17 May 2021 17:15:10 +0000 (18:15 +0100)]
apitest: Move a lot of code from at-otter to apitest/main

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Provide @examples@
Ian Jackson [Mon, 17 May 2021 17:07:59 +0000 (18:07 +0100)]
apitest: Provide @examples@

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Prepare for at-bundles
Ian Jackson [Mon, 17 May 2021 17:05:13 +0000 (18:05 +0100)]
apitest: Prepare for at-bundles

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Move ok printing to end of main (portmanteau) main
Ian Jackson [Mon, 17 May 2021 16:59:01 +0000 (17:59 +0100)]
apitest: Move ok printing to end of main (portmanteau) main

This means it happens for wdt too - fine.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Un-clone-and-hack api early arg test predicate
Ian Jackson [Mon, 17 May 2021 16:54:55 +0000 (17:54 +0100)]
apitest: Un-clone-and-hack api early arg test predicate

At some point I guess we could make this concrete entirely but
this will do for now.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Make it also a portmanteau
Ian Jackson [Mon, 17 May 2021 16:52:29 +0000 (17:52 +0100)]
apitest: Make it also a portmanteau

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMakefile: Fix example test bundle building not to produce noise
Ian Jackson [Mon, 17 May 2021 16:44:51 +0000 (17:44 +0100)]
Makefile: Fix example test bundle building not to produce noise

zip simply ignores missing files, so the dupes were harmless.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Move portmanteau machinery from wdriver
Ian Jackson [Mon, 17 May 2021 16:33:42 +0000 (17:33 +0100)]
apitest: Move portmanteau machinery from wdriver

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMakefile: tidy bundle output
Ian Jackson [Mon, 17 May 2021 16:27:25 +0000 (17:27 +0100)]
Makefile: tidy bundle output

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agobig-bundle example: Restore renaming of wikipedia
Ian Jackson [Mon, 17 May 2021 16:24:19 +0000 (17:24 +0100)]
big-bundle example: Restore renaming of wikipedia

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agobig-bundle example: Comment out the scraper bits in tomls
Ian Jackson [Mon, 17 May 2021 16:21:13 +0000 (17:21 +0100)]
big-bundle example: Comment out the scraper bits in tomls

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agobig-bundle example: Use only the bits we want
Ian Jackson [Mon, 17 May 2021 16:13:35 +0000 (17:13 +0100)]
big-bundle example: Use only the bits we want

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agomedia-scraper: Provide LIBRARY_FILE_INPUTS
Ian Jackson [Mon, 17 May 2021 16:05:23 +0000 (17:05 +0100)]
media-scraper: Provide LIBRARY_FILE_INPUTS

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoprogress: Flush so the progress info is actually timely
Ian Jackson [Mon, 17 May 2021 15:56:35 +0000 (16:56 +0100)]
progress: Flush so the progress info is actually timely

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMakefile: Provide an example big bundle
Ian Jackson [Mon, 17 May 2021 15:49:01 +0000 (16:49 +0100)]
Makefile: Provide an example big bundle

We mangle the wikimedia files, ad-hoc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMakefile: Clean files *.tmp
Ian Jackson [Mon, 17 May 2021 15:32:15 +0000 (16:32 +0100)]
Makefile: Clean files *.tmp

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMakefile: Clean the test bundle zipfile
Ian Jackson [Mon, 17 May 2021 15:31:35 +0000 (16:31 +0100)]
Makefile: Clean the test bundle zipfile

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoif_let: Remove the "match" from the general case
Ian Jackson [Mon, 17 May 2021 14:57:36 +0000 (15:57 +0100)]
if_let: Remove the "match" from the general case

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agobundles: Print the bundle name after we have uploaded it
Ian Jackson [Mon, 17 May 2021 14:55:50 +0000 (15:55 +0100)]
bundles: Print the bundle name after we have uploaded it

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoif_let: Provide the logically-necessary fourth case
Ian Jackson [Mon, 17 May 2021 14:55:01 +0000 (15:55 +0100)]
if_let: Provide the logically-necessary fourth case

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoprogress: Minor change to byte count output formatting
Ian Jackson [Mon, 17 May 2021 10:21:31 +0000 (11:21 +0100)]
progress: Minor change to byte count output formatting

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoprogress: Use threads to do concurrent progress reports.
Ian Jackson [Mon, 17 May 2021 10:41:03 +0000 (11:41 +0100)]
progress: Use threads to do concurrent progress reports.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoprogress: Make ProgressMode come from MgmtChannel
Ian Jackson [Mon, 17 May 2021 13:22:25 +0000 (14:22 +0100)]
progress: Make ProgressMode come from MgmtChannel

That's where the implementation (and any restrictions) come from.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoprogress: Introduce ProgressMode
Ian Jackson [Mon, 17 May 2021 10:36:37 +0000 (11:36 +0100)]
progress: Introduce ProgressMode

This allows progress reports to be disabled entirely.

But overall, no functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRevert "progress: Disable the upload progress for now"
Ian Jackson [Mon, 17 May 2021 10:16:35 +0000 (11:16 +0100)]
Revert "progress: Disable the upload progress for now"

This is now done in bundles.rs

This reverts commit 07e26362b74a836d84d8c988bc0169cc3c00d749.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agobundles progress: Rework to do the duplex disablement here
Ian Jackson [Mon, 17 May 2021 10:16:17 +0000 (11:16 +0100)]
bundles progress: Rework to do the duplex disablement here

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agomgmtchannel: Add threadsafety bounds to the bulk writer
Ian Jackson [Mon, 17 May 2021 13:08:05 +0000 (14:08 +0100)]
mgmtchannel: Add threadsafety bounds to the bulk writer

Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agopacketframe: Use concrete types in two places
Ian Jackson [Mon, 17 May 2021 13:08:13 +0000 (14:08 +0100)]
packetframe: Use concrete types in two places

This will let us inherit Send and Sync from the inner writer.

Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoprogress: Call termprogress::clear() before examining cmd response
Ian Jackson [Mon, 17 May 2021 11:00:01 +0000 (12:00 +0100)]
progress: Call termprogress::clear() before examining cmd response

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoprogress: Provide termprogress::clear()
Ian Jackson [Mon, 17 May 2021 10:59:26 +0000 (11:59 +0100)]
progress: Provide termprogress::clear()

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoprogress: Make cmd_withbulk take termprogress::Reporter, not a Fn
Ian Jackson [Mon, 17 May 2021 10:54:28 +0000 (11:54 +0100)]
progress: Make cmd_withbulk take termprogress::Reporter, not a Fn

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agobundles: Truncate bundle files before deleting them
Ian Jackson [Sun, 16 May 2021 21:55:15 +0000 (22:55 +0100)]
bundles: Truncate bundle files before deleting them

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoif_let: Provide a way to get at the error
Ian Jackson [Sun, 16 May 2021 22:24:52 +0000 (23:24 +0100)]
if_let: Provide a way to get at the error

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agobundles: Break out scan_game_bundles
Ian Jackson [Sun, 16 May 2021 22:05:48 +0000 (23:05 +0100)]
bundles: Break out scan_game_bundles

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agobundles: A todo
Ian Jackson [Sun, 16 May 2021 21:49:22 +0000 (22:49 +0100)]
bundles: A todo

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocmdlistener: Apply an idle timeout and an upload timeout
Ian Jackson [Sun, 16 May 2021 19:44:32 +0000 (20:44 +0100)]
cmdlistener: Apply an idle timeout and an upload timeout

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocmdlistener: Use a concrete type for the read stream
Ian Jackson [Sun, 16 May 2021 19:44:04 +0000 (20:44 +0100)]
cmdlistener: Use a concrete type for the read stream

The write stream is still Box<dyn...>

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoReader access: Add some methods to get at the inner TimedFdReader
Ian Jackson [Sun, 16 May 2021 19:21:09 +0000 (20:21 +0100)]
Reader access: Add some methods to get at the inner TimedFdReader

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimedread: Remove some unnecessary braces
Ian Jackson [Mon, 17 May 2021 10:02:42 +0000 (11:02 +0100)]
timedread: Remove some unnecessary braces

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agomgmtchannel: Change contained type to a TimedFdReader
Ian Jackson [Mon, 17 May 2021 13:55:31 +0000 (14:55 +0100)]
mgmtchannel: Change contained type to a TimedFdReader

This is in preparation for timeouts.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimedfd: Add note re nonblock open-file
Ian Jackson [Mon, 17 May 2021 13:48:35 +0000 (14:48 +0100)]
timedfd: Add note re nonblock open-file

This is why we must swap both ends of a mgmtchannel at once.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimedfd: Provide TimedFdWriter too
Ian Jackson [Mon, 17 May 2021 13:47:17 +0000 (14:47 +0100)]
timedfd: Provide TimedFdWriter too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimedfd: Refactor to prep for writing too (2)
Ian Jackson [Mon, 17 May 2021 13:47:00 +0000 (14:47 +0100)]
timedfd: Refactor to prep for writing too (2)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimedfd: Refactor to prep for writing too (1)
Ian Jackson [Mon, 17 May 2021 13:38:37 +0000 (14:38 +0100)]
timedfd: Refactor to prep for writing too (1)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimedfd: Rename from timedread
Ian Jackson [Mon, 17 May 2021 13:28:16 +0000 (14:28 +0100)]
timedfd: Rename from timedread

We are going to need write too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimedread: Add to prelude
Ian Jackson [Mon, 17 May 2021 13:55:19 +0000 (14:55 +0100)]
timedread: Add to prelude

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimedread: Retry on EINTR from poll
Ian Jackson [Mon, 17 May 2021 10:01:00 +0000 (11:01 +0100)]
timedread: Retry on EINTR from poll

In test failures which occurred before I introeduced
  packetframe: Fuse: Do not persist EINTR or EWOULDBLOCK
I think I observed poll() returning EINTR.  Better to handle
that here even if the next layer up might do so.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agopacketframe: Fuse: Do not persist EINTR or EWOULDBLOCK
Ian Jackson [Mon, 17 May 2021 09:45:08 +0000 (10:45 +0100)]
packetframe: Fuse: Do not persist EINTR or EWOULDBLOCK

Fusing EINTR is particularly toxic.  BufReader retries.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimereader: Minor refactoring
Ian Jackson [Sun, 16 May 2021 19:20:58 +0000 (20:20 +0100)]
timereader: Minor refactoring

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimereader: Provide useful methods
Ian Jackson [Sun, 16 May 2021 19:12:53 +0000 (20:12 +0100)]
timereader: Provide useful methods

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimereader: mio: Add another feature which we need
Ian Jackson [Sun, 16 May 2021 23:27:12 +0000 (00:27 +0100)]
timereader: mio: Add another feature which we need

Cargo feature unification seemed to have been getting this one for us
previously, anyway.  But lacking it is a bit of a hazard.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotimereader: New module - does not work properly yet
Ian Jackson [Sun, 16 May 2021 18:52:16 +0000 (19:52 +0100)]
timereader: New module - does not work properly yet

At first I tried doing this by a contraption which would dup2
/dev/null over the socket, but it turns out that (with Linux on my
laptop at least) this doesn't interrupt recvfrom in another thread.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocmdlistener: Break out write_error
Ian Jackson [Sun, 16 May 2021 20:41:19 +0000 (21:41 +0100)]
cmdlistener: Break out write_error

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agopacketframe: Provide get_even_broken method
Ian Jackson [Sun, 16 May 2021 17:00:58 +0000 (18:00 +0100)]
packetframe: Provide get_even_broken method

We will use this to implement AsRawFd

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agopacketframe: Fuse: retain the inner RW when broken
Ian Jackson [Sun, 16 May 2021 12:18:20 +0000 (13:18 +0100)]
packetframe: Fuse: retain the inner RW when broken

We are going to want this for AsRawFd, which needs to work even when
broken since it is supposed to be infallible.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agomgmtchannel: Drop BufReader and BufWriter
Ian Jackson [Sun, 16 May 2021 12:44:20 +0000 (13:44 +0100)]
mgmtchannel: Drop BufReader and BufWriter

FrameReader and FrameWriter have internal buffers

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoprogress: Disable the upload progress for now
Ian Jackson [Sun, 16 May 2021 09:35:28 +0000 (10:35 +0100)]
progress: Disable the upload progress for now

I have realised this can deadlock.  Fixing it seems to involve maybe
putting Tokio into otter(1) ...

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDrop some done todos
Ian Jackson [Sat, 15 May 2021 23:44:10 +0000 (00:44 +0100)]
Drop some done todos

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>