mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-16 17:59:19 +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));
|
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 */
|
/* close socket */
|
||||||
rc = close(fd);
|
rc = close(fd);
|
||||||
if(rc != 0)
|
if(rc != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user