summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* [SHARED] Add sockaddr2dnbd3 func, add multiConnect func, EINTR handlingSimon Rettberg2017-11-062-30/+141
| | | | | | | | | | EINTR was apparently not handled properly on non-linux for the connect() syscall. sockaddr2dnbd3 is what resolveToDnbd3Host already did internally, now it's its own function. sock_multiConnect() is a wrapper around connect() and poll, making it easy to connect to multiple hosts in a cascaded manner, with a slight delay between connect calls.
* [FUSE] Remember up to 16 alt servers, but work only with 5Simon Rettberg2017-11-041-8/+59
| | | | | | | 5 servers are considered "active", that is, are being measured for their RTT regularly. If We have more than 5 servers and one of the active ones isn't reachable repeatedly, the two servers will swap position.
* [SERVER] Support finer control over replication when a proxy connects to a proxySimon Rettberg2017-11-026-4/+39
| | | | | | | Introduce new flag in "select image" message to tell the uplink server whether we have background replication enabled or not. Also reject a connecting proxy if the connecting proxy uses BGR but we don't, as this would basically force the image to be replicated locally too.
* [FUSE] Fix printf warning for logadd callSimon Rettberg2017-11-021-1/+1
|
* [SERVER] Add --errormsg to only serve HTTP-JSON error codeSimon Rettberg2017-11-023-29/+65
| | | | | This could have been an external tool, but this didn't add much code and has the benefit of honoring the config file for port and bind address.
* [SERVER] Ignore invalid basePath in globals.c, do bailout in server.cSimon Rettberg2017-11-021-9/+12
|
* [SERVER] Clean up arguments, show version on startupSimon Rettberg2017-11-021-13/+8Star
|
* [SERVER] rpc: Keep track of and cap number of active http sessionsSimon Rettberg2017-11-011-11/+57
|
* [SERVER] rpc: Remove old TODO, set thread name for persistent connectionsSimon Rettberg2017-11-011-1/+5
|
* [SERVER] Since fuse client assumed no backwards compat before v3, lie to clientsSimon Rettberg2017-11-011-1/+1
| | | | | | If client reports protocol version < 3 on connect, just pretend we're at the same version. This sucks but we can't update servers before clients otherwise. :(
* [FUSE] Improve log messages a bitSimon Rettberg2017-11-011-2/+5
|
* [*] Mark logadd() as printf-style function, fix errors that it revealedSimon Rettberg2017-10-317-11/+13
| | | | ...there were quite a few format string errors as it turns out :/
* [SERVER] net.c: Refactoring and renamingSimon Rettberg2017-10-311-58/+33Star
| | | | | | Less copy & paste for sendfile alternatives, changed naming of old dnbd3_* functions moved over from server.c a while ago.
* [SERVER] Image list private to image.cSimon Rettberg2017-10-312-5/+2Star
|
* [SERVER] rpc: encoding of our reply is utf-8, add to reply headerSimon Rettberg2017-10-301-1/+1
|
* [SERVER] Add AFL supportSimon Rettberg2017-10-306-4/+95
| | | | | | | | | | | AFL is an instrumenting fuzzer. It expects to pass input to the program to be tested via command line (file name) or via stdin. This adds support for reading messages that normally would arrive via network directly from stdin. In this mode, the server is pretty useless otherwise. http://lcamtuf.coredump.cx/afl/
* [SERVER] Missed occurence of AF_INET(6) -> HOST_IP[46]Simon Rettberg2017-10-301-3/+6
|
* [BENCH] Fix compileSimon Rettberg2017-10-301-0/+1
|
* [SERVER] rpc: Honor client's Connection header, add some commentsSimon Rettberg2017-10-301-35/+106
|
* [SERVER] Don't send error 500 to client on local connection timeoutSimon Rettberg2017-10-301-1/+3
|
* [*] Introduce constants for IPv4/6 in dnbd3_host_tSimon Rettberg2017-10-2810-46/+52
| | | | | | | AF_INET luckily was "2" on all platforms checked, so no problems there with interoperation, but AF_INET6 is different between Linux, BSD, Windows and possibly others, so map back and forth between AF_INET/AF_INET6 and HOST_IP4/HOST_IP6 to fix this.
* [SERVER] Add function to parse x-www-form-urlencoded stringsSimon Rettberg2017-10-284-26/+126
| | | | | | Use it to properly parse RPC queries. Will also come in handy when parsing POST body for calls that actually trigger any actions in the server (reload, alt-servers, ...)
* [SERVER] Use picohttpparser from h2oSimon Rettberg2017-10-264-48/+884
| | | | | | | Simple and lean interface, no bloat, noice. Slighly modified to use a simple string struct for passing around strings that are not null terminated, instead of separate char* and length.
* [SERVER] net: Simplify check for HTTPSimon Rettberg2017-10-261-10/+11
| | | | | Pretty loose guesswork, but preventing the false positives would not lead to any meaningful result anyways, so why bother.
* [SERVER] Rename missing occurence of ret, possibly leading to infinite loop :(Simon Rettberg2017-10-261-1/+1
|
* [SERVER] uplink: Fix updating of global byte counter, fix incremental updatesSimon Rettberg2017-10-251-2/+7
| | | | | Incremental updating of the global byte counter would only work when background replication is disabled. Fix this.
* [SERVER] Only start reloading images if no other reload is in progressSimon Rettberg2017-10-251-4/+12
|
* [SERVER] Improve handling of byte stats countersSimon Rettberg2017-10-253-19/+29
| | | | Less writes to variables, more up-to-date values for uplinks.
* [SERVER] Improve altserver handling and selectionSimon Rettberg2017-10-251-26/+41
| | | | | | We order the list so that servers that fail are kept at the end of the list. This is so that when we fetch servers for RTT measurement, we're less likely to pick those.
* [FUSE] Cache signalfd instances used in fuse read handlerSimon Rettberg2017-10-241-2/+43
| | | | | | Previously, a fresh one was created and destroyed fo every read requests. This caused a lot of syscalls when reading. Now there's a simple cache of currently up to 6 signalfd.
* [FUSE] Spacing; Don't check if server proto is newer than clientSimon Rettberg2017-10-241-3/+3
| | | | | | | The server is always backwards compatible, and so should be the client. If support for an older version will not be kept up, MIN_SUPPORTED_{CLIENT,SERVER} will be increased accordingly so that the connection is dropped.
* [FUSE] Fix type mismatch warningsSimon Rettberg2017-10-243-18/+37
|
* [SERVER] Initialize PRNGSimon Rettberg2017-10-242-0/+2
|
* [SERVER] Get rid of zlib dependencySimon Rettberg2017-10-244-19/+649
| | | | | | We only used it for CRC-32, so now the source tree includes a stripped down version of the crc32 code from the zlib project.
* [SERVER] Fix types or add explicit casts everywhere we might have type ↵Simon Rettberg2017-10-2416-110/+120
| | | | conversion problems
* [SERVER] Properly support passing negative values to timing_gets()Simon Rettberg2017-10-201-1/+1
|
* [SERVER] Mute signedness warning on 32bitSimon Rettberg2017-10-201-2/+2
|
* [SERVER] Use monotonic clock for measuring timeSimon Rettberg2017-10-1910-74/+264
| | | | | Introduces new shared source unit timing.[ch] Closes #3214
* [SERVER] More tweaks to alt-server selection wrt proxy cyclesSimon Rettberg2017-10-181-4/+9
| | | | | This needs an overhaul; status needs to be moved from global alt-servers list to individual uplinks
* [SERVER] Don't try to load metadata files as images; fix clang-analyzer ↵Simon Rettberg2017-10-182-15/+36
| | | | false positives
* [SERVER] Try to connect to different server if proxy cycle is detectedSimon Rettberg2017-10-174-9/+34
|
* [*] Support hop-counting in request header, protocol version 3Simon Rettberg2017-10-1710-45/+101
| | | | | | | | | | | | | | We steal 8 bits from the request offset to count hops when requests get relayed by proxies. This still leaves plenty of bits for the offset (56 bits, supporting images of up to 72 petabytes). This is used to detect proxy cycles. The algorithm is not perfect but should prevent endless relays of the same request. This is backwards compatible to old clients and servers, as the server only ever sets the hopcount in relayed requests if the upstream server is using protocol version 3 or newer, and clients are automatically upwards compatible as there is practically no image larger than 74PB, so the newly introduced hop count field is always 0 even in requests from old clients.
* [SERVER] rpc: Support querying storage size + available spaceSimon Rettberg2017-10-114-9/+27
|
* [KERNEL] version check to support pointer to backing_dev_info in request_queueSimon Rettberg2017-10-091-0/+6
| | | | | This changed in 4.11, see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc3b17cc8bf21307c7e076e7c778d5db756f7871
* [SERVER] Fix invalid pointer derefSimon Rettberg2017-10-061-1/+1
|
* [SERVER] rpc: Return a unique id generated at startup with each replySimon Rettberg2017-10-061-4/+19
|
* [SERVER] Return client count when requesting stats but not client listSimon Rettberg2017-10-062-4/+14
|
* [SERVER] rpc: Fix bitmask calc for odd subnet sizes (not 8, 16, ...)Simon Rettberg2017-10-041-1/+1
|
* [SERVER] How about updating atime on connect?Simon Rettberg2017-10-041-0/+3
|
* [SERVER] Implement HTTP RPC that supports different queries and ACLSimon Rettberg2017-10-015-45/+264
| | | | | | | | | - ACL is defined in new file rpc.acl - Queries are still WIP, for now something like /query?q=stats&q=images /query?q=clients works, although the parsing is still ugly - Also supports HTTP keep-alive