aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-06-29 16:06:44 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-06-29 16:06:44 -0400
commitcd4a5891b8e2a019fdfda7512d6490e075628292 (patch)
tree8012dc7dc52f17632f5b429dea79709e55ab96c4 /common
parentd282a7e283a1704cdde2649c7caf130fb923051a (diff)
downloadlevitating-cd4a5891b8e2a019fdfda7512d6490e075628292.tar.gz
levitating-cd4a5891b8e2a019fdfda7512d6490e075628292.zip
Tokens are now checked for file uploads. Fixed major buffer bugs in status reporting.
Diffstat (limited to 'common')
-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