fix some compiler errors

pull/1576/head
Jeff Becker 3 years ago
parent b721b8d65b
commit f63122272d
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -50,8 +50,10 @@ extern "C"
/// if srv is not NULL add an srv record for this port, the format being "thingservice" in which
/// will add a srv record "_udp.thingservice.ouraddress.tld" that advertises this port provide
/// localAddr to forward inbound udp packets to "ip:port" if localAddr is NULL then the resulting
/// socket MUST be drained by lokinet_udp_recvmmsg returns 0 on success returns nonzero on error
/// in which it is an errno value
/// socket MUST be drained by lokinet_udp_recvmmsg
///
/// returns 0 on success
/// returns nonzero on error in which it is an errno value
int
lokinet_udp_bind(
int exposedPort,
@ -61,10 +63,15 @@ extern "C"
struct lokinet_context* ctx);
/// poll many udp sockets for activity
/// each pollfd.fd should be set to the udp socket id
/// returns 0 on sucess
///
/// returns non zero errno on error
int
lokinet_udp_poll(struct pollfd* poll, nfds_t numsockets, struct lokinet_context* ctx);
lokinet_udp_poll(
const int* socket_ids,
size_t numsockets,
const struct timespec* timeout,
struct lokinet_context* ctx);
struct lokinet_udp_pkt
{
@ -76,7 +83,10 @@ extern "C"
/// analog to recvmmsg
ssize_t
lokinet_udp_recvmmsg(
int socket_id, struct lokinet_udp_pkt* pkts, size_t numevents, struct lokient_context* ctx);
int socket_id,
struct lokinet_udp_pkt* events,
size_t max_events,
struct lokient_context* ctx);
#ifdef __cplusplus
}

@ -126,13 +126,13 @@ namespace
return -1;
}
lokinet_srv_record
std::optional<lokinet_srv_record>
SRVFromData(const llarp::dns::SRVData& data, std::string name)
{
// TODO: implement me
(void)data;
(void)name;
return {};
return std::nullopt;
}
} // namespace
@ -157,10 +157,11 @@ struct lokinet_srv_lookup_private
return;
}
ep->LookupServiceAsync(host, service, [self, &promise, host](auto results) {
// for (const auto& result : results)
// {
// self->results.emplace_back(SRVFromData(result, host));
// }
for (const auto& result : results)
{
if (auto maybe = SRVFromData(result, host))
self->results.emplace_back(*maybe);
}
promise.set_value(0);
});
});

Loading…
Cancel
Save