aboutsummaryrefslogtreecommitdiff
path: root/captain
diff options
context:
space:
mode:
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