aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2020-06-03 17:26:03 -0400
committerJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2020-06-03 17:26:03 -0400
commit48512f5d2e180d2086162cdf06c96098e6de96d7 (patch)
tree6d96f90bba2aff6af6d84981f9903dcee5568a61
parent3afc5107f7f43176bb3547c7d16898f23294a180 (diff)
downloadLR-87-48512f5d2e180d2086162cdf06c96098e6de96d7.tar.gz
LR-87-48512f5d2e180d2086162cdf06c96098e6de96d7.zip
Added true error conditions to block infinite requests on failure.
-rw-r--r--main.F907
-rw-r--r--protocol.f9011
2 files changed, 16 insertions, 2 deletions
diff --git a/main.F90 b/main.F90
index b05c9c5..9d8e7a4 100644
--- a/main.F90
+++ b/main.F90
@@ -92,7 +92,7 @@ implicit none
else
- initial_site = "gemini://gemini.circumlunar.space/"
+ initial_site = "gemini://lilarm/"
end if
@@ -186,6 +186,11 @@ implicit none
call r%draw_error("Exiting without initial site")
running = .false.
+ else if(is_failure_code(return_code)) then
+
+ call r%draw_error("Could not connect to "//desired_url)
+ loaded = .true.
+
end if
do while(loaded .and. running)
diff --git a/protocol.f90 b/protocol.f90
index 4948325..adb3760 100644
--- a/protocol.f90
+++ b/protocol.f90
@@ -102,7 +102,7 @@ contains
use request
use iso_c_binding
use file_handling, only: mark_file_end
- use binary, only: binary_handler, is_binary_file, binary_okay
+ use binary, only: binary_handler, is_binary_file, binary_okay, binary_ignore
implicit none
character(*), intent(inout)::url
@@ -203,6 +203,10 @@ contains
write(binary_unit) buffer(i)
+ else if(binary_file .and. binary_status == binary_ignore) then
+
+ exit
+
end if
if(.not. binary_file) then
@@ -213,6 +217,11 @@ contains
end do
+ ! If the user has bailed...
+ if(binary_file .and. binary_status == binary_ignore) then
+ exit
+ end if
+
bytes_received = retrieve_characters(conn%ssl, buffer)
end do