+60
-13
bin/fcgi_server.ml
+60
-13
bin/fcgi_server.ml
···+let method_ = Fastcgi.Record.KV.find_opt "REQUEST_METHOD" params |> Option.value ~default:"GET" in+let script_name = Fastcgi.Record.KV.find_opt "SCRIPT_NAME" params |> Option.value ~default:"" in···-Eio.Net.run_server server_socket ~on_error:(fun ex -> Eio.traceln "Error: %s" (Printexc.to_string ex))···
+7
config/Caddyfile
+7
config/Caddyfile
-3
lib/dune
-3
lib/dune
+50
lib/fastcgi.ml
+50
lib/fastcgi.ml
···
+17
-1
lib/fastcgi.mli
+17
-1
lib/fastcgi.mli
···
+27
-11
lib/fastcgi_record.ml
+27
-11
lib/fastcgi_record.ml
···-else String.sub content 0 max_content_len ^ "..." ^ Printf.sprintf " (%d more bytes)" (len - max_content_len)+else String.sub actual_content 0 max_content_len ^ "..." ^ Printf.sprintf " (%d more bytes)" (len - max_content_len)+"@[<2>{ version = %d;@ record_type = %a;@ request_id = %d;@ content = %S;@ offset = %d;@ length = %d }@]"···+let record = { version; record_type; request_id; content; offset = 0; length = String.length content } in···
+11
-7
lib/fastcgi_record.mli
+11
-7
lib/fastcgi_record.mli
······
+38
-156
lib/fastcgi_request.ml
+38
-156
lib/fastcgi_request.ml
···············Printf.eprintf "[DEBUG] read_request_streams: Got STDIN data, %d bytes\n%!" (String.length stdin_data);Printf.eprintf "[DEBUG] read_request_streams: Got STDIN data, %d bytes\n%!" (String.length stdin_data);Printf.eprintf "[DEBUG] read_request_streams: Got DATA stream, %d bytes\n%!" (String.length data);-Printf.eprintf "[DEBUG] read_request_from_flow: Got %d params\n%!" (Fastcgi_record.KV.cardinal params);···-let record = Fastcgi_record.create ~version:1 ~record:record_type ~request_id ~content:chunk in+let record = Fastcgi_record.create ~record:record_type ~request_id ~content ~offset:pos ~length:chunk_len () in-let terminator = Fastcgi_record.create ~version:1 ~record:record_type ~request_id ~content:"" in···-let stdout_records = flow_to_stream_records ~sw ~request_id:request.request_id ~record_type:Stdout stdout in-let stderr_records = flow_to_stream_records ~sw ~request_id:request.request_id ~record_type:Stderr stderr in-let end_record = make_end_request ~request_id:request.request_id ~app_status ~protocol_status:Request_complete in-let end_record = make_end_request ~request_id:request.request_id ~app_status:1 ~protocol_status:proto_status in-let end_record = make_end_request ~request_id:request.request_id ~app_status:0 ~protocol_status:Request_complete in
+23
-123
lib/fastcgi_request.mli
+23
-123
lib/fastcgi_request.mli
······-val read_params_from_flow : sw:Eio.Switch.t -> Eio.Buf_read.t -> (Fastcgi_record.KV.t, string) result···-(** [string_to_stream_records ~request_id ~record_type content] converts string to stream records *)-(** [flow_to_stream_records ~sw ~request_id ~record_type flow] converts flow to stream records *)+(** [write_end_request buf_write request_id app_status protocol_status] writes END_REQUEST record. *)+val write_end_request : Eio.Buf_write.t -> Fastcgi_record.request_id -> app_status -> protocol_status -> unit