diff options
-rw-r--r-- | dumb_render.f90 | 1 | ||||
-rw-r--r-- | main.F90 | 3 | ||||
-rw-r--r-- | protocol.f90 | 22 |
3 files changed, 17 insertions, 9 deletions
diff --git a/dumb_render.f90 b/dumb_render.f90 index e6ca671..7ff4e6d 100644 --- a/dumb_render.f90 +++ b/dumb_render.f90 @@ -218,6 +218,7 @@ contains answer = " " Print *, question + Write(*, '(1X, A3)', advance="no") "=> " Read *, answer ! Line Feed @@ -177,6 +177,9 @@ contains case (STATUS_CERTREQ) call r%report_status("Server requesting certificate (unsupported)") + case (STATUS_BADRESPONSE) + call r%report_status("Bad response code from server") + end select end subroutine update_status 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 |