mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
Enable rhizome HTTP transfers over loopback while using local sockets
This commit is contained in:
parent
b066aafe62
commit
6b17cd580f
@ -290,7 +290,15 @@ int overlay_rhizome_saw_advertisements(struct decode_context *context, struct ov
|
||||
RETURN(0);
|
||||
|
||||
int ad_frame_type=ob_get(f->payload);
|
||||
struct socket_address httpaddr = context->addr;
|
||||
struct socket_address httpaddr;
|
||||
if (context->addr.addr.sa_family == AF_UNIX){
|
||||
// try loopback http connections while testing with local sockets
|
||||
httpaddr.inet.sin_family=AF_INET;
|
||||
httpaddr.inet.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||
httpaddr.addrlen = sizeof(httpaddr.inet);
|
||||
}else{
|
||||
httpaddr=context->addr;
|
||||
}
|
||||
if (httpaddr.addr.sa_family == AF_INET)
|
||||
httpaddr.inet.sin_port = htons(HTTPD_PORT);
|
||||
rhizome_manifest *m=NULL;
|
||||
|
@ -36,7 +36,7 @@ teardown() {
|
||||
|
||||
# Called by start_servald_instances for each instance.
|
||||
configure_servald_server() {
|
||||
add_servald_interface --file
|
||||
add_servald_interface
|
||||
executeOk_servald config \
|
||||
set log.console.level debug \
|
||||
set log.console.show_pid on \
|
||||
|
@ -44,8 +44,7 @@ configure_servald_server() {
|
||||
set debug.httpd off \
|
||||
set debug.rhizome_tx off \
|
||||
set debug.rhizome_rx off \
|
||||
set server.respawn_on_crash off \
|
||||
set mdp.iftype.wifi.tick_ms 500
|
||||
set server.respawn_on_crash off
|
||||
}
|
||||
|
||||
doc_StressRhizomeTransfer="Five nodes each sharing 26 bundles from 0B to 620K"
|
||||
@ -73,19 +72,8 @@ setup_StressRhizomeTransfer() {
|
||||
done
|
||||
}
|
||||
|
||||
start_instance() {
|
||||
executeOk_servald config \
|
||||
set server.interface_path "$SERVALD_VAR" \
|
||||
set interfaces.0.file dummy \
|
||||
set interfaces.0.dummy_address 127.0.0.$instance_number \
|
||||
set interfaces.0.dummy_netmask 255.255.255.224
|
||||
start_servald_server
|
||||
}
|
||||
|
||||
test_StressRhizomeTransfer() {
|
||||
>$SERVALD_VAR/dummy
|
||||
foreach_instance +A +B +C +D +E \
|
||||
start_instance
|
||||
start_servald_instances +A +B +C +D +E
|
||||
wait_until --timeout=600 bundle_received_by \
|
||||
${bundlesA[*]} +B +C +D +E \
|
||||
${bundlesB[*]} +A +C +D +E \
|
||||
|
Loading…
x
Reference in New Issue
Block a user