Avoid redundant recursive calls in the socket data callback
Following up the discussion in #359 I looked up the history of the recursive call in ssh_packet_socket_callback(). It was required when it was originally added, but a later commit made it redundant by changing its caller to call it in a loop.
So this MR removes the recursive call.
Note that this change may potentially affect when rekeying is done when there are multiple packets in the socket buffer. This is because rekeying is only done after the recursive call. So without the change, rekeying will be done earliest when the last packet in the buffer has been recursively processed. With the change, it may happen earlier, possibly already after the first packet has been processed.
While doing this change, I also noticed an inconsistency in the return value of ssh_packet_socket_callback() when rekeying fails, which I addressed in a separate commit.
One final note: There is a direct call to ssh_packet_socket_callback() in the unit tests in torture_packet.c which does not call it in a loop. AFAICT the test only processes one packet at a time, so I don't think a loop is necessary there.
Checklist
- Commits have
Signed-off-by:with name/author being identical to the commit author - Code modified for feature
- Test suite updated with functionality tests
- Test suite updated with negative tests
- Documentation updated
- The project pipelines timeout is extended at least to 2 hours.
Reviewer's checklist:
- Any issues marked for closing are addressed
- There is a test suite reasonably covering new functionality or modifications
- Function naming, parameters, return values, types, etc., are consistent and according to CONTRIBUTING.md
- This feature/change has adequate documentation added
- No obvious mistakes in the code