forked from agorise/c-ipfs
method signature changes
This commit is contained in:
parent
c0419f2424
commit
794217ed6c
3 changed files with 7 additions and 3 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "libp2p/net/p2pnet.h"
|
||||
#include "libp2p/utils/logger.h"
|
||||
#include "ipfs/core/api.h"
|
||||
#include "ipfs/importer/exporter.h"
|
||||
|
||||
pthread_mutex_t conns_lock;
|
||||
int conns_count;
|
||||
|
@ -629,8 +630,9 @@ int api_start (struct IpfsNode* local_node, int max_conns, int timeout)
|
|||
|
||||
struct MultiAddress* my_address = multiaddress_new_from_string(local_node->repo->config->addresses->api);
|
||||
|
||||
char* ip = multiaddress_ip(my_address);
|
||||
int port = multiaddress_port(my_address);
|
||||
char* ip = NULL;
|
||||
multiaddress_get_ip_address(my_address, &ip);
|
||||
int port = multiaddress_get_ip_port(my_address);
|
||||
|
||||
api_list.ipv4 = hostname_to_ip(ip); // api is listening only on loopback.
|
||||
api_list.port = port;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "libp2p/utils/vector.h"
|
||||
#include "libp2p/secio/secio.h"
|
||||
#include "libp2p/routing/dht_protocol.h"
|
||||
#include "ipfs/core/api.h"
|
||||
#include "ipfs/core/ipfs_node.h"
|
||||
#include "ipfs/exchange/bitswap/bitswap.h"
|
||||
#include "ipfs/journal/journal.h"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <pthread.h>
|
||||
#include "ipfs/core/ipfs_node.h"
|
||||
|
||||
#ifdef __x86_64__
|
||||
#define INT_TYPE uint64_t
|
||||
|
@ -67,5 +68,5 @@ struct s_request {
|
|||
void *api_connection_thread (void *ptr);
|
||||
void api_connections_cleanup (void);
|
||||
void *api_listen_thread (void *ptr);
|
||||
int api_start (uint16_t port, int max_conns, int timeout);
|
||||
int api_start (struct IpfsNode* local_node, int max_conns, int timeout);
|
||||
int api_stop (void);
|
||||
|
|
Loading…
Reference in a new issue