aboutsummaryrefslogtreecommitdiff
path: root/protocol.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-05-06 16:13:59 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-05-06 16:13:59 -0400
commitaf97440f3ef41ce88509397ada3c206fe63f9aa1 (patch)
treef0023b2cbace0536bc1166488ac6cac4c342c51c /protocol.f90
parentb7e9966907434c6f58efa1307b2118a470c63d2b (diff)
downloadLR-87-af97440f3ef41ce88509397ada3c206fe63f9aa1.zip
LR-87-af97440f3ef41ce88509397ada3c206fe63f9aa1.tar.gz
Fixed handling of bad server response code. Made input requests in the dumb renderer a bit more pleasant.
Diffstat (limited to 'protocol.f90')
-rw-r--r--protocol.f9022
1 files changed, 13 insertions, 9 deletions
diff --git a/protocol.f90 b/protocol.f90
index 6d2390a..087e96a 100644
--- a/protocol.f90
+++ b/protocol.f90
@@ -1,13 +1,14 @@
module gemini_protocol
implicit none
- integer, parameter::STATUS_INPUT = 1
- integer, parameter::STATUS_SUCCESS = 2
- integer, parameter::STATUS_REDIRECT = 3
- integer, parameter::STATUS_TEMPFAIL = 4
- integer, parameter::STATUS_PERMFAIL = 5
- integer, parameter::STATUS_CERTREQ = 6
- integer, parameter::STATUS_LOCALFAIL = -1
+ integer, parameter::STATUS_INPUT = 1
+ integer, parameter::STATUS_SUCCESS = 2
+ integer, parameter::STATUS_REDIRECT = 3
+ integer, parameter::STATUS_TEMPFAIL = 4
+ integer, parameter::STATUS_PERMFAIL = 5
+ integer, parameter::STATUS_CERTREQ = 6
+ integer, parameter::STATUS_BADRESPONSE = 7
+ integer, parameter::STATUS_LOCALFAIL = -1
integer, parameter::BUFFER_SIZE = 256
@@ -29,7 +30,7 @@ contains
type(connection)::conn
- integer::bytes_received, i
+ integer::bytes_received, i, iostatus
character, dimension(BUFFER_SIZE)::buffer
returncode = -1
@@ -63,7 +64,10 @@ contains
call mark_file_end(unit_number)
rewind(unit_number)
- read(unit_number, '(I1)') returncode
+ read(unit_number, '(I1)', iostat=iostatus) returncode
+ if(iostatus /= 0) then
+ returncode = STATUS_BADRESPONSE
+ end if
else