From e5f85fc2694c432718117c42c314097e7e9ed938 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 30 Jan 2020 06:40:21 +0000 Subject: [PATCH] Remove FLAG_SYNCAGENT. This was the easiest flag to remove: nothing ever checks it at all! It was part of an abandoned early attempt to make Pageant requests asynchronous. The flag was added in commit 135abf244 (April 2003); the code that used it was #ifdef-ed out in commit 98d735fde (January 2004), and removed completely in commit f864265e3 (January 2017). We now have an actually working system for async agent requests on Windows, via the new named-pipe IPC. And we also have a perfectly good way to force a particular agent request to work synchronously: just pass NULL as the callback function pointer. All of that works just fine, without ever using this flag. So begone! --- pscp.c | 6 +----- psftp.c | 6 +----- windows/winpgnt.c | 2 +- windows/winstuff.h | 4 ---- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/pscp.c b/pscp.c index 5b010ff1..9292052a 100644 --- a/pscp.c +++ b/pscp.c @@ -2235,11 +2235,7 @@ int psftp_main(int argc, char *argv[]) default_protocol = PROT_TELNET; - flags = 0 -#ifdef FLAG_SYNCAGENT - | FLAG_SYNCAGENT -#endif - ; + flags = 0; cmdline_tooltype = TOOLTYPE_FILETRANSFER; sk_init(); diff --git a/psftp.c b/psftp.c index c7e2414b..cf9e88e3 100644 --- a/psftp.c +++ b/psftp.c @@ -2769,11 +2769,7 @@ int psftp_main(int argc, char *argv[]) bool sanitise_stderr = true; char *batchfile = NULL; - flags = 0 -#ifdef FLAG_SYNCAGENT - | FLAG_SYNCAGENT -#endif - ; + flags = 0; cmdline_tooltype = TOOLTYPE_FILETRANSFER; sk_init(); diff --git a/windows/winpgnt.c b/windows/winpgnt.c index 67f53c00..089ba7ad 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -1183,7 +1183,7 @@ void cleanup_exit(int code) exit(code); } -int flags = FLAG_SYNCAGENT; +int flags = 0; struct winpgnt_client { PageantListenerClient plc; diff --git a/windows/winstuff.h b/windows/winstuff.h index d6cc1b68..7183a86e 100644 --- a/windows/winstuff.h +++ b/windows/winstuff.h @@ -662,13 +662,9 @@ char *agent_named_pipe_name(void); * winpgntc.c needs to schedule callbacks for asynchronous agent * requests. This has to be done differently in GUI and console, so * there's an exported function used for the purpose. - * - * Also, we supply FLAG_SYNCAGENT to force agent requests to be - * synchronous in pscp and psftp. */ void agent_schedule_callback(void (*callback)(void *, void *, int), void *callback_ctx, void *data, int len); -#define FLAG_SYNCAGENT 0x1000 /* * Exports from winser.c.