~emersion/soju-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] downstream: Start bouncer on first auth for users added out-of-process

Details
Message ID
<20211029174934.77397-1-mooff@awful.cooking>
DKIM signature
missing
Download raw message
Patch: +9 -5
From: mooff <soju@cyberspace.baby>

---
 downstream.go | 10 +++++-----
 server.go     |  4 ++++
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/downstream.go b/downstream.go
index 2d089b0..a0d75b9 100644
--- a/downstream.go
+++ b/downstream.go
@@ -1064,11 +1064,11 @@ func (dc *downstreamConn) authenticate(username, password string) error {
		return errAuthFailed
	}

	dc.user = dc.srv.getUser(username)
	if dc.user == nil {
		dc.logger.Printf("failed authentication for %q: user not active", username)
		return errAuthFailed
	}
	dc.srv.lock.Lock()
	defer dc.srv.lock.Unlock()

	dc.user = dc.srv.addUserLocked(u)

	dc.clientName = clientName
	dc.networkName = networkName
	return nil
diff --git a/server.go b/server.go
index 7f853cd..7fe6b03 100644
--- a/server.go
+++ b/server.go
@@ -153,6 +153,10 @@ func (s *Server) getUser(name string) *user {
}

func (s *Server) addUserLocked(user *User) *user {
	if u, ok := s.users[user.Username]; ok {
		return u
	}

	s.Logger.Printf("starting bouncer for user %q", user.Username)
	u := newUser(s, user)
	s.users[u.Username] = u
-- 
2.30.2
Details
Message ID
<20211029210421.14e19dab@vroom.localdomain>
In-Reply-To
<20211029174934.77397-1-mooff@awful.cooking> (view parent)
DKIM signature
pass
Download raw message
emersion already rejected this patch :s

https://lists.sr.ht/~emersion/soju-dev/patches/25249
Reply to thread Export thread (mbox)