diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-04-07 14:21:35 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-04-07 14:21:35 -0400 |
commit | c493170e73506e974a0644452fc5a334c08171bc (patch) | |
tree | 7cfbbde04f5e3263092118dbabf843fbe68d93ad /common | |
parent | 1de4bd52574599452f9e92c8e36381a4797563fb (diff) | |
download | levitating-c493170e73506e974a0644452fc5a334c08171bc.tar.gz levitating-c493170e73506e974a0644452fc5a334c08171bc.zip |
Fixed many issues related to reporting status. Initial debugging of titan upload handling.
Diffstat (limited to 'common')
-rw-r--r-- | common/jessl.f90 | 2 | ||||
-rw-r--r-- | common/network.F90 | 2 | ||||
-rw-r--r-- | common/protocol.f90 | 20 | ||||
-rw-r--r-- | common/utilities.F90 | 11 |
4 files changed, 14 insertions, 21 deletions
diff --git a/common/jessl.f90 b/common/jessl.f90 index 223fd14..a03df09 100644 --- a/common/jessl.f90 +++ b/common/jessl.f90 @@ -208,7 +208,7 @@ contains implicit none type(c_ptr)::ssl - character, dimension(:), intent(inout)::buf + character, dimension(:), intent(out)::buf integer::ssl_read integer::bufsize diff --git a/common/network.F90 b/common/network.F90 index 860830b..f986275 100644 --- a/common/network.F90 +++ b/common/network.F90 @@ -238,8 +238,6 @@ implicit none type(sockaddr_in), target::sock_addr logical::connect - !print *, c_sizeof(sock_addr) - connect = (connect_c(int(sockfd, kind=c_int), & c_loc(sock_addr), & sockaddr_size) .eq. 0) 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 diff --git a/common/utilities.F90 b/common/utilities.F90 index d4b7b81..cd32610 100644 --- a/common/utilities.F90 +++ b/common/utilities.F90 @@ -56,7 +56,7 @@ contains integer, intent(in)::unit_number integer, intent(in), dimension(8)::values - write(unit_number, '(I4, A1, I2, A1, I2, 1X, I2, A1, I2, A1, I2)') & + write(unit_number, '(I4, A1, I0.2, A1, I0.2, 1X, I2, A1, I0.2, A1, I0.2)') & values(1), "-", & values(2), "-", & values(3), & @@ -207,6 +207,7 @@ contains write(num_text, *) abs(rnum) fullpath = "/tmp/lv."//trim(adjustl(num_text))//".tmp" + !call write_log("My temp filename is: '"//trim(fullpath)//"'") #endif end function generate_temporary_filename @@ -239,9 +240,7 @@ contains length_estimate = len_trim(str) + len_trim(val) allocate(character(len=length_estimate) :: holding) holding = " " - - print *, trim(str) - + ! Find the field field_location = index(str, "{"//trim(field)//"}") if(field_location > 0) then @@ -253,9 +252,7 @@ contains str = holding end if - - print *, trim(str) - + deallocate(holding) end subroutine replace_field_text |