Commits

Anonymous committed a95116c

mid

  • Participants
  • Parent commits 4141369

Comments (0)

Files changed (3)

File parvel_net.ml

 
 
 type config_action =
-  [= `Listen of U.sockaddr
-  |  `Connect of U.sockaddr
-  ]
-;
-
-value get_env_opt name =
-  try Some (Sys.getenv name) with [Not_found -> None]
+  { ca_listen : option U.sockaddr
+  ; ca_connect : option U.sockaddr
+  }
 ;
 
 module Env_config
  =
   struct
 
-    value default_listen_port = 12343
-    ;
-
-    value failwith fmt = Printf.ksprintf failwith fmt
+    value get_env_opt name =
+      try Some (Sys.getenv name) with [Not_found -> None]
     ;
 
     value inet_addr_of_string host_txt =
       U.ADDR_INET ia p
     ;
 
-    value role
-    : [= `Master of U.sockaddr | `Worker of U.sockaddr ]
-    =
+    value env_addr varname =
       let g n = get_env_opt ("PARVEL__" ^ n) in
-      match (g "ROLE", g "HOST", g "PORT") with
-      [ ( (None | Some "master"), host_txt_opt, port_txt_opt ) ->
+      match (g "HOST", g "PORT") with
+      [ ( (host_txt_opt, port_txt_opt ) ->
           let ia =
             match host_txt_opt with
             [ None -> U.inet_addr_any
           in
             `Master (U.ADDR_INET ia p)
 
-      | ( Some "worker", host_txt_opt, port_txt_opt ) ->
+      | ( host_txt_opt, port_txt_opt ) ->
           match (host_txt_opt, port_txt_opt) with
           [ (Some host_txt, Some port_txt) ->
              `Worker (inet_sockaddr_of_host_port host_txt port_txt)
+(*
+PARVEL__LISTEN
+PARVEL__CONNECT
+  {ip/host}:port, break by ':'
+  (maybe http spec for uri?)
+*)
+
+
+
 open Cd_All; open Cdt;
 
 
                in
                if totalsize > rq_max_totalsize
                then
+                 let () = Printf.printf "totalsize=%Li rq_max_totalsize=%Li\n%!"
+                   totalsize rq_max_totalsize in
                  I.throw_err & Srv "request too long"
                else
                  I.gather_to_string

File topoman_config.ml

Empty file added.