comparison src/uicommon/gftpui.c @ 858:10e2ce91e26c

2006-11-30 Brian Masney <masneyb@gftp.org> * lib/rfc959.c lib/sshv2.c src/uicommon/gftpui.c - don't abort the entire file transfer if there is a permission denied at some point during the file transfer. Give the user an error at the very end if there were any errors. (closes #328550)
author masneyb
date Fri, 01 Dec 2006 00:57:50 +0000
parents 94f87e3c92b2
children 885038cb945b
comparison
equal deleted inserted replaced
857:5ba7622df358 858:10e2ce91e26c
1460 1460
1461 1461
1462 static int 1462 static int
1463 _gftpui_common_trans_file_or_dir (gftp_transfer * tdata) 1463 _gftpui_common_trans_file_or_dir (gftp_transfer * tdata)
1464 { 1464 {
1465 int tofd, fromfd, ret;
1465 gftp_file * curfle; 1466 gftp_file * curfle;
1466 int tofd, fromfd;
1467 int ret;
1468 1467
1469 if (g_thread_supported ()) 1468 if (g_thread_supported ())
1470 g_static_mutex_lock (&tdata->structmutex); 1469 g_static_mutex_lock (&tdata->structmutex);
1471 1470
1472 curfle = tdata->curfle->data; 1471 curfle = tdata->curfle->data;
1550 1549
1551 1550
1552 int 1551 int
1553 gftpui_common_transfer_files (gftp_transfer * tdata) 1552 gftpui_common_transfer_files (gftp_transfer * tdata)
1554 { 1553 {
1555 int ret; 1554 int ret, skipped_files;
1556 1555
1557 tdata->curfle = tdata->files; 1556 tdata->curfle = tdata->files;
1558 gettimeofday (&tdata->starttime, NULL); 1557 gettimeofday (&tdata->starttime, NULL);
1559 memcpy (&tdata->lasttime, &tdata->starttime, sizeof (tdata->lasttime)); 1558 memcpy (&tdata->lasttime, &tdata->starttime, sizeof (tdata->lasttime));
1560 1559
1560 skipped_files = 0;
1561 while (tdata->curfle != NULL) 1561 while (tdata->curfle != NULL)
1562 { 1562 {
1563 ret = _gftpui_common_trans_file_or_dir (tdata); 1563 ret = _gftpui_common_trans_file_or_dir (tdata);
1564 if (tdata->cancel) 1564 if (tdata->cancel)
1565 { 1565 {
1567 gftp_disconnect (tdata->toreq); 1567 gftp_disconnect (tdata->toreq);
1568 1568
1569 if (gftp_abort_transfer (tdata->fromreq) != 0) 1569 if (gftp_abort_transfer (tdata->fromreq) != 0)
1570 gftp_disconnect (tdata->fromreq); 1570 gftp_disconnect (tdata->fromreq);
1571 } 1571 }
1572 else if (ret == GFTP_EFATAL)
1573 skipped_files++;
1572 else if (ret < 0) 1574 else if (ret < 0)
1573 { 1575 {
1574 if (gftp_get_transfer_status (tdata, ret) == GFTP_ERETRYABLE) 1576 if (gftp_get_transfer_status (tdata, ret) == GFTP_ERETRYABLE)
1575 continue; 1577 continue;
1576 1578
1588 tdata->fromreq->cancel = 0; 1590 tdata->fromreq->cancel = 0;
1589 tdata->toreq->cancel = 0; 1591 tdata->toreq->cancel = 0;
1590 } 1592 }
1591 } 1593 }
1592 1594
1595 if (skipped_files)
1596 tdata->fromreq->logging_function (gftp_logging_error, tdata->fromreq,
1597 _("There were %d files or directories that could not be transferred. Check the log for which items were not properly transferred."),
1598 skipped_files);
1599
1593 tdata->done = 1; 1600 tdata->done = 1;
1594 return (1); 1601 return (1);
1595 } 1602 }
1596 1603
1597 1604