Refactor RDP proxy handling and update related tests
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package fabricproto
|
||||
|
||||
import "errors"
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrUnsupportedSessionFrame = errors.New("unsupported fabric session frame")
|
||||
@@ -62,6 +65,7 @@ func (s *Session) HandleFrame(frame Frame) (SessionEvent, []Frame, error) {
|
||||
TrafficClass: frame.TrafficClass,
|
||||
StreamID: frame.StreamID,
|
||||
Sequence: frame.Sequence,
|
||||
Payload: DataAckPayload(frame.Payload),
|
||||
}}, nil
|
||||
case FrameAck:
|
||||
if err := s.Ack(frame.StreamID, frame.Sequence); err != nil {
|
||||
@@ -103,6 +107,11 @@ func (s *Session) HandleFrame(frame Frame) (SessionEvent, []Frame, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func DataAckPayload(payload []byte) []byte {
|
||||
sum := sha256.Sum256(payload)
|
||||
return sum[:]
|
||||
}
|
||||
|
||||
func (s *Session) handleDataFrame(frame Frame) (SessionEvent, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user