Commit 4f5a368e authored by yangjian's avatar yangjian

fix Bug: Disconnecting the gNB leads to an endless loop

parent 474fed58
......@@ -158,7 +158,7 @@ int sctp_server::sctp_read_from_socket(int sd, uint32_t ppid) {
int n = sctp_recvmsg(
sd, (void*) buffer, SCTP_RECV_BUFFER_SIZE, (struct sockaddr*) &addr,
&from_len, &sinfo, &flags);
if (n < 0) {
if (n <= 0) {
Logger::sctp().error("sctp_recvmsg error:: %s:%d", strerror(errno), errno);
return SCTP_RC_ERROR;
}
......@@ -211,6 +211,7 @@ int sctp_server::sctp_read_from_socket(int sd, uint32_t ppid) {
int sctp_server::sctp_handle_com_down(sctp_assoc_id_t assoc_id) {
Logger::sctp().info("SCTP_SHUTDOWN_COMP assoc_id (%d) ", assoc_id);
app_->handle_sctp_del_association(assoc_id);
return SCTP_RC_DISCONNECT;
}
//------------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment