Mods to improve stability for Zephora.

This commit is contained in:
Brad Arant committed 2022-03-14 18:48:58 +00:00
1 parent d13e3f9fb5
commit 03a3799888
7 files changed
+47 -30

No files matched your search

+5 -3
View File
@@ -6,6 +6,8 @@
namespace core {
void sigpipe_handler(int unused) {}
Socket::Socket(EPoll &ePoll, std::string text) : ePoll(ePoll), text(text) {
coreutils::Log(coreutils::LOG_DEBUG_2) << "Socket object created [" << text << "].";
buffer = (char *)malloc(4096);
@@ -110,7 +112,7 @@ namespace core {
if((len = ::read(getDescriptor(), buffer.getData(), buffer.getLength())) >= 0) {
coreutils::ZString zbuffer(buffer.getData(), len);
// coreutils::Log(coreutils::LOG_DEBUG_1) << zbuffer;
coreutils::Log(coreutils::LOG_DEBUG_1) << zbuffer;
onDataReceived(zbuffer);
}
else {
@@ -140,8 +142,8 @@ namespace core {
outlock.lock();
::write(descriptor, fifo.front().c_str(), fifo.front().length());
fifo.pop();
if(shutDown && !needsToWrite())
delete this;
// if(shutDown && !needsToWrite())
// delete this;
outlock.unlock();
}
}