aboutsummaryrefslogtreecommitdiff
path: root/request.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-05-17 10:44:21 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-05-17 10:44:21 -0400
commit0d268753686d1b5c3930db64eca508b27fc9b7a8 (patch)
tree874f3a06adc61dedc7b55cd68b99fa0d6f065fc1 /request.f90
parenta4de5b27c2ce9aca1516b13ad9c70a51f9bd06ff (diff)
downloadLR-87-0d268753686d1b5c3930db64eca508b27fc9b7a8.zip
LR-87-0d268753686d1b5c3930db64eca508b27fc9b7a8.tar.gz
Fixed handling of server urls if a port is specified.
Diffstat (limited to 'request.f90')
-rw-r--r--request.f9019
1 files changed, 18 insertions, 1 deletions
diff --git a/request.f90 b/request.f90
index 7308a9e..ec35772 100644
--- a/request.f90
+++ b/request.f90
@@ -164,13 +164,17 @@ contains
end subroutine close_connection
- subroutine get_server_from_url(url, server)
+ subroutine get_server_from_url(url, server, port)
implicit none
character(*), intent(in)::url
character(:), allocatable, intent(out)::server
+ integer, intent(out)::port
integer::start_server, end_server, length
+ integer::start_port, iostatus
+
+ port = -1
start_server = index(url, "://")
if(start_server > 0) then
@@ -189,6 +193,19 @@ contains
server = url(start_server:end_server)
end if
+
+ ! Need to check if a port was specified too
+ start_port = index(server, ":")
+ if(start_port > 0) then
+
+ read(server(start_port+1:len_trim(server)), *, iostat=iostatus) port
+ if(iostatus /= 0) then
+ port = -1
+ end if
+
+ server = server(1:start_port-1)
+
+ end if
end subroutine get_server_from_url