🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #58445

Re: slrnpull win32 problem

#58445
From: John E. Davis
Date: Thu, 24 Feb 2000 00:00
41 lines
2179 bytes
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

Technical Details
Message-ID: <slrn8bapso.ual.davis@aluche.mit.edu>
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
References: <890r10$ufn$1@thingy.apana.org.au> <slrn8b81if.q7n.davis@aluche.mit.edu> <slrn8b8ihh.3vve853.hpholm@post1.tele.dk> <893hgu$erl$1@thingy.apana.org.au>

Show Full Headers
Complete Article Headers
Message-ID: <slrn8bapso.ual.davis@aluche.mit.edu>
Subject: Re: slrnpull win32 problem
Date: Thu, 24 Feb 2000 00:00:00 +0000
From: davis@space.mit.edu (John E. Davis)
References: <890r10$ufn$1@thingy.apana.org.au> <slrn8b81if.q7n.davis@aluche.mit.edu> <slrn8b8ihh.3vve853.hpholm@post1.tele.dk> <893hgu$erl$1@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-mail
X-Deja-AN: 589382147
X-Trace: dreaderd 951412634 2955 18.75.2.45
Organization: Center for Space Research
User-Agent: slrn/0.9.6.3 (Linux)
Reply-To: davis@space.mit.edu
Newsgroups: news.software.readers