comparison lisp/erc/erc-dcc.el @ 75259:f45c5edf0be4

Merge from erc--main--0 Highlights: - Display messages starting with "/" but are not commands correctly. - Add erc-capab.el file, with capab-identify module. - Fix various ERC menu bugs and add "Current channel" submenu. - Make header-line display look nicer. - Fix warning when auto-authenticating to bitlbee. - New option erc-system-name allows the hostname next to your nick to be customized. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-599 Creator: Michael Olson <mwolson@gnu.org>
author Miles Bader <miles@gnu.org>
date Wed, 17 Jan 2007 18:17:25 +0000
parents e9bc018298b2
children 7a3f13e2dd57
comparison
equal deleted inserted replaced
75258:38cd68f9ba51 75259:f45c5edf0be4
861 It reads incoming bytes from the network and stores them in the DCC 861 It reads incoming bytes from the network and stores them in the DCC
862 buffer, and sends back the replies after each block of data per the DCC 862 buffer, and sends back the replies after each block of data per the DCC
863 protocol spec. Well not really. We write back a reply after each read, 863 protocol spec. Well not really. We write back a reply after each read,
864 rather than every 1024 byte block, but nobody seems to care." 864 rather than every 1024 byte block, but nobody seems to care."
865 (with-current-buffer (process-buffer proc) 865 (with-current-buffer (process-buffer proc)
866 (setq buffer-read-only nil) ;; FIXME 866 (let ((inhibit-read-only t))
867 (goto-char (point-max)) 867 (goto-char (point-max))
868 (insert (string-make-unibyte str)) 868 (insert (string-make-unibyte str))
869 869
870 (setq erc-dcc-byte-count (+ (length str) erc-dcc-byte-count)) 870 (setq erc-dcc-byte-count (+ (length str) erc-dcc-byte-count))
871 (erc-assert (= erc-dcc-byte-count (1- (point-max)))) 871 (erc-assert (= erc-dcc-byte-count (1- (point-max))))
872 (and erc-verbose-dcc 872 (and erc-verbose-dcc
873 (erc-display-message 873 (erc-display-message
874 nil 'notice erc-server-process 874 nil 'notice erc-server-process
875 'dcc-get-bytes-received 875 'dcc-get-bytes-received
876 ?f (file-name-nondirectory buffer-file-name) 876 ?f (file-name-nondirectory buffer-file-name)
877 ?b (number-to-string erc-dcc-byte-count))) 877 ?b (number-to-string erc-dcc-byte-count)))
878 (cond 878 (cond
879 ((and (> (plist-get erc-dcc-entry-data :size) 0) 879 ((and (> (plist-get erc-dcc-entry-data :size) 0)
880 (> erc-dcc-byte-count (plist-get erc-dcc-entry-data :size))) 880 (> erc-dcc-byte-count (plist-get erc-dcc-entry-data :size)))
881 (erc-display-message 881 (erc-display-message
882 nil '(error notice) 'active 882 nil '(error notice) 'active
883 'dcc-get-file-too-long 883 'dcc-get-file-too-long
884 ?f (file-name-nondirectory buffer-file-name)) 884 ?f (file-name-nondirectory buffer-file-name))
885 (delete-process proc)) 885 (delete-process proc))
886 (t 886 (t
887 (process-send-string 887 (process-send-string
888 proc (erc-pack-int erc-dcc-byte-count 4)))))) 888 proc (erc-pack-int erc-dcc-byte-count 4)))))))
889 889
890 890
891 (defun erc-dcc-get-sentinel (proc event) 891 (defun erc-dcc-get-sentinel (proc event)
892 "This is the process sentinel for CTCP DCC SEND connections. 892 "This is the process sentinel for CTCP DCC SEND connections.
893 It shuts down the connection and notifies the user that the 893 It shuts down the connection and notifies the user that the