| Summary: | tcpudp: daemon leaks fd temporarily; keeping connection open | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Enrico Scholz <enrico.scholz> |
| Component: | Networking | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | patch | ||
Fixed in git. Thanks! |
Created attachment 6741 [details] patch When the concurrency feature (-c) is used, the 'tcpsvd' parent process will keep the last connection open until slots are free. This is unwanted, especially in '-c 1' cases. E.g. $ cat <<EOF > /tmp/test #! /bin/sh # do something sleep 10 # close file descriptor exec 0<&- exec 1>&- # do some other thing exec sleep 3600 EOF $ chmod a+x /tmp/test $ tcpsvd -v -c 2 0 8001 /tmp/test ---- $ nc <ip> 8001 < /dev/null & $ nc <ip> 8001 < /dev/null & --> The first 'nc' will return after 10 seconds, but the second will wait until '/tmp/test' finishes (--> 3600s). Attached patch fixes this.