1112 |
match event with |
match event with |
1113 |
TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) -> |
TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) -> |
1114 |
let from_ip = Ip.of_inet_addr from_ip in |
let from_ip = Ip.of_inet_addr from_ip in |
1115 |
lprintf "CONNECTION FROM GUI\n"; |
lprintf "GUI: Connection from %s\n" (Ip.to_string from_ip); |
1116 |
if Ip.matches from_ip !!allowed_ips then |
if Ip.matches from_ip !!allowed_ips then |
1117 |
|
|
1118 |
let module P = GuiProto in |
let module P = GuiProto in |
1141 |
(* sort GUIs in increasing order of their num *) |
(* sort GUIs in increasing order of their num *) |
1142 |
|
|
1143 |
else begin |
else begin |
1144 |
lprintf "Connection from that IP %s not allowed\n" |
lprintf "Connection from IP %s not allowed\n" |
1145 |
(Ip.to_string from_ip); |
(Ip.to_string from_ip); |
1146 |
Unix.close s |
Unix.close s |
1147 |
end |
end |
1151 |
match event with |
match event with |
1152 |
TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) -> |
TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) -> |
1153 |
let from_ip = Ip.of_inet_addr from_ip in |
let from_ip = Ip.of_inet_addr from_ip in |
1154 |
lprintf "CONNECTION FROM GUI\n"; |
lprintf "Gift: Connection from %s\n" (Ip.to_string from_ip); |
1155 |
if Ip.matches from_ip !!allowed_ips then |
if Ip.matches from_ip !!allowed_ips then |
1156 |
|
|
1157 |
let module P = GuiProto in |
let module P = GuiProto in |
1179 |
(* sort GUIs in increasing order of their num *) |
(* sort GUIs in increasing order of their num *) |
1180 |
|
|
1181 |
else begin |
else begin |
1182 |
lprintf "Connection from that IP %s not allowed\n" |
lprintf "Connection from IP %s not allowed\n" |
1183 |
(Ip.to_string from_ip); |
(Ip.to_string from_ip); |
1184 |
Unix.close s |
Unix.close s |
1185 |
end |
end |