aboutsummaryrefslogtreecommitdiff
path: root/captain
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 /captain
parentc493170e73506e974a0644452fc5a334c08171bc (diff)
downloadlevitating-85a6816e7840e6b8cdff51b7c0cfad36082c01ec.tar.gz
levitating-85a6816e7840e6b8cdff51b7c0cfad36082c01ec.zip
Results now posted back correctly using titan protocol
Diffstat (limited to 'captain')
-rw-r--r--captain/response.f9024
1 files changed, 16 insertions, 8 deletions
diff --git a/captain/response.f90 b/captain/response.f90
index 1c7a0b5..9cd2d9f 100644
--- a/captain/response.f90
+++ b/captain/response.f90
@@ -140,8 +140,6 @@ contains
do while(i /= i_last .and. j < i_component)
j = j + 1
- call write_log("RC: "//self%location(i:n))
-
i_last = i
i = index(self%location(i_last+1:n), "/")
i = i_last + i
@@ -151,7 +149,6 @@ contains
if(j == i_component) then
if(i == i_last) then
res = self%location(i_last+1:n)
- call write_log("Last! "//trim(res))
else
res = self%location(i_last+1:i-1)
end if
@@ -389,8 +386,8 @@ contains
self%location = regular_request%location(1:i-1)
size_text => titan_get_request_value(regular_request%location, "size")
- read(size_text, *, iostat=ierr) self%size
- if(ierr <= 0) then
+ read(size_text, '(I16)', iostat=ierr) self%size
+ if(ierr /= 0) then
self%size = 0
end if
deallocate(size_text)
@@ -420,6 +417,7 @@ contains
subroutine titan_write_to_filename(self, filename)
use jessl, only: ssl_read
+ use logging
implicit none
class(titan_request)::self
@@ -432,16 +430,26 @@ contains
integer(kind=8)::bytes_to_go
integer::i
- open(newunit=unum, file=filename, status="unknown", action="write", access="stream")
+ character(128)::msg
+
+ open(newunit=unum, file=filename, status="unknown", action="write", access="stream", form="formatted")
bytes_to_go = self%size
-
+ call write_log("Writing!")
+
do while(bytes_to_go > 0)
bufread = ssl_read(self%ssl_connection, buf)
bytes_to_go = bytes_to_go - bufread
+ write(msg, *) "read: ", bufread
+ call write_log(trim(msg))
+
+ write(msg, *) "remaining: ", bytes_to_go
+ call write_log(trim(msg))
+
+
do i = 1, bufread
- write(unum, '(A1)', advance='no') buf(i:i)
+ write(unum, '(A1)', advance='no') buf(i)
end do
end do