SSH driver bug fix on buffer size#142
SSH driver bug fix on buffer size#142LeandroMartinsdS merged 1 commit intoDiamondLightSource:dls-masterfrom
Conversation
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.
|
I checked that pull request #108 is doing something similar on line 483, but it uses |
|
Sorry for the long silence. I haven't had the chance of testing your changes yet, but they look reasonable. Your approach is more conservative, so I'm happy to merge your changes, while testing thoroughly what are the limitations. I expect to be merging early next week |
|
I finally got back to this. I'll go ahead and merge this PR, as it was already part of the roadmap. However, I’d like to document a few important points for future reference:
|
Hi there, Leandro!
At LNLS, we have a new project under development using deltatau with Pmac IOC. We noticed a problem when instantiating a dynamic variable with the .substitutions file (pmacVariableWrite.template).
To instantiate multiple variables, the
pmacCommandStore::buildCommandStringfunction generates an addition of 40 variables in a 1024 char. However, theSSHDriver::writefunction needs to perform an ECHO and the static buffer size is 512 char. If the buffer size passed toSSHDriver::writeis greater than 512 char, an error is accused in the function (no match), generating a false error of connection loss and reconnection with the deltatau controller.To solve the problem, I changed the buffer size to 2048 char, following the same pattern as the rest of the sshDriver.cpp code.
I am attaching the replacements file for you to reproduce the same problem with the current version.
mgn-b-pb08.substitutions.txt