fix headers

pull/35/head
Jeff Becker 6 years ago
parent 18e24582d6
commit 4411d85040
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -0,0 +1,30 @@
#ifndef sodium_core_H
#define sodium_core_H
#include <sodium/export.h>
#ifdef __cplusplus
extern "C"
{
#endif
SODIUM_EXPORT
int
sodium_init(void) __attribute__((warn_unused_result));
/* ---- */
SODIUM_EXPORT
int
sodium_set_misuse_handler(void (*handler)(void));
SODIUM_EXPORT
void
sodium_misuse(void) __attribute__((noreturn));
#ifdef __cplusplus
}
#endif
#endif

@ -3,12 +3,20 @@
#include <llarp/bencode.h>
#include <llarp/crypto.h>
#include <sodium.h>
#include <iomanip>
#include <iostream>
#include <llarp/encode.hpp>
#include <llarp/logger.hpp>
extern "C"
{
extern void
randombytes(unsigned char* const ptr, unsigned long long sz);
extern void
sodium_memzero(void* const ptr, const size_t sz);
extern int
sodium_is_zero(const unsigned char* ptr, size_t sz);
}
namespace llarp
{
/// aligned buffer, aligns to the nears Long_t

@ -856,6 +856,7 @@ namespace llarp
{
llarp::LogError(Name(), " failed to lookup ", addr.ToString(), " from ",
endpoint);
m_ServiceLookupFails[endpoint] += 1;
auto itr = m_PendingServiceLookups.find(addr);
if(itr != m_PendingServiceLookups.end())
{
@ -863,7 +864,6 @@ namespace llarp
m_PendingServiceLookups.erase(itr);
func(addr, nullptr);
}
m_ServiceLookupFails[endpoint] += 1;
return false;
}
PutNewOutboundContext(*introset);
@ -903,6 +903,7 @@ namespace llarp
return false;
}
}
m_PendingServiceLookups.insert(std::make_pair(remote, hook));
{
RouterID endpoint = path->Endpoint();

@ -2,6 +2,8 @@
#include <llarp/service/Info.hpp>
#include <llarp/service/address.hpp>
#include "buffer.hpp"
#include <sodium/crypto_generichash.h>
namespace llarp
{
namespace service

Loading…
Cancel
Save