Open mixi opened 3 years ago
I also now implemented the memory savings on glibc by requesting a reasonably small thread stack as proposed in #108.
it only receives 8 bytes on https://github.com/solusipse/fiche/pull/109/commits/f3c7a296d779935b39c9d5b7f9bb9b5208dc8c0b (tested on musl), no matter if -B
is set or not.
============================================================
[Fiche][STATUS] Sat Apr 3 10:09:30 2021
[Fiche][STATUS] Incoming connection from: 127.0.0.1 (localhost.localdomain).
[Fiche][STATUS] Received 8 bytes, saved to: hmxd.
============================================================
or it's still wip? @ me when you need me to test it.
@dashezup: That was me missing that sizeof(buffer)
was being used to determine the size of the buffer (works with a static buffer / a VLA, doesn't work with a dynamically allocated buffer). It should be fixed now.
Nice :+1: , I've tested https://github.com/solusipse/fiche/commit/fcfcff954d697fcfe03804a3acc7d83006d6ae45 on musl, it works properly, I can upload very huge text (like 1G, probably memory was full and can't add more in that case)
That was me changing the 16k of requested thread stack to the musl default of 128k. That should probably be safer and still less than the glibc default.
This fixes a segfault on musl libc with reasonable sized buffers, as musl's default thread stack size is quite small (128k since 1.1.21).
A similar bug exists on glibc with large enough buffers (reproducable with e.g. 16MB on my test system).
This fixes #108.