aboutsummaryrefslogtreecommitdiff
path: root/common/protocol.f90
diff options
context:
space:
mode:
Diffstat (limited to 'common/protocol.f90')
-rw-r--r--common/protocol.f9010
1 files changed, 7 insertions, 3 deletions
diff --git a/common/protocol.f90 b/common/protocol.f90
index cf93b0d..25050cb 100644
--- a/common/protocol.f90
+++ b/common/protocol.f90
@@ -151,8 +151,8 @@ contains
response_line_index = 0
bytes_received = retrieve_characters(conn%ssl, buffer)
- do while(bytes_received > 0)
+ do while(bytes_received > 0)
do i=1, bytes_received
if(.not. response_line_completed) then
response_line_index = response_line_index + 1
@@ -286,14 +286,17 @@ contains
!Print *, "bytes read for sending: ", bytes_read
- do while(bytes_read > 0)
+ bytes_written = 0
+ do while(bytes_read > 0 .and. bytes_written >= 0)
bytes_written = ssl_write(conn%ssl, buffer(1:bytes_read))
total_written = total_written + bytes_written
bytes_read = read_into_buffer(unit_number, buffer)
!Print *, "bytes read for sending now: ", bytes_read, " and so far, we wrote", total_written
end do
- if(total_written >= file_length) then
+ if(total_written >= file_length .and. bytes_written >= 0) then
+
+ Print *, "Upload ok: ", total_written, file_length
response_line_completed = .false.
response_line = " "
@@ -321,6 +324,7 @@ contains
end do
else
+ Print *, "Marking localfail"
returncode = STATUS_LOCALFAIL
end if