/[mldonkey]/mldonkey/src/utils/net/http_server.ml
ViewVC logotype

Diff of /mldonkey/src/utils/net/http_server.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by spiralvoice, Tue Jul 26 21:52:03 2005 UTC revision 1.21 by spiralvoice, Mon Aug 1 20:26:06 2005 UTC
# Line 798  let request_handler config sock nread = Line 798  let request_handler config sock nread =
798  let request_closer sock msg =  let request_closer sock msg =
799    ()    ()
800    
801    
802    open Ip_set
803    
804  let handler config t event =  let handler config t event =
805    match event with    match event with
806      TcpServerSocket.CONNECTION (s, Unix.ADDR_INET(from_ip, from_port)) ->      TcpServerSocket.CONNECTION (s, Unix.ADDR_INET(from_ip, from_port)) ->
807  (* check here if ip is OK *)      (* check here if ip is OK *)
808        let from_ip = Ip.of_inet_addr from_ip in        let from_ip = Ip.of_inet_addr from_ip in
809        if Ip.matches from_ip config.addrs then        if Ip.matches from_ip config.addrs &&
810            (match Ip_set.match_ip !Ip_set.bl from_ip with
811               None -> true
812             | Some br ->
813                 lprintf "[HTTPSRV]:  %s:%d blocked: %s\n"
814                   (Ip.to_string from_ip) from_port br.blocking_description;
815                 false) then
816          let token = create_token unlimited_connection_manager in          let token = create_token unlimited_connection_manager in
817          let sock = TcpBufferedSocket.create_simple          let sock = TcpBufferedSocket.create_simple
818              token "http connection" s in              token "http connection" s in

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26