mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 06:39:40 +01:00
e374bb7e2d
* [Vendor] update go-ldap to v3.0.3 * update go-ldap to v3.2.4 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
24 lines
452 B
Go
Vendored
24 lines
452 B
Go
Vendored
package ber
|
|
|
|
import "io"
|
|
|
|
func readByte(reader io.Reader) (byte, error) {
|
|
bytes := make([]byte, 1)
|
|
_, err := io.ReadFull(reader, bytes)
|
|
if err != nil {
|
|
if err == io.EOF {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
return 0, err
|
|
}
|
|
return bytes[0], nil
|
|
}
|
|
|
|
func isEOCPacket(p *Packet) bool {
|
|
return p != nil &&
|
|
p.Tag == TagEOC &&
|
|
p.ClassType == ClassUniversal &&
|
|
p.TagType == TypePrimitive &&
|
|
len(p.ByteValue) == 0 &&
|
|
len(p.Children) == 0
|
|
}
|