mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-25 15:41:26 +00:00
#3 fixed last test, added A char
This commit is contained in:
parent
79f9940b83
commit
71e9359ed0
|
@ -113,11 +113,9 @@ START_TEST(test_encode_query)
|
||||||
{
|
{
|
||||||
char buf[512];
|
char buf[512];
|
||||||
char resolv[512];
|
char resolv[512];
|
||||||
char *host = "kryo.se";
|
|
||||||
struct query q;
|
struct query q;
|
||||||
char *d;
|
char *d;
|
||||||
int len;
|
int len;
|
||||||
int pos;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
len = sizeof(buf);
|
len = sizeof(buf);
|
||||||
|
@ -128,13 +126,13 @@ START_TEST(test_encode_query)
|
||||||
q.id = 1337;
|
q.id = 1337;
|
||||||
d = resolv;
|
d = resolv;
|
||||||
|
|
||||||
|
*d++ = 'A';
|
||||||
encode_data(queryData, strlen(queryData), 100, d);
|
encode_data(queryData, strlen(queryData), 100, d);
|
||||||
pos = strlen(resolv);
|
d = resolv + strlen(resolv);
|
||||||
d += pos;
|
|
||||||
if (*d != '.') {
|
if (*d != '.') {
|
||||||
*d++ = '.';
|
*d++ = '.';
|
||||||
}
|
}
|
||||||
strncpy(d, host, strlen(host)+1);
|
strcpy(d, topdomain);
|
||||||
ret = dns_encode(buf, len, &q, QR_QUERY, resolv, strlen(resolv));
|
ret = dns_encode(buf, len, &q, QR_QUERY, resolv, strlen(resolv));
|
||||||
len = sizeof(queryPacket) - 1; // Skip extra null character
|
len = sizeof(queryPacket) - 1; // Skip extra null character
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue