Article View: news.software.readers
Article #59110Re: slrn 0.9.6.2 - quits if ^C pressed while fetching a Thread
From: David Gerard
Date: Fri, 10 Mar 2000 00:00
Date: Fri, 10 Mar 2000 00:00
78 lines
3519 bytes
3519 bytes
On 10 Mar 2000 03:45:18 GMT, Sven Guckes <guckes@math.fu-berlin.de> wrote:
:* Matthew Haley <mrh99@uswest.net>:
:> I'm using the Win32 version of slnrn 0.9.6.2.
:> While fetching viewing a thread and using ESC-1-ESC-p
:> to fetch the entire thread I realized it was allread on
:> screen and pressed ^C to cancel which promptly quit slrn.
:> Is this normal?
:On Windows *everything* is normal.
:Seriously, though - I don't think
:slrn can catch a CTRL-C break...
It can, it's just that the 0.9.6.2 code doesn't contain the Windows
handler.
For an example, here's a recent JED post on the subject, re: slrnpull dying
instantly on a Ctrl-C instead of cleaning up first ...
(And I'll try these myself on slrnpull when I get a Windows compiler -
unless I get mulinux behaving first ;-)
From: davis@space.mit.edu (John E. Davis)
Newsgroups: news.software.readers
Subject: Re: slrnpull win32 problem
Message-ID: <slrn8bapso.ual.davis@aluche.mit.edu>
Date: 24 Feb 2000 17:17:14 GMT
On 24 Feb 2000 15:08:14 GMT, David Gerard <fun@thingy.apana.org.au>
wrote:
>Hmmm. Does what I'm asking for (an interrupt that says 'drop this
>connection, clean up after yourself and terminate) even exist in slrnpull?
>Or is there only the Ctrl-C, which says 'terminate RIGHT NOW'?
On Unix platforms, Ctrl-C activates a signal handler which causes the
proper cleanup activities to take place. I believe that the win32 API
contains a function called `SetConsoleCtrlHandler' that may be used
to emulate this behavior. That is, add
#v+
static BOOL WINAPI kbd_int_handler (DWORD type)
{
BOOL ret = TRUE;
switch (type)
{
case CTRL_C_EVENT: /* ctrl+c hit */
case CTRL_BREAK_EVENT: /* ctrl+break hit */
case CTRL_CLOSE_EVENT: /* window closing */
case CTRL_LOGOFF_EVENT: /* user logoff */
case CTRL_SHUTDOWN_EVENT: /* system shutdown */
default:
Terminate_Slrn_Pull_Requested = 1;
(void) handle_interrupts ();
}
return TRUE;
}
#v-
to the appropriate place in slrnpull.c and then put the line
#v+
SetConsoleCtrlHandler (kbd_int_handler, TRUE);
#v-
int the `init_signals' function:
You might try making these changes to slrnpull.c and test whether or
not they cause the appropriate actions to take place.
--John
--
http://xenu.netizen.com.au/ http://www.caube.org.au/
Let's take a ride, run with the dogs tonight, in suburbia.
Technical Details
Message-ID:
<8abvv4$g9i$7@thingy.apana.org.au>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<bXXn4.805$Ji3.12511@news.uswest.net> <8a9r4e$3e4br$4@fu-berlin.de>Show Full Headers
Complete Article Headers
Message-ID: <8abvv4$g9i$7@thingy.apana.org.au> Subject: Re: slrn 0.9.6.2 - quits if ^C pressed while fetching a Thread Date: Fri, 10 Mar 2000 00:00:00 +0000 From: fun@thingy.apana.org.au (David Gerard) References: <bXXn4.805$Ji3.12511@news.uswest.net> <8a9r4e$3e4br$4@fu-berlin.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 595882755 X-Geek: You should be reading the message, not the headers X-Complaints-To: abuse@thingy.apana.org.au X-Trace: thingy.apana.org.au 952730404 16690 192.168.10.1 (10 Mar 2000 23:20:04 GMT) Organization: Please try to understand before one of us dies. X-URL: http://thingy.apana.org.au/~fun/ User-Agent: slrn/0.9.5.4 (Windows) NNTP-Posting-Date: 10 Mar 2000 23:20:04 GMT Newsgroups: news.software.readers