summaryrefslogtreecommitdiffstats
path: root/src/shared
Commit message (Collapse)AuthorAgeFilesLines
* [SHARED] sock_printable: Always null-terminateSimon Rettberg2023-02-121-1/+4
|
* [BUILD] Add check for stdatomic.h supportManuel Bentele2021-06-161-0/+4
|
* [KERNEL] Removes duplicate word 'of' in license headersManuel Bentele2021-04-161-1/+1
|
* [SERVER] Set TCP_NODELAY on outgoing connectionsSimon Rettberg2021-04-141-1/+4
| | | | | | | This will send all (block) requests immediately at sometimes more overhead, but slighly less delays. Since the outgoing connection on a client is only used very lightly, this tradeoff should always make sense.
* [KERNEL] Refactor code to satisfy Linux kernel code styleManuel Bentele2021-03-121-11/+27
|
* [BUILD] Add support in CMake to validate (lint) the source codeManuel Bentele2021-03-041-6/+14
|
* [BUILD] remove the build requirement for an unused C++ compilerManuel Bentele2020-10-271-1/+2
| | | | | This patch sets the programming languages of each CMake project to C. With this change, CMake does not search for an unused C++ compiler anymore.
* [BUILD] add option to build the dnbd3-server with afl-fuzz supportManuel Bentele2020-10-201-11/+21
| | | | | The afl-fuzz support for the dnbd3-server requires an AFL C compiler like afl-gcc and can be enabled with the CMake option DNBD3_SERVER_AFL.
* [BUILD] fixes issues to build user space programs on FreeBSD 12.1Manuel Bentele2020-10-192-2/+2
|
* [BUILD] rewrite CMake build system to track changes of source filesManuel Bentele2020-10-1613-587/+111Star
| | | | | | | | | | This change restructures the source code directories, separates shared form non-shared application code and adds CMake dependencies. These dependencies allow the tracking of changes and trigger a rebuild of those build targets where changed files are involved. WARNING: Note that the support of the DNBD3_SERVER_AFL build option is not supported yet. Thus, the option should be never turned on.
* Merge branch 'no-working-flag' into fuse_llSimon Rettberg2020-07-275-60/+194
|\
| * [SHARED] Fix 16 byte information leakage in select image messageSimon Rettberg2020-06-301-2/+0Star
| |
| * [SHARED] connect_ms might change above, don't checkSimon Rettberg2020-03-231-1/+1
| |
| * [SHARED] crc32: Don't skip table lookup if PCLMUL is unavailableSimon Rettberg2020-03-191-12/+13
| |
| * [SERVER] crc32: Fix compile with optimizationsSimon Rettberg2020-03-191-2/+2
| | | | | | | | | | Should have tested in "Release" mode I guess. Seems we're at about 24x performance this way, so hooray.
| * [SERVER] Use PCLMUL for crc32 on AMD64 if availableSimon Rettberg2020-03-191-47/+174
| | | | | | | | | | | | | | This is about 16x as fast as before with the lookup table for processing 4 bytes at a time and should work on any AMD64 CPU made in the last decade. We still need an AltiVec implementation for G5 though.
| * [*] Fix/simplify checks for linuxSimon Rettberg2019-09-171-1/+1
| |
| * [SERVER] Fix compiler warningsSimon Rettberg2019-09-021-1/+1
| |
| * [SERVER] Introduce debug spamSimon Rettberg2019-08-301-1/+1
| |
| * [SHARED] Better errno handling in connect() helperSimon Rettberg2019-08-151-0/+8
| |
* | [SHARED] Fix: connect with timeout returns socket handle on EINPROGRESSSimon Rettberg2020-07-211-1/+1
|/ | | | | | Only if we request non-blocking connect (connect_ms == -1) this function should return a socket fd that is not actually connected. Otherwise, consder this a failure, close the sock fd, and return -1.
* [SERVER] Add pretendClient config optionSimon Rettberg2019-07-231-1/+1
| | | | | | This makes the server not set the FLAGS8_SERVER flag when establishing an uplink connection. Useful mostly for running a proxy on localhost for local caching.
* [SHARED] More timing helpersSimon Rettberg2019-02-091-0/+23
|
* [SERVER] Only set BGR flag in handshake for BGR_FULLSimon Rettberg2018-11-161-1/+1
| | | | | | | _backgroundReplication was still treated as a boolean flag, so a server with BGR_NONE would reject a server with BGR_HASHBLOCK. While this still forces the BGR_NONE proxy to replicate more than it normally would, it seems reasonable to allow this.
* [SHARED] Use atomic for logger maskSimon Rettberg2018-08-081-2/+2
|
* [SERVER] Refactor uplink/cache handling, improve crc checkingSimon Rettberg2018-07-041-1/+1
| | | | | | | | | | | | | The cacheFd is now moved to the uplink data structure and will only be handled by the uplink thread. The integrity checker now supports checking all blocks of an image. This will be triggered automatically whenever a check for a single block failed. Also, if a crc check on startup fails, the image won't be discarded anymore, but rather a full check will be initiated. Furthermore, when calling image_updateCacheMap() on an image that was previously complete, the cache map will now be re-initialized, and a new uplink connection created.
* [SERVER] Option to disable timestamps on stdout/console (default: disabled)Simon Rettberg2018-04-112-8/+27
|
* [SHARED] Reset errnoSimon Rettberg2018-04-051-0/+2
|
* [SERVER] rpc: Add q=logfile, q=altservers and q=config to /querySimon Rettberg2017-11-082-8/+7Star
|
* [SHARED] Add log_hasMask() to check if a certain loglevel is setSimon Rettberg2017-11-072-0/+11
|
* [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.
* [SERVER] Support finer control over replication when a proxy connects to a proxySimon Rettberg2017-11-021-0/+6
| | | | | | | 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.
* [*] Mark logadd() as printf-style function, fix errors that it revealedSimon Rettberg2017-10-312-2/+3
| | | | ...there were quite a few format string errors as it turns out :/
* [SERVER] Add AFL supportSimon Rettberg2017-10-301-0/+5
| | | | | | | | | | | 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/
* [*] Introduce constants for IPv4/6 in dnbd3_host_tSimon Rettberg2017-10-281-7/+6Star
| | | | | | | 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] Rename missing occurence of ret, possibly leading to infinite loop :(Simon Rettberg2017-10-261-1/+1
|
* [SERVER] Get rid of zlib dependencySimon Rettberg2017-10-242-0/+630
| | | | | | 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-245-22/+26
| | | | conversion problems
* [SERVER] Properly support passing negative values to timing_gets()Simon Rettberg2017-10-201-1/+1
|
* [SERVER] Use monotonic clock for measuring timeSimon Rettberg2017-10-192-0/+160
| | | | | Introduces new shared source unit timing.[ch] Closes #3214
* [*] Support hop-counting in request header, protocol version 3Simon Rettberg2017-10-171-1/+7
| | | | | | | | | | | | | | 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.
* [*] constness for sock_sendAll paramsSimon Rettberg2017-10-012-3/+3
|
* [SERVER] Fix formattingSimon Rettberg2016-03-221-1/+1
|
* dnbd3server build success on freebsd :)Sebastian2016-02-111-3/+6
|
* cleanup commitsSebastian2016-02-113-8/+1Star
|
* [SHARED] signal.h -> fdsignal.hSimon Rettberg2016-02-105-6/+6
|
* dfskljgdslkfsdklgjSimon Rettberg2016-02-051-3/+3
|
* [SHARED] Fix linux detection on clangSimon Rettberg2016-02-051-4/+4
|
* [SHARED] Implement pipe() based signallingSimon Rettberg2016-02-054-71/+261
|
* First steps in make signals more abstract from the underlying mechanism; ↵Simon Rettberg2016-02-052-21/+52
| | | | | | | | | | replace epoll with poll. We now don't assume that a signal equals a single fd (eventfd on Linux). The next step would be to create a version of signal.c that uses a pipe internally, so it can be used on other platforms, like *BSD. This is also the reason epoll was replaced with poll in uplink.c