Volker Wiegand wrote:
On Sat, 11 Dec 1999, Volker Wiegand wrote:
Hi,
When the data port for connections to the server is specified as 41000 - 41999, there will always be a data connection between realserver:20 and proxyserver:41000, as the ftp-proxy always uses the lowest possible port. Some ftp-servers don't seem to like this. They end up refusing to build a dataconnection half of the time. (i.e. first request works, second request doesn't, and so forth).
Okay, I admit that there is a bug in my brain, because I have not fully understood the ReUseAddr thing. :-)
All you Gurus on the list out there, please help me with this: is the patch provided by Rogier, and a second one disabling the SO_REUSEADDR option (at least on the data connections) the correct way to handle the connections?
TCP doesn't allow you to reuse the source-IP source-port dest-IP dest-port quad in the 3 minute timeout period. To prevent this from happening you forget about the SO_REUSEADDR. That unique-ifies the local source-port. As we'll be connecting to port 20 on a fixed IP, from our own fixed IP, the source port is the only variable thing. So, theory says that removing the SO_REUSEADDR is obligatory.
I remember that when I did not have SO_REUSEADDR it was nearly impossible to use the proxy. I could open one control connection and perform one data transfer. All went well, but I could not perform a second transfer within the 180 second timeout. When I introduced the flag, I could do as many sequential transfers as I wanted.
In theory, theory and practise agree. In practise they don't. Roger. -- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 ** *-- BitWizard writes Linux device drivers for any device you may have! --* "I didn't say it was your fault. I said I was going to blame it on you."