Skip to content

Commit

Permalink
Adjust naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Aug 15, 2024
1 parent eabafdf commit 1344abd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions protocol/czar/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func (c *Client) Dial(ctx *daze.Context, network string, address string) (io.Rea
if err != nil {
return nil, err
}
log.Printf("czar: mux slot stream id=0x%02x", srv.idx)
spy := &ashe.Client{Cipher: c.Cipher}
con, err := spy.Estab(ctx, srv, network, address)
if err != nil {
Expand Down
16 changes: 8 additions & 8 deletions protocol/czar/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ func (m *Mux) Spawn() {
stm.rer.Put(io.EOF)
stm.wer.Put(io.ErrClosedPipe)
stm.son.Do(func() { stm.idp <- stm.idx })
air := NewStream(idx, m)
air.son.Do(func() {})
air.Close()
m.usb[idx] = air
old := NewStream(idx, m)
old.son.Do(func() {})
old.Close()
m.usb[idx] = old
case cmd >= 0x03:
// Packet format error, connection closed.
m.con.Close()
Expand Down Expand Up @@ -224,10 +224,10 @@ func NewMux(conn net.Conn) *Mux {
func NewMuxServer(conn net.Conn) *Mux {
mux := NewMux(conn)
for i := range 256 {
air := NewStream(uint8(i), mux)
air.son.Do(func() {})
air.Close()
mux.usb[i] = air
old := NewStream(uint8(i), mux)
old.son.Do(func() {})
old.Close()
mux.usb[i] = old
}
go mux.Spawn()
return mux
Expand Down

0 comments on commit 1344abd

Please sign in to comment.