Skip to content

Commit

Permalink
Remove shutdown socket on close on error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakio815 committed Jan 22, 2025
1 parent 51a4257 commit a75fefc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions network/impl/src/lf_socket_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ int read_from_netdrv(netdrv_t* drv, size_t num_bytes, unsigned char* buffer) {
}

int read_from_netdrv_close_on_error(netdrv_t* drv, size_t num_bytes, unsigned char* buffer) {
socket_priv_t* priv = (socket_priv_t*)drv->priv;
// socket_priv_t* priv = (socket_priv_t*)drv->priv;
int read_failed = read_from_netdrv(drv, num_bytes, buffer);
if (read_failed) {
// Read failed.
// Socket has probably been closed from the other side.
// Shut down and close the socket from this side.
shutdown_socket(&priv->socket_descriptor, false);
// shutdown_socket(&priv->socket_descriptor, false);
return -1;
}
return 0;
Expand Down

0 comments on commit a75fefc

Please sign in to comment.