upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/btfrv.cpp
diff options
context:
space:
mode:
authorbitflash <admin@bitflash.network>2026-08-12 10:31:29 -0300
committerbitflash <admin@bitflash.network>2026-08-12 10:31:29 -0300
commitc8d798807e69ddbe55bfab8a34286ab75b786cb5 (patch)
tree81b5d44e5193f220b64097f496e314e04caf2db8 /src/btfrv.cpp
parentc5f6b52c0d1d65f7bf8cd745a7a212bc6b2fe318 (diff)
parentd0ebe648f333def99fababd65f6b929448616d56 (diff)
test merge
# Conflicts: # src/makefile.mingw
Diffstat (limited to 'src/btfrv.cpp')
-rw-r--r--src/btfrv.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/btfrv.cpp b/src/btfrv.cpp
index 6ac3280..d4f079f 100644
--- a/src/btfrv.cpp
+++ b/src/btfrv.cpp
@@ -5,6 +5,9 @@
5// Windows/Winsock implementation (Layer 6 will #ifdef this for Linux/BSD sockets). 5// Windows/Winsock implementation (Layer 6 will #ifdef this for Linux/BSD sockets).
6 6
7#include "btfrv.h" 7#include "btfrv.h"
8#ifdef BITFLASH_NODE_BUILD
9#include "proxy.h"
10#endif
8 11
9// Portable sockets: Winsock on Windows, BSD sockets on Linux/POSIX (for the 12// Portable sockets: Winsock on Windows, BSD sockets on Linux/POSIX (for the
10// headless relay `bitflashd` that runs on the VPS). 13// headless relay `bitflashd` that runs on the VPS).
@@ -92,6 +95,11 @@ static bool WriteN(SOCKET s, const void* buf, int n)
92 95
93static SOCKET ConnectTo(const char* host, unsigned short port) 96static SOCKET ConnectTo(const char* host, unsigned short port)
94{ 97{
98#ifdef BITFLASH_NODE_BUILD
99 SOCKET s = BtfConnectSocket(host, port, SOCK_RV_DIAL, 10);
100 if (s == INVALID_SOCKET)
101 return INVALID_SOCKET;
102#else
95 struct addrinfo hints, *res = NULL; 103 struct addrinfo hints, *res = NULL;
96 memset(&hints, 0, sizeof(hints)); 104 memset(&hints, 0, sizeof(hints));
97 hints.ai_family = AF_INET; 105 hints.ai_family = AF_INET;
@@ -119,6 +127,7 @@ static SOCKET ConnectTo(const char* host, unsigned short port)
119 CLOSESOCK(s); freeaddrinfo(res); return INVALID_SOCKET; 127 CLOSESOCK(s); freeaddrinfo(res); return INVALID_SOCKET;
120 } 128 }
121 freeaddrinfo(res); 129 freeaddrinfo(res);
130#endif
122 131
123 // Clear the timeout -- the socket is now a live tunnel and must not 132 // Clear the timeout -- the socket is now a live tunnel and must not
124 // time out when idle. recv() will block until data arrives or peer closes. 133 // time out when idle. recv() will block until data arrives or peer closes.