aboutsummaryrefslogtreecommitdiffstats
path: root/core/subsurface-string.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-04-10 18:03:08 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-04-19 12:51:01 -0700
commit7fa031b648fedeaa35eb4da8003cd521cf65c4e3 (patch)
treedfca701ab741656d823ce6157393d11dad9ca267 /core/subsurface-string.h
parente22b33795b5e0b101a744d03093278cf7991687a (diff)
downloadsubsurface-7fa031b648fedeaa35eb4da8003cd521cf65c4e3.tar.gz
cloudstorage: try to pick between multiple cloud servers
The backend infrastructure will soon be able to support more than one cloud server which automagically stay in sync with each other. One critical requirement for that to work is that once a session was started with one of the servers, the complete session happens with that server - we must not switch from server to server while doing a git transaction. To make sure that's the case, we aren't trying to use DNS tricks to make this load balancing scheme work, but instead try to determine at program start which server is the best one to use. Right now this is super simplistic. Two servers, one in the US, one in Europe. By default we use the European server (most of our users appear to be in Europe), but if we can figure out that the client is actually in the Americas, use the US server. We might improve that heuristic over time, but as a first attempt it seems not entirely bogus. The way this is implemented is a simple combination of two free webservices that together appear to give us a very reliable estimate which continent the user is located on. api.ipify.org gives us our external IP address ip-api.com gives us the continent that IP address is on If any of this fails or takes too long to respond, we simply ignore it since either server will work. One oddity is that if we decide to change servers we only change the settings that are stored on disk, not the runtime preferences. This goes back to the comment above that we have to avoid changing servers in mid sync. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurface-string.h')
0 files changed, 0 insertions, 0 deletions