projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add an error check to every setsockopt call in uxnet.c.
[u/mdw/putty]
/
windows
/
winplink.c
diff --git
a/windows/winplink.c
b/windows/winplink.c
index
3fe03af
..
37453bb
100644
(file)
--- a/
windows/winplink.c
+++ b/
windows/winplink.c
@@
-49,6
+49,19
@@
void modalfatalbox(char *p, ...)
}
cleanup_exit(1);
}
}
cleanup_exit(1);
}
+void nonfatal(char *p, ...)
+{
+ va_list ap;
+ fprintf(stderr, "ERROR: ");
+ va_start(ap, p);
+ vfprintf(stderr, p, ap);
+ va_end(ap);
+ fputc('\n', stderr);
+ if (logctx) {
+ log_free(logctx);
+ logctx = NULL;
+ }
+}
void connection_fatal(void *frontend, char *p, ...)
{
va_list ap;
void connection_fatal(void *frontend, char *p, ...)
{
va_list ap;
@@
-130,6
+143,12
@@
int from_backend_untrusted(void *frontend_handle, const char *data, int len)
return 0; /* not reached */
}
return 0; /* not reached */
}
+int from_backend_eof(void *frontend_handle)
+{
+ handle_write_eof(stdout_handle);
+ return FALSE; /* do not respond to incoming EOF with outgoing */
+}
+
int get_userpass_input(prompts_t *p, unsigned char *in, int inlen)
{
int ret;
int get_userpass_input(prompts_t *p, unsigned char *in, int inlen)
{
int ret;
@@
-283,7
+302,7
@@
int main(int argc, char **argv)
int errors;
int got_host = FALSE;
int use_subsystem = 0;
int errors;
int got_host = FALSE;
int use_subsystem = 0;
-
long now, next
;
+
unsigned long now, next, then
;
sklist = NULL;
skcount = sksize = 0;
sklist = NULL;
skcount = sksize = 0;
@@
-337,8
+356,10
@@
int main(int argc, char **argv)
} else if (!strcmp(p, "-s")) {
/* Save status to write to conf later. */
use_subsystem = 1;
} else if (!strcmp(p, "-s")) {
/* Save status to write to conf later. */
use_subsystem = 1;
- } else if (!strcmp(p, "-V")) {
+ } else if (!strcmp(p, "-V")
|| !strcmp(p, "--version")
) {
version();
version();
+ } else if (!strcmp(p, "--help")) {
+ usage();
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints();
exit(1);
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints();
exit(1);
@@
-628,8
+649,12
@@
int main(int argc, char **argv)
}
if (run_timers(now, &next)) {
}
if (run_timers(now, &next)) {
- ticks = next - GETTICKCOUNT();
- if (ticks < 0) ticks = 0; /* just in case */
+ then = now;
+ now = GETTICKCOUNT();
+ if (now - then > next - then)
+ ticks = 0;
+ else
+ ticks = next - now;
} else {
ticks = INFINITE;
}
} else {
ticks = INFINITE;
}