From 36249ebd4dece7ee69cd85e7e169db0dc4315e3e Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Tue, 23 Feb 2021 15:44:25 -0500 Subject: Added favicon support. Fixed UTF-8 display on dumb renderer. --- protocol.f90 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'protocol.f90') diff --git a/protocol.f90 b/protocol.f90 index 613ca9f..d06d901 100644 --- a/protocol.f90 +++ b/protocol.f90 @@ -114,7 +114,7 @@ contains character(*), intent(inout)::url integer, intent(in)::unit_number character(*), intent(out)::return_type - class(binary_handler)::bh + class(binary_handler), optional::bh character(*), intent(in), optional::server_name integer::port @@ -144,6 +144,7 @@ contains server = server_name port = gemini_default_port else + allocate(character(len=len_trim(url)) :: server) call get_server_from_url(url, server, port) if(port < 0) then port = gemini_default_port @@ -185,8 +186,12 @@ contains call get_mimetype(response_line, return_type) binary_file = is_binary_file(return_type) - if(binary_file) then - binary_unit = bh%handle_binary(return_type, trim(url), binary_status) + if(binary_file ) then + if(present(bh)) then + binary_unit = bh%handle_binary(return_type, trim(url), binary_status) + else + binary_status = binary_ignore + end if end if else -- cgit v1.2.3