diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c index e48caaf30ab22bf987a423c02b6857a98afe5619..e89ef8d63d9a049f3fc79ef5b199e2e8a0a1dfac 100644 --- a/src/common/slurm_protocol_api.c +++ b/src/common/slurm_protocol_api.c @@ -137,7 +137,6 @@ int slurm_receive_msg ( slurm_fd open_fd , slurm_msg_t * msg ) int rc ; unsigned int unpack_len ; unsigned int receive_len = SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE ; -int i; if ( ( rc = _slurm_msg_recvfrom ( open_fd , buffer , receive_len, SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , & (msg)->address ) ) == SLURM_SOCKET_ERROR ) { @@ -245,7 +244,6 @@ int slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address , slur char * buffer = buftemp ; header_t header ; int rc ; -int i; unsigned int unpack_len ; /* length left to upack */ unsigned int receive_len = SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE ; /* buffer size */ diff --git a/src/common/slurm_protocol_socket_implementation.c b/src/common/slurm_protocol_socket_implementation.c index 1fc3f269fc383066cb9ec00d251f5dab579a1547..b87014d0849591096fee2c7ffbb61102a724e249 100644 --- a/src/common/slurm_protocol_socket_implementation.c +++ b/src/common/slurm_protocol_socket_implementation.c @@ -53,6 +53,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin char size_buffer_temp [8] ; char * size_buffer = size_buffer_temp ; + char * moving_buffer = buffer ; unsigned int size_buffer_len = 8 ; unsigned int transmit_size ; unsigned int total_len ; @@ -75,7 +76,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin while ( total_len < transmit_size ) { /* if ( ( recv_len = _slurm_recv ( connection_fd , buffer , transmit_size , NO_SEND_RECV_FLAGS ) ) == SLURM_SOCKET_ERROR ) */ - if ( ( recv_len = _slurm_recv ( open_fd , buffer , transmit_size , SLURM_PROTOCOL_NO_SEND_RECV_FLAGS ) ) == SLURM_SOCKET_ERROR ) + if ( ( recv_len = _slurm_recv ( open_fd , moving_buffer , transmit_size , SLURM_PROTOCOL_NO_SEND_RECV_FLAGS ) ) == SLURM_SOCKET_ERROR ) { info ( "Error receiving length of datagram. errno %i \n", errno ) ; return recv_len ; @@ -83,6 +84,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin if ( recv_len >= 0 ) { total_len += recv_len ; + moving_buffer += recv_len ; } } /*