aboutsummaryrefslogtreecommitdiff
path: root/src/packet1.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-07-14 13:31:24 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-07-14 13:31:24 +0200
commitc64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a (patch)
tree33131e402f35d800cf923f837ae4c72166703b27 /src/packet1.c
parent0d3deeec101b0d6568d7c04eda833bde47c7329c (diff)
downloadlibssh-c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a.tar.gz
libssh-c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a.tar.xz
libssh-c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a.zip
src: Remove enter_function() and leave_function().
Diffstat (limited to 'src/packet1.c')
-rw-r--r--src/packet1.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/packet1.c b/src/packet1.c
index 1c3efbaa..7ac8318d 100644
--- a/src/packet1.c
+++ b/src/packet1.c
@@ -108,7 +108,6 @@ int ssh_packet_socket_callback1(const void *data, size_t receivedlen, void *user
uint32_t crc;
uint32_t len;
ssh_session session=(ssh_session)user;
- enter_function();
switch (session->packet_state){
case PACKET_STATE_INIT:
@@ -126,7 +125,6 @@ int ssh_packet_socket_callback1(const void *data, size_t receivedlen, void *user
}
/* must have at least enough bytes for size */
if(receivedlen < sizeof(uint32_t)){
- leave_function();
return 0;
}
memcpy(&len,data,sizeof(uint32_t));
@@ -152,7 +150,6 @@ int ssh_packet_socket_callback1(const void *data, size_t receivedlen, void *user
to_be_read = len + padding;
if(to_be_read + processed > receivedlen){
/* wait for rest of packet */
- leave_function();
return processed;
}
/* it is _not_ possible that to_be_read be < 8. */
@@ -236,7 +233,7 @@ int ssh_packet_socket_callback1(const void *data, size_t receivedlen, void *user
receivedlen - processed,user);
processed += rc;
}
- leave_function();
+
return processed;
case PACKET_STATE_PROCESSING:
SSH_LOG(SSH_LOG_RARE, "Nested packet processing. Delaying.");
@@ -245,7 +242,7 @@ int ssh_packet_socket_callback1(const void *data, size_t receivedlen, void *user
error:
session->session_state=SSH_SESSION_STATE_ERROR;
- leave_function();
+
return processed;
}
@@ -260,7 +257,6 @@ int packet_send1(ssh_session session) {
uint32_t crc;
uint8_t padding;
- enter_function();
SSH_LOG(SSH_LOG_PACKET,"Sending a %d bytes long packet",currentlen);
/* TODO FIXME
@@ -323,7 +319,7 @@ int packet_send1(ssh_session session) {
rc = SSH_ERROR;
}
error:
- leave_function();
+
return rc; /* SSH_OK, AGAIN or ERROR */
}