0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 16:04:15 +01:00

ircd::net::dns::resolver: Copy to preserve service string from hostport in tag.

This commit is contained in:
Jason Volk 2020-03-05 11:13:51 -08:00
parent fddeb548a7
commit 65d41d0093

View file

@ -108,18 +108,29 @@ struct ircd::net::dns::tag
uint rcode {0};
ipport server;
char hostbuf[rfc1035::NAME_BUFSIZE];
char servicebuf[256];
char qbuf[512];
tag(const hostport &hp, const dns::opts &opts)
:hp{hp}
,opts{opts}
{
this->hp.host = { hostbuf, copy(hostbuf, hp.host) };
this->hp.service = {};
}
tag(const hostport &hp, const dns::opts &opts);
tag(tag &&) = delete;
tag(const tag &) = delete;
tag &operator=(tag &&) = delete;
tag &operator=(const tag &) = delete;
};
inline
ircd::net::dns::tag::tag(const hostport &hp,
const dns::opts &opts)
:hp{hp}
,opts{opts}
{
this->hp.host =
{
hostbuf, copy(hostbuf, hp.host)
};
this->hp.service =
{
servicebuf, copy(servicebuf, hp.service)
};
}