adjusting for Linux when sctp_recvmsg returns 0 for remote close
This commit was SVN r16742.
Этот коммит содержится в:
родитель
f42fcd36db
Коммит
ede8a6a7a1
@ -930,6 +930,8 @@ static void mca_btl_sctp_component_recv_handler(int sd, short flags, void* user)
|
|||||||
CLOSE_THE_SOCKET(sd);
|
CLOSE_THE_SOCKET(sd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
SCTP_BTL_ERROR(("mca_btl_sctp_component_recv_handler() sd=%d, got %d byte guid.\n", sd, retval));
|
||||||
|
|
||||||
ORTE_PROCESS_NAME_NTOH(guid);
|
ORTE_PROCESS_NAME_NTOH(guid);
|
||||||
|
|
||||||
/* lookup the corresponding process */
|
/* lookup the corresponding process */
|
||||||
|
@ -780,10 +780,10 @@ static int mca_btl_sctp_endpoint_recv_blocking(mca_btl_base_endpoint_t* btl_endp
|
|||||||
*/
|
*/
|
||||||
retval = sctp_recvmsg(btl_endpoint->endpoint_sd, (char *)ptr+cnt, size-cnt,
|
retval = sctp_recvmsg(btl_endpoint->endpoint_sd, (char *)ptr+cnt, size-cnt,
|
||||||
0, 0, &sri, &msg_flags);
|
0, 0, &sri, &msg_flags);
|
||||||
if(retval >= 0) { SCTP_BTL_ERROR(("mca_btl_sctp_endpoint_recv_blocking() sd=%d, got %d bytes.\n", btl_endpoint->endpoint_sd, retval)); }
|
|
||||||
|
|
||||||
/* remote closed connection */
|
/* remote closed connection */
|
||||||
if(retval == -1 && (opal_socket_errno == ECONNRESET || opal_socket_errno == EBADF)) {
|
if((retval == -1 && (opal_socket_errno == ECONNRESET || opal_socket_errno == EBADF))
|
||||||
|
|| retval == 0) {
|
||||||
mca_btl_sctp_endpoint_close(btl_endpoint);
|
mca_btl_sctp_endpoint_close(btl_endpoint);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -797,6 +797,8 @@ static int mca_btl_sctp_endpoint_recv_blocking(mca_btl_base_endpoint_t* btl_endp
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
SCTP_BTL_ERROR(("mca_btl_sctp_endpoint_recv_blocking() sd=%d, got %d bytes.\n", btl_endpoint->endpoint_sd, retval));
|
||||||
|
|
||||||
cnt += retval;
|
cnt += retval;
|
||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user