aboutsummaryrefslogtreecommitdiff
path: root/captain
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-04-14 10:54:27 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-04-14 10:54:27 -0400
commit05b91a7ca0aace044621d8db1e82f4772181d893 (patch)
tree44bf7c8c284c3363f353553c12046e5ca4de40b7 /captain
parent14441b7f0d6dd0a101b38a4500fe1f662ae00215 (diff)
downloadlevitating-05b91a7ca0aace044621d8db1e82f4772181d893.tar.gz
levitating-05b91a7ca0aace044621d8db1e82f4772181d893.zip
Fixed binary transfers to maintain file integrity. Added globbed file upload capabilities. Fixed memory overrun issues due to problems parsing ls output.
Diffstat (limited to 'captain')
-rw-r--r--captain/response.f9019
1 files changed, 14 insertions, 5 deletions
diff --git a/captain/response.f90 b/captain/response.f90
index 09184f9..5a81411 100644
--- a/captain/response.f90
+++ b/captain/response.f90
@@ -426,26 +426,35 @@ contains
character(*), intent(in)::filename
integer::unum
- character, dimension(64)::buf
+ character(len=1), dimension(64)::buf
integer::bufread
- integer(kind=8)::bytes_to_go
+ integer(kind=8)::bytes_to_go, written
integer::i
- character(128)::msg
+ !character(128)::msg
- open(newunit=unum, file=filename, status="unknown", action="write", access="stream", form="formatted")
+ open(newunit=unum, file=filename, status="unknown", action="write", access='stream')
bytes_to_go = self%size
+ written = 0
do while(bytes_to_go > 0)
bufread = ssl_read(self%ssl_connection, buf)
bytes_to_go = bytes_to_go - bufread
+
+ !write(msg, '(A5, 1X, I8, 3X, A5, 1X, I8)') "READ:", bufread, "TOGO:", bytes_to_go
+ !call write_log(trim(msg))
+
do i = 1, bufread
- write(unum, '(A1)', advance='no') buf(i)
+ !write(unum, '(A1)', advance='no') buf(i)
+ write(unum) buf(i)
+ written = written + 1
end do
end do
+ !write(msg, '(A8, 1X, I8, 3x, A5, 1X, I8)') "WRITTEN:", written, "LAST:", ichar(buf(1))
+ !call write_log(trim(msg))
close(unum)
end subroutine titan_write_to_filename