From 91406ef843268622a90897c976dc7123ac27039f Mon Sep 17 00:00:00 2001 From: Guilherme Rodrigues de Lima Date: Wed, 2 Jul 2025 13:25:43 -0300 Subject: [PATCH] SSH driver bug fix on buffer size. To instantiate multiple variables, the pmacCommandStore::buildCommandString function generates an addition of 40 variables in a 1024 char. However, the SSHDriver::write function needs to perform an ECHO and the static buffer size is 512 char. If the buffer size passed to SSHDriver::write is greater than 512 char, an error is generated in the function (no match), generating a false error of connection loss and reconnection with the deltatau controller. To solve the problem, the buffer size was changed to 2048 char. --- pmacApp/powerPmacAsynPortSrc/sshDriver.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmacApp/powerPmacAsynPortSrc/sshDriver.cpp b/pmacApp/powerPmacAsynPortSrc/sshDriver.cpp index 6957a706..42a960eb 100755 --- a/pmacApp/powerPmacAsynPortSrc/sshDriver.cpp +++ b/pmacApp/powerPmacAsynPortSrc/sshDriver.cpp @@ -441,14 +441,14 @@ SSHDriverStatus SSHDriver::write(const char *buffer, size_t bufferSize, size_t * // Now we need to read back the same numer of bytes, to remove the written string from the buffer int bytesToRead = *bytesWritten; int bytes = 0; - char buff[512]; + char buff[2048]; rc = 0; int crCount = 0; // Count the number of \n characters sent // Build the expected ECHO string - char expected_response[512]; - memset(expected_response, 0, 512); + char expected_response[2048]; + memset(expected_response, 0, 2048); int expected_index = 0; for (int index = 0; index < (int)*bytesWritten; index++){ if (buffer[index] == '\n'){