Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Matyas Selmeci
49cb77dbc2 Add patch to avoid hanging when command socket disconnects 2020-01-09 16:26:53 +01:00
Matyas Selmeci
19a64e13f2 Add patch to avoid hanging when command socket disconnects 2019-12-26 14:00:53 -06:00
2 changed files with 39 additions and 1 deletions

31
disconnected_server.patch Normal file
View file

@ -0,0 +1,31 @@
From 4c1cb01d712923c63f23a975eec13170aa57d992 Mon Sep 17 00:00:00 2001
From: Brian Bockelman <bbockelman@morgridge.org>
Date: Thu, 26 Dec 2019 13:34:02 -0600
Subject: [PATCH] Prevent uberftp from hanging when the command socket closes
---
ftp.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ftp.c b/ftp.c
index 3c65d18..dfd4739 100644
--- a/ftp.c
+++ b/ftp.c
@@ -2742,6 +2742,14 @@ _f_get_resp(fh_t * fh, int * code, char ** resp)
FREE(cptr);
}
+ /* There was no command sent and the server side closed the socket. */
+ if (!nl && fh->cc.eof)
+ {
+ ec = ec_create(EC_GSI_SUCCESS,
+ EC_GSI_SUCCESS,
+ "Server unexpectedly closed the socket.");
+ }
+
if (!ec && *code == 421)
{
ec = ec_create(EC_GSI_SUCCESS,
--
2.21.0

View file

@ -6,7 +6,7 @@
Name: uberftp
Version: 2.8
Release: 2%{?dist}
Release: 3%{?dist}
Summary: GridFTP-enabled ftp client
Group: Applications/Internet
@ -16,6 +16,9 @@ URL: https://github.com/JasonAlt/UberFTP
Source0: https://github.com/JasonAlt/UberFTP/archive/%{commit}/UberFTP-%{commit}.tar.gz
# https://github.com/JasonAlt/UberFTP/pull/6
Patch0: uberftp-32bit-pkg-config.patch
# Current upstream is now archived but hopefully a new one will appear soon.
# https://mailman.egi.eu/pipermail/discuss/2019-March/000273.html
Patch1: disconnected_server.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: globus-gssapi-gsi-devel
@ -30,6 +33,7 @@ third party transfers.
iconv -f iso8859-1 -t utf-8 copyright > copyright.conv && mv -f copyright.conv copyright
touch -r configure.ac x
%patch0 -p1
%patch1 -p1
touch -r x configure.ac
%build
@ -49,6 +53,9 @@ rm -rf $RPM_BUILD_ROOT
%doc Changelog.mssftp Changelog copyright
%changelog
* Thu Jan 9 2020 Mátyás Selmeci <matyas@cs.wisc.edu> - 2.8-3
- Add patch to prevent hanging when command socket closes
* Mon Sep 29 2014 Mattias Ellert <mattias.ellert@fysast.uu.se> - 2.8-2
- Adapt to Globus Toolkit 6.0