mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-04 20:15:09 +01:00
Set SO_LINGER with timeout=0 before close
Hopefully this helps with clients that don't acknowledge our close. Thanks to TuxSH for testing with Windows Explorer.
This commit is contained in:
parent
fc95abd9f2
commit
f5f27646ee
10
source/ftp.c
10
source/ftp.c
@ -365,6 +365,16 @@ ftp_closesocket(int fd,
|
||||
console_print(RED "poll: %d %s\n" RESET, errno, strerror(errno));
|
||||
}
|
||||
|
||||
/* set linger to 0 */
|
||||
struct linger linger;
|
||||
linger.l_onoff = 1;
|
||||
linger.l_linger = 0;
|
||||
rc = setsockopt(fd, SOL_SOCKET, SO_LINGER,
|
||||
&linger, sizeof(linger));
|
||||
if(rc != 0)
|
||||
console_print(RED "setsockopt: SO_LINGER %d %s\n" RESET,
|
||||
errno, strerror(errno));
|
||||
|
||||
/* close socket */
|
||||
rc = close(fd);
|
||||
if(rc != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user