[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp (2.0.14); tramp hangs when storing files >1000 bytes

From: Kai Großjohann
Subject: Re: tramp (2.0.14); tramp hangs when storing files >1000 bytes
Date: Thu, 05 Sep 2002 18:17:46 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Bjørn Nordbø <address@hidden> writes:

> I would like to edit files on a box on our internal network going through
> a bastion host. It seems to work fine for very small files, but for slightly
> larger files tramp hangs when I try to save the file. The limit seems to go
> very close to 1000 bytes.

I have no idea what might be the problem, but I have an idea that
maybe it's possible to work around it.  I have written the following
patch which allows you to send the file to the remote host "slower".

If you do (setq tramp-chunksize 500), then files will be sent to the
remote host in pieces of 500 bytes and Tramp will wait for 0.1
seconds after each chunk before sending the next one.

Does this help?  Maybe you could try different values for
tramp-chunksize.  Maybe you could also try to replace (sleep-for 0.1)
there with (sleep-for 1) or so.  The number is the number of seconds
to wait between chunks.

cvs server: Diffing .
cvs server: Diffing contrib
cvs server: Diffing lisp
Index: lisp/ChangeLog
RCS file: /cvsroot/tramp/tramp/lisp/ChangeLog,v
retrieving revision 2.183
diff -u -r2.183 ChangeLog
--- lisp/ChangeLog      3 Sep 2002 12:50:21 -0000       2.183
+++ lisp/ChangeLog      5 Sep 2002 16:14:20 -0000
@@ -1,3 +1,9 @@
+2002-09-05  Kai Großjohann  <address@hidden>
+       * tramp.el (tramp-chunksize): New kluge variable.
+       (tramp-send-region): If tramp-chunksize is non-nil, send region
+       in parts and sleep 0.1 seconds between chunks.
 2002-09-03  Kai Großjohann  <address@hidden>
        * tramp.el (tramp-handle-insert-directory): Use
Index: lisp/tramp.el
RCS file: /cvsroot/tramp/tramp/lisp/tramp.el,v
retrieving revision 2.191
diff -u -r2.191 tramp.el
--- lisp/tramp.el       3 Sep 2002 12:50:21 -0000       2.191
+++ lisp/tramp.el       5 Sep 2002 16:14:20 -0000
@@ -4803,6 +4803,10 @@
     (pop-to-buffer (current-buffer))
     (funcall 'signal signal (apply 'format fmt args))))
+;; Chunked sending kluge.
+(defvar tramp-chunksize nil
+  "If non-nil, chunksize for sending things to remote host.")
 (defun tramp-send-region (multi-method method user host start end)
   "Send the region from START to END to remote command
 running as USER on HOST using METHOD."
@@ -4810,7 +4814,19 @@
                (tramp-get-buffer multi-method method user host))))
     (unless proc
       (error "Can't send region to remote host -- not logged in"))
-    (process-send-region proc start end)
+    (if tramp-chunksize
+       (let ((pos start))
+         (while (< pos end)
+           (tramp-message-for-buffer
+            multi-method method user host 10
+            "Sending chunk from %s to %s" pos end)
+           (process-send-region proc
+                                pos
+                                (min (+ pos tramp-chunksize)
+                                     end))
+           (setq pos (+ pos tramp-chunksize))
+           (sleep-for 0.1)))
+      (process-send-region proc start end))
     (when tramp-debug-buffer
        (tramp-get-debug-buffer multi-method method user host)
cvs server: Diffing test
cvs server: Diffing texi
cvs server: Diffing tramp2

A large number of young women don't trust men with beards.  (BFBS Radio)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]