X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/a5ce2e9f198c1da83f7eaf81d2add879bfc644cf..2184a5d91ffbcf2de2f730c83dda2d9443035f50:/plink.c diff --git a/plink.c b/plink.c index 8d4701a9..5ef9da2e 100644 --- a/plink.c +++ b/plink.c @@ -735,8 +735,11 @@ int main(int argc, char **argv) { char *error; char *realhost; + /* nodelay is only useful if stdin is a character device (console) */ + int nodelay = cfg.tcp_nodelay && + (GetFileType(GetStdHandle(STD_INPUT_HANDLE)) == FILE_TYPE_CHAR); - error = back->init(cfg.host, cfg.port, &realhost); + error = back->init(cfg.host, cfg.port, &realhost, nodelay); if (error) { fprintf(stderr, "Unable to open connection:\n%s", error); return 1;