refactor message boundary constrains

This commit is contained in:
Shelikhoo 2025-01-30 13:35:36 +00:00
parent 33b3891648
commit 1ba58c864d
No known key found for this signature in database
GPG key ID: 4C9764E9FE80A3DC
6 changed files with 10 additions and 27 deletions

View file

@ -1,23 +1,14 @@
package packetpadding
import "io"
import (
"io"
)
type ReadWriteCloserPreservesBoundary interface {
io.ReadWriteCloser
MessageBoundaryPreserved()
}
type messageBoundaryPreservedReadWriteCloser struct {
io.ReadWriteCloser
}
func (m *messageBoundaryPreservedReadWriteCloser) MessageBoundaryPreserved() {
}
func ConfirmsReadWriteCloserPreservesMessageBoundary(rwc io.ReadWriteCloser) ReadWriteCloserPreservesBoundary {
return &messageBoundaryPreservedReadWriteCloser{rwc}
}
type PaddableConnection interface {
ReadWriteCloserPreservesBoundary
}