mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-13 00:05:10 +00:00
deploy: c0f5063e07e10c5e9d8987c000b9ae1c3a7d2929
This commit is contained in:
parent
14fc817ad9
commit
263c8d22a1
2
vendor/dnsclient.nim/dnsclient.nimble
vendored
2
vendor/dnsclient.nim/dnsclient.nimble
vendored
@ -1,6 +1,6 @@
|
||||
# Package
|
||||
|
||||
version = "0.1.2"
|
||||
version = "0.2.0"
|
||||
author = "Huy Doan"
|
||||
description = "Simple DNS Client & Library"
|
||||
license = "MIT"
|
||||
|
@ -1,9 +1,11 @@
|
||||
type TXTRecord* = ref object of ResourceRecord
|
||||
length*: uint8
|
||||
data*: string
|
||||
strings*: seq[string]
|
||||
|
||||
method toString*(r: TXTRecord): string = r.data
|
||||
method toString*(r: TXTRecord): string = r.strings.join()
|
||||
|
||||
method parse*(r: TXTRecord, data: StringStream) =
|
||||
r.length = data.readUint8()
|
||||
r.data = data.readStr(r.length.int)
|
||||
var bytesLeft = r.rdlength.int
|
||||
while bytesLeft > 0:
|
||||
let length = data.readUint8()
|
||||
r.strings.add(data.readStr(length.int))
|
||||
bytesLeft -= length.int + 1
|
||||
|
2
vendor/dnsclient.nim/tests/test1.nim
vendored
2
vendor/dnsclient.nim/tests/test1.nim
vendored
@ -25,7 +25,7 @@ test "query TXT":
|
||||
let resp = client.sendQuery("txt.example.huy.im", TXT)
|
||||
assert resp.answers[0].kind == TXT
|
||||
let rr = TXTRecord(resp.answers[0])
|
||||
assert rr.data == "dnsclient.nim"
|
||||
assert rr.strings == @["dnsclient.nim"]
|
||||
|
||||
test "query MX":
|
||||
let resp = client.sendQuery("mx.example.huy.im", MX)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# libtool - Provide generalized library-building support services.
|
||||
# Generated automatically by config.status (libbacktrace) version-unused
|
||||
# Libtool was configured on host fv-az128-156:
|
||||
# Libtool was configured on host fv-az208-167:
|
||||
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
||||
#
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||
|
Loading…
x
Reference in New Issue
Block a user