Hi, In message <_A4133@delegate-en.ML_> on 09/14/08(21:36:06) I wrote: |In message <_A4131@delegate-en.ML_> on 09/13/08(18:41:30) |you "Andre E." <pzyhqbdyi-fjxi26ffzhtr.ml@ml.delegate.org> wrote: | |> You can omit PORT commands to reserve ports to be used. But reserving | |> a port is desirable to keep the LISTEN queue alive persistently not to | |> drop the connection requests for it when there is no SOCKS-client to | |> bind/accept from the port. | |Hi. | | | |I played around with the VSAP protocol as well as with the HTTP ACCEPT | |method | |and it works a long as I'm only dealing with one client. This is | |probably due to the fact | |that once a client connects to the opened port, this port becomes bound | |by this client | |so no other client can connect to this port. | |To enable multiple-parallel clients to do bind on the same port, |you need to do either A) reserving the port with the PORT parameter |to be shared in child DeleGate processes, or B) running DeleGate in |a single process mode with option "-d+7" or so to share dynamically |bound ports among client threads in the process. Sorry, I noticed B) is not true in the exsisting implementation. It can be enabled with the enclosed patch. Cheers, Yutaka -- 9 9 Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/ ( ~ ) National Institute of Advanced Industrial Science and Technology _< >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan Do the more with the less -- B. Fuller *** dist/src/delegate9.8.5-pre1/src/vsap.c Thu Mar 16 17:07:36 2006 --- ./src/vsap.c Sun Sep 14 22:33:17 2008 *************** *** 396,403 **** --- 396,408 ---- if( 0 <= (svsock = ReservedPortSock(host,port)) ){ daemonlog("D","## RESV_PORT %d\n",svsock); *sharedp = 1; }else + if( lSINGLEP() + && 0 <= (svsock = findopen_port("VSAP",AVStr(host),port,nlisten)) ){ + daemonlog("D","## SHARED_PORT %d\n",svsock); + *sharedp = 1; + }else if( 0 <= (svsock = NewPort(lport,AVStr(host),port,toC,nlisten)) ){ daemonlog("D","## NEW_PORT %d\n",svsock); *sharedp = 0; }else{ *** dist/src/delegate9.8.5-pre1/src/htaccept.c Sun Aug 31 20:28:21 2008 --- ./src/htaccept.c Sun Sep 14 23:11:37 2008 *************** *** 78,85 **** --- 78,99 ---- Xsscanf(req,"%*s %s",AVStr(local)); timeout = 10*1000; sprintf(ver,"HTTP/%s",MY_HTTPVER); + if( 1 ){ + extern int ACC_TIMEOUT; + timeout = ACC_TIMEOUT*1000; + } + if( lSINGLEP() ){ + IStr(host,256); + int port = 0; + Xsscanf(local,"%[^:]:%d",AVStr(host),&port); + if( 0 <= (bsock = ReservedPortSock(host,port)) ){ + }else + if( 0 <= (bsock = findopen_port("HTACC",AVStr(host),port,20)) ){ + bsock = dup(bsock); + } + }else bsock = VSocket(Conn,"BIND/HTTP",-1,AVStr(local),AVStr(remote),"listen=1"); if( bsock < 0 ){ if( S_ADDRNOTAVAIL ){ sv1log("%s: should be forwarded to upstream\n",