diff lib/protocols.c @ 294:4747f621b79b

2003-10-25 Brian Masney <masneyb@gftp.org> * src/gtk/transfer.c src/gtk/gftp-gtk.h src/gtk/view_dialog.c - when editing a remote file, if the user chooses to upload the changes, make sure the upload is not sent to the current directory on the remote server. * lib/rfc2068.c - set the shown attributes to be -rw------- instead of ----------. The HTTP server doesn't send the attributes over, so I just have to make something up. * src/gtk/options_dialog.c - make sure all of the tooltips text is passed to gettext() * lib/protocols.c - if the file transfer is to be throttled, only display the throttle message once. * lib/local.c (local_get_next_file) - if the file is a symlink, grab file size and attributes from the file this symlink points to.
author masneyb
date Sat, 25 Oct 2003 21:33:46 +0000
parents 265244924868
children 3b9d5797050f
line wrap: on
line diff
--- a/lib/protocols.c	Wed Oct 22 20:27:23 2003 +0000
+++ b/lib/protocols.c	Sat Oct 25 21:33:46 2003 +0000
@@ -157,18 +157,8 @@
 gftp_get_file (gftp_request * request, const char *filename, int fd,
                off_t startsize)
 {
-  float maxkbs;
-
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
 
-  gftp_lookup_request_option (request, "maxkbs", &maxkbs);
-  if (maxkbs > 0)
-    {
-      request->logging_function (gftp_logging_misc, request,
-                    _("File transfer will be throttled to %.2f KB/s\n"),
-                    maxkbs);
-    }
-
   request->cached = 0;
   if (request->get_file == NULL)
     return (GFTP_EFATAL);
@@ -181,19 +171,8 @@
 gftp_put_file (gftp_request * request, const char *filename, int fd,
                off_t startsize, off_t totalsize)
 {
-  float maxkbs;
-
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
 
-  gftp_lookup_request_option (request, "maxkbs", &maxkbs);
-
-  if (maxkbs > 0)
-    {
-      request->logging_function (gftp_logging_misc, request,
-                    _("File transfer will be throttled to %.2f KB/s\n"), 
-                    maxkbs);
-    }
-
   request->cached = 0;
   if (request->put_file == NULL)
     return (GFTP_EFATAL);
@@ -207,6 +186,7 @@
                     gftp_request * toreq, const char *tofile,
                     int tofd, off_t tosize)
 {
+  float maxkbs;
   off_t size;
   int ret;
 
@@ -215,6 +195,14 @@
   g_return_val_if_fail (toreq != NULL, GFTP_EFATAL);
   g_return_val_if_fail (tofile != NULL, GFTP_EFATAL);
 
+  gftp_lookup_request_option (toreq, "maxkbs", &maxkbs);
+  if (maxkbs > 0)
+    {
+      toreq->logging_function (gftp_logging_misc, toreq,
+                    _("File transfer will be throttled to %.2f KB/s\n"), 
+                    maxkbs);
+    }
+
   if (fromreq->protonum == toreq->protonum &&
       fromreq->transfer_file != NULL)
     return (fromreq->transfer_file (fromreq, fromfile, fromsize, toreq,