mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-10-12 22:24:18 +03:00
* [WIP] moved out classic AWG params to conceal conns * refactor of conceal rules locations * refactor of working with concealment parameters
17 lines
269 B
Go
17 lines
269 B
Go
package conceal
|
|
|
|
import "io"
|
|
|
|
func ReadUntil(r io.Reader, b []byte, delim byte) (n int, err error) {
|
|
for n < len(b) {
|
|
if _, err = r.Read(b[n : n+1]); err != nil {
|
|
return n, err
|
|
}
|
|
if b[n] == delim {
|
|
return n, nil
|
|
}
|
|
n++
|
|
}
|
|
return n, io.ErrShortBuffer
|
|
}
|