Re: [Sslproxy-users] SSL proxy server could not restart immediately after killing
Brought to you by:
szilu
From: Szilard H. <sz...@sy...> - 2008-01-15 20:00:29
|
Hi! Sorry for the late answer! Your suggestion is a good one, thank you! We use SO_REUSEADDR in most of our newer software, but in SSL Proxy there wasn't any need for it yet. Maybe it is too stable, there is not so much need to restart it.. :) I will put this in the next release, I hope it'll be soon. I am a little busy now, but I hope I'll have some more time in the near future. Thank you again, Szilard -- hirdetni.akarsz.hu Hajba Szilárd Symbion Bt. Tel.: (+36)20/203-31-56 H-9028 Győr, Új u. 38. ICQ: 12892911 E-Mail: sz...@sy... Skype: hszilu Egyszer volt, hol nem volt, volt 1szer egy levél, melyet Daobang Wang írt: > Hi All > > > > I have a problem about SSL proxy server rebooting. > > > > SSL proxy server could not be restarted after killing if there is active > https session exists, and I find the root cause: > > > > On Linux OS, if there is a socket binding a port, after the socket is closed > or the program exit normally, the port could not be release at once, if I > restart the SSL proxy server it will report binding error, the address could > not be used at once. > > > > I add the method "setsockopt" to resolve this issue after the socket created > and before binding the port in method "server_init", please see the follows, > the blue line is added by us. > > > > server_socket=socket(AF_INET, SOCK_STREAM, 0); > > if (server_socket<0) { > > perror("socket()"); > > exit(1); > > } > > server.sin_family=AF_INET; > > inet_pton(AF_INET, addr, &ipaddr); > > server.sin_addr.s_addr=ipaddr; > > // server.sin_addr.s_addr=htons(INADDR_ANY); > > server.sin_port=htons(port); > > z = setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR, &so_reuseaddr, > sizeof so_reuseaddr); > > if (z==-1) > > { > > perror("setsockopt(SO_REUSEADDR)"); > > } > > if (bind(server_socket, (struct sockaddr *)&server, sizeof(server)) < 0) > { > > perror("bind()"); > > exit(1); > > } > > > > And then, I could restart the SSL proxy server. > > Why the bug is not fixed, and is there any risk of adding the above change? > > Or would you like to give another way to resolve this issue? Thank you very > much. > > > > Best wishes, > > Daobang. > > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > SSLproxy-users mailing list > SSL...@li... > https://lists.sourceforge.net/lists/listinfo/sslproxy-users |