From c493170e73506e974a0644452fc5a334c08171bc Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Wed, 7 Apr 2021 14:21:35 -0400 Subject: Fixed many issues related to reporting status. Initial debugging of titan upload handling. --- common/protocol.f90 | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'common/protocol.f90') diff --git a/common/protocol.f90 b/common/protocol.f90 index 3b4a8a3..38f2cf1 100644 --- a/common/protocol.f90 +++ b/common/protocol.f90 @@ -149,12 +149,11 @@ contains response_line_completed = .false. response_line = " " response_line_index = 0 - + bytes_received = retrieve_characters(conn%ssl, buffer) do while(bytes_received > 0) do i=1, bytes_received - if(.not. response_line_completed) then response_line_index = response_line_index + 1 response_line(response_line_index:response_line_index) = buffer(i) @@ -260,7 +259,7 @@ contains successes(3) = send_string(conn%ssl, ";mime=application/octet-stream", trimming=.false.) end if - write(file_length_text, *) file_length + write(file_length_text, '(I14)') file_length file_length_text = adjustl(file_length_text) successes(4) = send_string(conn%ssl, ";size="//trim(file_length_text)//c_carriage_return//c_new_line, trimming=.false.) @@ -268,10 +267,14 @@ contains total_written = 0 bytes_read = read_into_buffer(unit_number, buffer) + + Print *, "bytes read for sending: ", bytes_read + do while(bytes_read > 0) - bytes_written = ssl_write(conn%ssl, buffer) + 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 @@ -344,10 +347,7 @@ contains character(*), intent(in)::path integer::past_protocol, first_slash, last_slash - - ! For debugging - ! Print *, "*** Requested path is '"//trim(path)//"'" - + past_protocol = index(current_url, "://") if(path(1:2) == "//") then @@ -388,9 +388,7 @@ contains logical, intent(in), optional::once integer::i,j - - ! Print *, "*** Replacement: string='"//trim(string)//"' Pattern='"//pattern//"'" - + i = index(string, pattern) do while(i > 0) j = i + len(pattern) ! First character after match -- cgit v1.2.3