summaryrefslogtreecommitdiff
path: root/noncore/net
Unidiff
Diffstat (limited to 'noncore/net') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/ftplib/ftplib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/net/ftplib/ftplib.c b/noncore/net/ftplib/ftplib.c
index 421f855..efcd6f0 100644
--- a/noncore/net/ftplib/ftplib.c
+++ b/noncore/net/ftplib/ftplib.c
@@ -955,13 +955,14 @@ GLOBALDEF int FtpWrite(void *buf, int len, netbuf *nData)
955 if (nData->dir != FTPLIB_WRITE) 955 if (nData->dir != FTPLIB_WRITE)
956 return 0; 956 return 0;
957 if (nData->buf) 957 if (nData->buf)
958 i = writeline(buf, len, nData); 958 i = writeline(buf, len, nData);
959 else 959 else
960 { 960 {
961 socket_wait(nData); 961 if (socket_wait(nData) < 0)
962 fprintf(stderr, "FtpWrite: socket_wait failed with %s\n", nData->ctrl->response);
962 i = net_write(nData->handle, buf, len); 963 i = net_write(nData->handle, buf, len);
963 } 964 }
964 if (i == -1) 965 if (i == -1)
965 return 0; 966 return 0;
966 nData->xfered += i; 967 nData->xfered += i;
967 if (nData->idlecb && nData->cbbytes) 968 if (nData->idlecb && nData->cbbytes)
@@ -1336,11 +1337,14 @@ GLOBALDEF int FtpDelete(const char *fnm, netbuf *nControl)
1336 * return 1 if successful, 0 otherwise 1337 * return 1 if successful, 0 otherwise
1337 */ 1338 */
1338GLOBALDEF void FtpQuit(netbuf *nControl) 1339GLOBALDEF void FtpQuit(netbuf *nControl)
1339{ 1340{
1340 if (nControl->dir != FTPLIB_CONTROL) 1341 if (nControl->dir != FTPLIB_CONTROL)
1341 return; 1342 return;
1342 FtpSendCmd("QUIT",'2',nControl); 1343 if (FtpSendCmd("QUIT",'2',nControl) == 1) {
1344 if (ftplib_debug > 2)
1345 fprintf(stderr, "FtpQuit: FtpSendCmd(QUIT) failed\n");
1346 }
1343 net_close(nControl->handle); 1347 net_close(nControl->handle);
1344 free(nControl->buf); 1348 free(nControl->buf);
1345 free(nControl); 1349 free(nControl);
1346} 1350}