aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-04-07 15:40:25 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-04-07 15:40:25 -0400
commit85a6816e7840e6b8cdff51b7c0cfad36082c01ec (patch)
tree8599b6578e43d97dd0c1ec6a44f31ef54900b51b /common
parentc493170e73506e974a0644452fc5a334c08171bc (diff)
downloadlevitating-85a6816e7840e6b8cdff51b7c0cfad36082c01ec.tar.gz
levitating-85a6816e7840e6b8cdff51b7c0cfad36082c01ec.zip
Results now posted back correctly using titan protocol
Diffstat (limited to 'common')
-rw-r--r--common/protocol.f9032
1 files changed, 31 insertions, 1 deletions
diff --git a/common/protocol.f90 b/common/protocol.f90
index 38f2cf1..37e3205 100644
--- a/common/protocol.f90
+++ b/common/protocol.f90
@@ -230,6 +230,11 @@ contains
logical, dimension(4)::successes
integer::i, ierr, bytes_read, bytes_written, total_written
+ ! For direct processing of the reponse line
+ integer::response_line_index, bytes_received
+ character(1024)::response_line
+ logical::response_line_completed
+
returncode = -1
rewind(unit_number)
@@ -278,7 +283,32 @@ contains
end do
if(total_written >= file_length) then
- returncode = STATUS_SUCCESS
+
+ response_line_completed = .false.
+ response_line = " "
+ response_line_index = 0
+
+ bytes_received = retrieve_characters(conn%ssl, buffer)
+ do while(bytes_received > 0)
+
+ do i=1, bytes_received
+ response_line_index = response_line_index + 1
+ response_line(response_line_index:response_line_index) = buffer(i)
+
+ ! If we encountered our first newline, we have a complete status
+ ! line - handle it here
+ if(buffer(i) == char(10) .or. response_line_index == 1024) then
+ response_line_completed = .true.
+
+ returncode = get_return_code(response_line)
+
+ end if
+
+ end do
+
+ bytes_received = retrieve_characters(conn%ssl, buffer)
+ end do
+
else
returncode = STATUS_LOCALFAIL
end if