aboutsummaryrefslogtreecommitdiff
path: root/main.F90
diff options
context:
space:
mode:
Diffstat (limited to 'main.F90')
-rw-r--r--main.F9021
1 files changed, 20 insertions, 1 deletions
diff --git a/main.F90 b/main.F90
index 9ab1782..a457d01 100644
--- a/main.F90
+++ b/main.F90
@@ -18,6 +18,7 @@ implicit none
logical::running
logical::loaded
+ logical::populated
integer::return_code
@@ -62,11 +63,19 @@ implicit none
do while(running)
+ if(index(current_url, "gemini://") /= 1) then
+ call r%draw_error("Only gemini:// URLs are supported")
+ populated = .false.
+ loaded = .true.
+ return_code = STATUS_LOCALFAIL
+ end if
+
if(.not. loaded) then
call r%report_status("Requesting "//trim(current_url))
return_code = request_url(trim(current_url), io)
+ populated = .true.
call update_status(r, current_url, return_code)
@@ -76,8 +85,18 @@ implicit none
call get_redirect_url(io, current_url)
loaded = .false.
+ populated = .false.
- else
+ else if(return_code == STATUS_INPUT) then
+
+ if(handle_input(r, current_url, io)) then
+ ! Should force a new load
+ loaded = .false.
+ else
+ loaded = .true.
+ end if
+
+ else if(populated) then
first_line => load_unit(io, file_type_gemini)
loaded = .true.