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/external.f90 | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'captain/external.f90') diff --git a/captain/external.f90 b/captain/external.f90 index 518abcb..c4dcb5a 100644 --- a/captain/external.f90 +++ b/captain/external.f90 @@ -791,4 +791,40 @@ contains end function external_request_gemini -end module external_handling \ No newline at end of file + function external_request_titan(req) result(resp) + use server_response + use special_filenames + use logging + implicit none + + type(titan_request), intent(in)::req + type(response)::resp + + character(len=:), pointer::fullpath + character(12)::job_text, task_text + integer::job_id, task_num + + character(64)::msg + + fullpath => get_full_filename_from_request(req) + + if(associated(fullpath)) then + + ! Write the file + call write_log("Storing titan file to "//trim(fullpath), LOG_DEBUG) + + call req%write_to(fullpath) + + resp%code = GEMINI_CODE_SUCCESS + call resp%set_body_contents(RESPONSE_JSON_OKAY) + resp%body_mimetype = "text/plain" + + else + + resp%code = GEMINI_CODE_PERMFAIL + + end if + + end function external_request_titan + +end module external_handling -- cgit v1.2.3