From da18f8827fee258e8a8ba63dd55b94ba1a712a9c Mon Sep 17 00:00:00 2001 From: Peter Denison Date: Thu, 22 May 2008 16:56:30 +0000 Subject: [PATCH] temporary fix for ftp communication to xps from fast machines. Previously it was cutting the messages short, this fix waits for the xps to respond fully to the FIRST command before continuing. This needs to be done properly in other places --- motorApp/NewportSrc/xps_ftp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/motorApp/NewportSrc/xps_ftp.c b/motorApp/NewportSrc/xps_ftp.c index 262cb851..8f079657 100644 --- a/motorApp/NewportSrc/xps_ftp.c +++ b/motorApp/NewportSrc/xps_ftp.c @@ -46,8 +46,10 @@ int ftpConnect (char* ip, char* login, char* password, int* socketFD) if (connect(sockFD, (struct sockaddr *)&sockAddr, sizeof(sockAddr)) < 0) return -1; - - receivedBytes = recv(sockFD, returnString, RETURN_SIZE, 0); + do { + receivedBytes = recv(sockFD, returnString, RETURN_SIZE, 0); + } + while (strchr(returnString,'\n')==NULL); /* login */ sprintf(command, "USER %s", login);