[RFC-9250]: Add QUIC server support (#6182)

Add DNS-over-QUIC server 

Signed-off-by: jaehnri <joao.henri.cr@gmail.com>
Signed-off-by: João Henri <joao.henri.cr@gmail.com>
This commit is contained in:
João Henri
2023-07-31 16:34:31 -03:00
committed by GitHub
parent b7c9d3e155
commit cc7a364633
15 changed files with 759 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
package dnsserver
import (
"testing"
)
func TestDoQWriterAddPrefix(t *testing.T) {
byteArray := []byte{0x1, 0x2, 0x3}
byteArrayWithPrefix := AddPrefix(byteArray)
if len(byteArrayWithPrefix) != 5 {
t.Error("Expected byte array with prefix to have length of 5")
}
size := int16(byteArrayWithPrefix[0])<<8 | int16(byteArrayWithPrefix[1])
if size != 3 {
t.Errorf("Expected prefixed size to be 3, got: %d", size)
}
}