summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-02-18 15:21:35 +0200
committerTimo Teräs <timo.teras@iki.fi>2020-02-18 15:36:01 +0200
commit271047cc930150a2972573625124b0c097ad322a (patch)
tree633040a5555b10ed9f05595ebf59bf194ba521ed /src
parent3694dc5fa2660e2b241d706ec1672beb0a9c24b8 (diff)
downloadapk-tools-271047cc930150a2972573625124b0c097ad322a.tar.gz
apk-tools-271047cc930150a2972573625124b0c097ad322a.tar.bz2
apk-tools-271047cc930150a2972573625124b0c097ad322a.tar.xz
apk-tools-271047cc930150a2972573625124b0c097ad322a.zip
libfetch: support TCP_CORK
Unfortunately libfetch operates on raw sockets and is sending each HTTP request line using separate syscall which causes the HTTP request to be sent as multiple packets over the wire in most configurations. This is not good for performance, but can also cause subtle breakage if there's DPI firewall that does not get the Host header. Incidentally, it seems that on BSDs libfetch already sets TCP_NOPUSH optimize the packetization. This commit adds same logic for using TCP_CORK if available. When using TCP_CORK there is no requirement to set TCP_NODELAY as uncorking will also cause immediate send. Keep TCP_NODELAY in the fallback codepaths. Long term, it might make sense to replace or rewrite libfetch to use application level buffering.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions