diff options
Diffstat (limited to 'captain/gemini.f90')
-rw-r--r-- | captain/gemini.f90 | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/captain/gemini.f90 b/captain/gemini.f90 index 7e849d6..b14078d 100644 --- a/captain/gemini.f90 +++ b/captain/gemini.f90 @@ -227,8 +227,10 @@ contains type(c_ptr)::ssl integer(kind=c_long)::res - type(request)::req - type(titan_request)::treq + class(request), pointer::req + + type(gemini_request), target::greq + type(titan_request), target::treq type(response)::resp ! Requested file @@ -297,7 +299,14 @@ contains call read_request(ssl, text_request) call write_log("Initializing object", LOG_DEBUG) - call req%init(text_request) + + if(get_protocol(text_request) == "gemini") then + call greq%init(text_request) + req => greq + else + call treq%init(text_request, ssl) + req => treq + end if call write_log("Request object created", LOG_DEBUG) @@ -309,7 +318,6 @@ contains resp = api_request_gemini(req) call write_log("resp filename is: '"//trim(resp%body_filename)//"'", LOG_DEBUG) else if(req%protocol == "titan") then - call treq%init_from_request(req, ssl) resp = api_request_titan(treq) end if @@ -328,9 +336,8 @@ contains if(req%protocol == "gemini") then - resp = external_request_gemini(req) + resp = external_request_gemini(greq) else if(req%protocol == "titan") then - call treq%init_from_request(req, ssl) resp = external_request_titan(treq) end if |