From fca71fde0161a59ac650bd690a3413ffd866662d Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Mon, 12 Apr 2021 10:32:39 -0400 Subject: URLs in instructions can now leave out the server implying download and upload from the server itself. Download and upload both work correctly. --- captain/special.f90 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'captain/special.f90') diff --git a/captain/special.f90 b/captain/special.f90 index 43a4a6a..9adbb75 100644 --- a/captain/special.f90 +++ b/captain/special.f90 @@ -6,12 +6,16 @@ contains function get_special_full_filename(category, filename) result(res) use utilities, only: combine_paths use config + use logging implicit none character(*), intent(in)::category, filename character(len=:), pointer::res res => null() + + call write_log("category: "//trim(category)) + call write_log("file: "//trim(filename)) if(trim(category) == "releases") then allocate(character(len=(len_trim(release_dir)+len_trim(filename)+1)) :: res) @@ -33,6 +37,8 @@ contains call combine_paths(instructions_dir, filename, res) end if + call write_log("path: "//trim(res)) + end function get_special_full_filename function get_instructions_static_filename(instruction_id) result(res) @@ -80,4 +86,25 @@ contains end function get_task_result_static_filename + function get_full_filename_from_request(req) result(res) + use server_response + implicit none + + class(request)::req + character(len=:), pointer::res + + character(256)::first + character(1024)::remaining + integer::i + + call req%path_component(1, first) + + i = index(req%location, trim(first)) + i = i + len_trim(first) + 1 + remaining = req%location(i:len_trim(req%location)) + + res => get_special_full_filename(first, trim(remaining)) + + end function get_full_filename_from_request + end module special_filenames -- cgit v1.2.3