Skip to content
Snippets Groups Projects
Commit e411492c authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Some locking cleanups

parent f9327d2f
No related branches found
No related tags found
No related merge requests found
...@@ -993,8 +993,10 @@ sftp_send(uint8_t *buf, size_t len, void *cb_data) ...@@ -993,8 +993,10 @@ sftp_send(uint8_t *buf, size_t len, void *cb_data)
while (sent < len) { while (sent < len) {
pthread_mutex_lock(&sbbs->ssh_mutex); pthread_mutex_lock(&sbbs->ssh_mutex);
status = cryptSetAttribute(sbbs->ssh_session, CRYPT_SESSINFO_SSH_CHANNEL, sbbs->sftp_channel); status = cryptSetAttribute(sbbs->ssh_session, CRYPT_SESSINFO_SSH_CHANNEL, sbbs->sftp_channel);
if (cryptStatusError(status)) if (cryptStatusError(status)) {
pthread_mutex_unlock(&sbbs->ssh_mutex);
return false; return false;
}
size_t sendbytes = len - sent; size_t sendbytes = len - sent;
#define SENDBYTES_MAX 0x2000 #define SENDBYTES_MAX 0x2000
if (sendbytes > SENDBYTES_MAX) if (sendbytes > SENDBYTES_MAX)
......
...@@ -374,7 +374,7 @@ sftps_recv(sftps_state_t state, uint8_t *buf, uint32_t sz) ...@@ -374,7 +374,7 @@ sftps_recv(sftps_state_t state, uint8_t *buf, uint32_t sz)
uint32_t psz = sftp_pkt_sz(state->rxp); uint32_t psz = sftp_pkt_sz(state->rxp);
if (psz > SFTP_MAX_PACKET_SIZE) { if (psz > SFTP_MAX_PACKET_SIZE) {
state->lprintf(state->cb_data, "Packet too large (%" PRIu32 " bytes)", psz); state->lprintf(state->cb_data, "Packet too large (%" PRIu32 " bytes)", psz);
return false; return exit_function(state, false);
} }
} }
while (sftp_have_full_pkt(state->rxp)) { while (sftp_have_full_pkt(state->rxp)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment