~kennylevinsen/greetd-devel

greetd: fakegreet: reset state on errors v1 APPLIED

Aleksei Bavshin: 1
 fakegreet: reset state on errors

 1 files changed, 4 insertions(+), 0 deletions(-)
#825463 alpine.yml success
#825464 archlinux.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~kennylevinsen/greetd-devel/patches/34740/mbox | git am -3
Learn more about email & git

[PATCH greetd] fakegreet: reset state on errors Export this patch

Some greeters were sending CancelSession in response to Error, likely
because it was necessary for a consistent internal state of fakegreet.

Change fakegreet to comply with the protocol doc, which states that the
sessions are automatically cancelled on error, and remove the need for
the redundant CancelSession.
---
 fakegreet/src/main.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fakegreet/src/main.rs b/fakegreet/src/main.rs
index 187551e..89aa05b 100644
--- a/fakegreet/src/main.rs
+++ b/fakegreet/src/main.rs
@@ -141,6 +141,10 @@ async fn client_handler(ctx: &Context, mut s: UnixStream) -> Result<(), Error> {
            Request::CancelSession => wrap_result(ctx.cancel().await),
        };

        if let Response::Error { .. } = resp {
            ctx.cancel().await?;
        }

        println!("resp: {:?}", resp);
        resp.write_to(&mut s).await?;
    }
-- 
2.37.2
greetd/patches: SUCCESS in 3m5s

[fakegreet: reset state on errors][0] from [Aleksei Bavshin][1]

[0]: https://lists.sr.ht/~kennylevinsen/greetd-devel/patches/34740
[1]: mailto:alebastr89@gmail.com

✓ #825464 SUCCESS greetd/patches/archlinux.yml https://builds.sr.ht/~kennylevinsen/job/825464
✓ #825463 SUCCESS greetd/patches/alpine.yml    https://builds.sr.ht/~kennylevinsen/job/825463
Applied, thanks!

(Apologies for the delay.)