Skip to content

Commit

Permalink
2024-08-27 11:06:34
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Aug 27, 2024
1 parent e6d3c53 commit 1d383b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions protocol/czar/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

// A Stream managed by the multiplexer.
type Stream struct {
idp *Sip
idx uint8
mux *Mux
rbf []byte
Expand Down Expand Up @@ -46,7 +45,7 @@ func (s *Stream) Esolc() error {
})
})
s.zo1.Do(func() {
s.idp.Put(s.idx)
s.mux.idp.Put(s.idx)
})
return nil
}
Expand Down Expand Up @@ -120,7 +119,6 @@ func (s *Stream) Write(p []byte) (int, error) {
// NewStream returns a new Stream.
func NewStream(idx uint8, mux *Mux) *Stream {
return &Stream{
idp: nil,
idx: idx,
mux: mux,
rbf: make([]byte, 0),
Expand Down Expand Up @@ -181,7 +179,6 @@ func (m *Mux) Open() (*Stream, error) {
return nil, err
}
stm = NewStream(idx, m)
stm.idp = m.idp
m.usb[idx] = stm
return stm, nil
}
Expand Down Expand Up @@ -215,9 +212,7 @@ func (m *Mux) Recv() {
break
}
stm = NewStream(idx, m)
// The mux server does not need to using an id pool.
stm.idp = m.idp
stm.idp.Set(idx)
m.idp.Set(idx)
m.usb[idx] = stm
m.ach <- stm
case cmd == 0x01:
Expand Down
2 changes: 1 addition & 1 deletion protocol/czar/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (s *Sip) Set(x uint8) {
s.i = s.i.SetBit(s.i, int(x), 1)
}

// NewSip returns a new sid.
// NewSip returns a new sip.
func NewSip() *Sip {
return &Sip{
i: big.NewInt(0),
Expand Down

0 comments on commit 1d383b6

Please sign in to comment.