mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 23:35:41 +00:00
ignore SIGPIPE in sendfile() implementation of mod sending
This commit is contained in:
parent
b097acfd4a
commit
8b753ab6ea
@ -816,10 +816,12 @@ const uint8_t* /* end ptr */ TNetwork::SendSplit(TClient& c, ip::tcp::socket& So
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <sys/sendfile.h>
|
#include <sys/sendfile.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
void TNetwork::SplitLoad(TClient& c, size_t Offset, size_t End, bool D, const std::string& Name) {
|
void TNetwork::SplitLoad(TClient& c, size_t Offset, size_t End, bool D, const std::string& Name) {
|
||||||
TScopedTimer timer(fmt::format("Download of {}-{} for '{}'", Offset, End, Name));
|
TScopedTimer timer(fmt::format("Download of {}-{} for '{}'", Offset, End, Name));
|
||||||
#if defined(BEAMMP_LINUX)
|
#if defined(BEAMMP_LINUX)
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
// on linux, we can use sendfile(2)!
|
// on linux, we can use sendfile(2)!
|
||||||
int fd = ::open(Name.c_str(), O_RDONLY);
|
int fd = ::open(Name.c_str(), O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user