From 39ffbee1a6f6aa13c504512491599925512ca38d Mon Sep 17 00:00:00 2001 From: cage Date: Sat, 19 Feb 2022 13:21:06 +0100 Subject: [PATCH] - prevented reusing an already clunked fid when uploading a file. --- etc/init.lisp | 10 ---------- src/kami/client.lisp | 11 +++++++---- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/etc/init.lisp b/etc/init.lisp index 6d5f07d..e8259e4 100644 --- a/etc/init.lisp +++ b/etc/init.lisp @@ -195,16 +195,6 @@ (define-key "M-l" #'load-script-file) -;; focus - -(define-key "f1" #'focus-to-tags-window) - -(define-key "f2" #'focus-to-thread-window) - -(define-key "f3" #'focus-to-message-window) - -(define-key "f4" #'focus-to-conversations-window) - ;; follow requests keymap (define-key "up" #'follow-request-go-up *follow-requests-keymap*) diff --git a/src/kami/client.lisp b/src/kami/client.lisp index f9163ee..ec66f77 100644 --- a/src/kami/client.lisp +++ b/src/kami/client.lisp @@ -138,7 +138,7 @@ :element-type +octect-type+) (with-cloned-root-fid (*stream* cloned-root-fid) (9p:remove-path *stream* cloned-root-fid destination-path)) - (with-cloned-root-fid (*stream* cloned-root-fid) + (with-cloned-root-fid (*stream* cloned-root-fid :clunk-cloned-fid nil) (let* ((buffer (misc:make-array-frame +download-buffer+ 0 +octect-type+ t)) (fid (9p:create-path *stream* cloned-root-fid destination-path))) (loop named write-loop @@ -149,9 +149,12 @@ (9p:9p-write *stream* fid offset (subseq buffer 0 read-so-far)) (when (< read-so-far +download-buffer+) (return-from write-loop t))) - (9p:9p-clunk *stream* fid) - (9p:change-mode *stream* *root-fid* destination-path source-permissions) - (9p:read-all-pending-messages stream)))))))) + (9p:9p-clunk *stream* fid))) + (with-cloned-root-fid (*stream* cloned-root-fid) + (9p:change-mode *stream* + cloned-root-fid + destination-path source-permissions) + (9p:read-all-pending-messages stream))))))) (defun query-path (stream root-fid) (lambda (path what)