accept strace block
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netkit-ftp (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I used ftp (netkit-ftp-0.17) to get some files when prompt was on, the block happened.
BTW. The ftp server is 3CDeamon Version2.0 Revision10
----
local: test1.css remote: test1.css
200 PORT command successful.
150 File status OK ; about to open data connection
(#block happened. here is wating...)
----
i used strace command to find out the reason.
the block happened when socket accepted.
---
write(3, "RETR test1.css\r\n", 24) = 24
rt_sigaction(
read(3, "150 File status OK ; about to op"..., 1024) = 52
write(1, "150 File status OK ; about to op"..., 51) = 51
rt_sigaction(
rt_sigaction(
accept(5,
(#wating...)
----
the source is below:
------
static FILE *
dataconn(const char *lmode)
{
struct sockaddr_in from;
int s, tos;
socklen_t fromlen = sizeof(from);
s = accept(data, (struct sockaddr *) &from, &fromlen); --> (here is the problem which block happen.)
if (s < 0) {
perror("ftp: accept");
(void) close(data), data = -1;
return (NULL);
}
(void) close(data);
data = s;
#ifdef IP_TOS
tos = IPTOS_THROUGHPUT;
if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0)
perror("ftp: setsockopt TOS (ignored)");
#endif
return (fdopen(data, lmode));
}
------
i search the internet , and found accept will block the process.
is it a bug? i don't kown how to deal with it.
can somebody give me a hand to solve it???
thank you.