aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-06-06 22:17:53 +0000
committerKim F. Storm2004-06-06 22:17:53 +0000
commit116c423ca59a5d2a19827ada0cb0312d731fc0ac (patch)
tree922deec14fe03768c186f8a5fe85a2e436c3b1cc /src
parent60ce1c586f5ee63431044db00eac5e2fba6e01cb (diff)
downloademacs-116c423ca59a5d2a19827ada0cb0312d731fc0ac.tar.gz
emacs-116c423ca59a5d2a19827ada0cb0312d731fc0ac.zip
(Fdelete_process): Undo 2004-05-28 change.
Instead, call status_notify also for network process. (status_message): Use process instead of status as arg. Give messages "deleted" or "connection broken by remote peer" for an exited network process. (status_notify): Change call to status_message. (read_process_output): Increase readmax to 4096. Do not increase buffer size for datagram channels (default is now large enough).
Diffstat (limited to 'src')
-rw-r--r--src/process.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/src/process.c b/src/process.c
index a19880fc4f6..92200045022 100644
--- a/src/process.c
+++ b/src/process.c
@@ -445,10 +445,11 @@ decode_status (l, symbol, code, coredump)
445 445
446/* Return a string describing a process status list. */ 446/* Return a string describing a process status list. */
447 447
448Lisp_Object 448static Lisp_Object
449status_message (status) 449status_message (p)
450 Lisp_Object status; 450 struct Lisp_Process *p;
451{ 451{
452 Lisp_Object status = p->status;
452 Lisp_Object symbol; 453 Lisp_Object symbol;
453 int code, coredump; 454 int code, coredump;
454 Lisp_Object string, string2; 455 Lisp_Object string, string2;
@@ -469,6 +470,8 @@ status_message (status)
469 } 470 }
470 else if (EQ (symbol, Qexit)) 471 else if (EQ (symbol, Qexit))
471 { 472 {
473 if (NETCONN1_P (p))
474 return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n");
472 if (code == 0) 475 if (code == 0)
473 return build_string ("finished\n"); 476 return build_string ("finished\n");
474 string = Fnumber_to_string (make_number (code)); 477 string = Fnumber_to_string (make_number (code));
@@ -764,6 +767,7 @@ nil, indicating the current buffer's process. */)
764 { 767 {
765 XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); 768 XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), Qnil));
766 XSETINT (XPROCESS (process)->tick, ++process_tick); 769 XSETINT (XPROCESS (process)->tick, ++process_tick);
770 status_notify ();
767 } 771 }
768 else if (XINT (XPROCESS (process)->infd) >= 0) 772 else if (XINT (XPROCESS (process)->infd) >= 0)
769 { 773 {
@@ -774,18 +778,7 @@ nil, indicating the current buffer's process. */)
774 XSETINT (XPROCESS (process)->tick, ++process_tick); 778 XSETINT (XPROCESS (process)->tick, ++process_tick);
775 status_notify (); 779 status_notify ();
776 } 780 }
777 /* Do not call remove_process here; either status_notify has already done 781 remove_process (process);
778 it, or will do so the next time emacs polls for input. Thus network
779 processes are not immediately removed, and their sentinel will be
780 called.
781
782 Since Fdelete_process is called by kill_buffer_processes, this also
783 means that a network process sentinel will run after the buffer is
784 dead, which would not be the case if status_notify() were called
785 unconditionally here. This way process sentinels observe consistent
786 behavior with regard to buffer-live-p.
787 */
788 /* remove_process (process); */
789 return Qnil; 782 return Qnil;
790} 783}
791 784
@@ -4703,7 +4696,7 @@ read_process_output_error_handler (error)
4703 starting with our buffered-ahead character if we have one. 4696 starting with our buffered-ahead character if we have one.
4704 Yield number of decoded characters read. 4697 Yield number of decoded characters read.
4705 4698
4706 This function reads at most 1024 characters. 4699 This function reads at most 4096 characters.
4707 If you want to read all available subprocess output, 4700 If you want to read all available subprocess output,
4708 you must call it repeatedly until it returns zero. 4701 you must call it repeatedly until it returns zero.
4709 4702
@@ -4723,7 +4716,7 @@ read_process_output (proc, channel)
4723 register int opoint; 4716 register int opoint;
4724 struct coding_system *coding = proc_decode_coding_system[channel]; 4717 struct coding_system *coding = proc_decode_coding_system[channel];
4725 int carryover = XINT (p->decoding_carryover); 4718 int carryover = XINT (p->decoding_carryover);
4726 int readmax = 1024; 4719 int readmax = 4096;
4727 4720
4728#ifdef VMS 4721#ifdef VMS
4729 VMS_PROC_STUFF *vs, *get_vms_process_pointer(); 4722 VMS_PROC_STUFF *vs, *get_vms_process_pointer();
@@ -4756,16 +4749,6 @@ read_process_output (proc, channel)
4756 } 4749 }
4757#else /* not VMS */ 4750#else /* not VMS */
4758 4751
4759#ifdef DATAGRAM_SOCKETS
4760 /* A datagram is one packet; allow at least 1500+ bytes of data
4761 corresponding to the typical Ethernet frame size. */
4762 if (DATAGRAM_CHAN_P (channel))
4763 {
4764 /* carryover = 0; */ /* Does carryover make sense for datagrams? */
4765 readmax += 1024;
4766 }
4767#endif
4768
4769 chars = (char *) alloca (carryover + readmax); 4752 chars = (char *) alloca (carryover + readmax);
4770 if (carryover) 4753 if (carryover)
4771 /* See the comment above. */ 4754 /* See the comment above. */
@@ -6399,7 +6382,7 @@ status_notify ()
6399 /* Get the text to use for the message. */ 6382 /* Get the text to use for the message. */
6400 if (!NILP (p->raw_status_low)) 6383 if (!NILP (p->raw_status_low))
6401 update_status (p); 6384 update_status (p);
6402 msg = status_message (p->status); 6385 msg = status_message (p);
6403 6386
6404 /* If process is terminated, deactivate it or delete it. */ 6387 /* If process is terminated, deactivate it or delete it. */
6405 symbol = p->status; 6388 symbol = p->status;