Commit 3e08ccba authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/rpc: if stream ID 0 is used, paic

parent 90192935
...@@ -117,7 +117,8 @@ func (m *MuxConn) Accept(id uint32) (io.ReadWriteCloser, error) { ...@@ -117,7 +117,8 @@ func (m *MuxConn) Accept(id uint32) (io.ReadWriteCloser, error) {
// If the stream isn't closed, then it is already open somehow // If the stream isn't closed, then it is already open somehow
if stream.state != streamStateSynRecv && stream.state != streamStateClosed { if stream.state != streamStateSynRecv && stream.state != streamStateClosed {
return nil, fmt.Errorf("Stream %d already open in bad state: %d", id, stream.state) panic(fmt.Sprintf(
"Stream %d already open in bad state: %d", id, stream.state))
} }
if stream.state == streamStateClosed { if stream.state == streamStateClosed {
...@@ -151,8 +152,9 @@ func (m *MuxConn) Dial(id uint32) (io.ReadWriteCloser, error) { ...@@ -151,8 +152,9 @@ func (m *MuxConn) Dial(id uint32) (io.ReadWriteCloser, error) {
// reaper should clear out old streams once in awhile. // reaper should clear out old streams once in awhile.
if stream, ok := m.streamsDial[id]; ok { if stream, ok := m.streamsDial[id]; ok {
m.muDial.Unlock() m.muDial.Unlock()
return nil, fmt.Errorf( panic(fmt.Sprintf(
"Stream %d already open for dial. State: %d", id, stream.state) "Stream %d already open for dial. State: %d",
id, stream.state))
} }
// Create the new stream and put it in our list. We can then // Create the new stream and put it in our list. We can then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment