| @@ -446,6 +446,9 @@ struct CarlaPipeCommon::PrivateData { | |||||
| // read functions must only be called in context of idlePipe() | // read functions must only be called in context of idlePipe() | ||||
| bool isReading; | bool isReading; | ||||
| // print error only once | |||||
| bool lastMessageFailed; | |||||
| // common write lock | // common write lock | ||||
| CarlaMutex writeLock; | CarlaMutex writeLock; | ||||
| @@ -462,6 +465,7 @@ struct CarlaPipeCommon::PrivateData { | |||||
| pipeRecv(INVALID_PIPE_VALUE), | pipeRecv(INVALID_PIPE_VALUE), | ||||
| pipeSend(INVALID_PIPE_VALUE), | pipeSend(INVALID_PIPE_VALUE), | ||||
| isReading(false), | isReading(false), | ||||
| lastMessageFailed(false), | |||||
| writeLock(), | writeLock(), | ||||
| tmpBuf(), | tmpBuf(), | ||||
| tmpStr() | tmpStr() | ||||
| @@ -1040,10 +1044,20 @@ bool CarlaPipeCommon::_writeMsgBuffer(const char* const msg, const std::size_t s | |||||
| } CARLA_SAFE_EXCEPTION_RETURN("CarlaPipeCommon::writeMsgBuffer", false); | } CARLA_SAFE_EXCEPTION_RETURN("CarlaPipeCommon::writeMsgBuffer", false); | ||||
| if (ret == static_cast<ssize_t>(size)) | if (ret == static_cast<ssize_t>(size)) | ||||
| { | |||||
| if (pData->lastMessageFailed) | |||||
| pData->lastMessageFailed = false; | |||||
| return true; | return true; | ||||
| } | |||||
| if (! pData->lastMessageFailed) | |||||
| { | |||||
| pData->lastMessageFailed = true; | |||||
| fprintf(stderr, | |||||
| "CarlaPipeCommon::_writeMsgBuffer(..., " P_SIZE ") - failed with " P_SSIZE ", message was:\n%s", | |||||
| size, ret, msg); | |||||
| } | |||||
| fprintf(stderr, "CarlaPipeCommon::_writeMsgBuffer(..., " P_SIZE ") - failed with " P_SSIZE ". Message was:\n%s", | |||||
| size, ret, msg); | |||||
| return false; | return false; | ||||
| } | } | ||||