Skip to content

Commit 0c937f7

Browse files
fix(broadcast): connections wont be made when not broadcastcall
1 parent 073cb89 commit 0c937f7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

broadcast/errors.go

+8
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ type ShardDownErr struct{}
2929
func (err ShardDownErr) Error() string {
3030
return "the shard is down"
3131
}
32+
33+
type InvalidAddrErr struct {
34+
addr string
35+
}
36+
37+
func (err InvalidAddrErr) Error() string {
38+
return "provided addr is invalid. got: " + err.addr
39+
}

broadcast/router.go

+3
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ func (r *BroadcastRouter) routeClientReply(broadcastID uint64, addr, method stri
102102
}
103103

104104
func (r *BroadcastRouter) getClient(addr string) (*Client, error) {
105+
if addr == "" {
106+
return nil, InvalidAddrErr{addr: addr}
107+
}
105108
// fast path:
106109
// read lock because it is likely that we will send many
107110
// messages to the same client.

0 commit comments

Comments
 (0)