mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-21 22:28:37 -05:00
Packet-level logging should now work properly in Unix Plink.
[originally from svn r2193]
This commit is contained in:
parent
3a084e9333
commit
a44ba79e2e
@ -30,6 +30,8 @@ unsigned long getticks(void); /* based on gettimeofday(2) */
|
|||||||
#define WCHAR wchar_t
|
#define WCHAR wchar_t
|
||||||
#define BYTE unsigned char
|
#define BYTE unsigned char
|
||||||
|
|
||||||
|
GLOBAL void *logctx;
|
||||||
|
|
||||||
/* Things pty.c needs from pterm.c */
|
/* Things pty.c needs from pterm.c */
|
||||||
char *get_x_display(void *frontend);
|
char *get_x_display(void *frontend);
|
||||||
int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
|
int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
|
||||||
|
@ -262,6 +262,7 @@ void old_keyfile_warning(void)
|
|||||||
|
|
||||||
void logevent(void *frontend, char *string)
|
void logevent(void *frontend, char *string)
|
||||||
{
|
{
|
||||||
|
log_eventlog(logctx, string);
|
||||||
}
|
}
|
||||||
|
|
||||||
int console_get_line(const char *prompt, char *str,
|
int console_get_line(const char *prompt, char *str,
|
||||||
|
@ -186,7 +186,6 @@ int main(int argc, char **argv)
|
|||||||
int i, skcount, sksize, socketstate;
|
int i, skcount, sksize, socketstate;
|
||||||
int connopen;
|
int connopen;
|
||||||
int exitcode;
|
int exitcode;
|
||||||
void *logctx;
|
|
||||||
void *ldisc;
|
void *ldisc;
|
||||||
|
|
||||||
ssh_get_line = console_get_line;
|
ssh_get_line = console_get_line;
|
||||||
@ -237,10 +236,19 @@ int main(int argc, char **argv)
|
|||||||
continue;
|
continue;
|
||||||
} else if (!strcmp(p, "-batch")) {
|
} else if (!strcmp(p, "-batch")) {
|
||||||
console_batch_mode = 1;
|
console_batch_mode = 1;
|
||||||
|
} else if (!strcmp(p, "-o")) {
|
||||||
|
if (argc <= 1)
|
||||||
|
fprintf(stderr,
|
||||||
|
"plink: option \"-o\" requires an argument\n");
|
||||||
|
else
|
||||||
|
--argc, provide_xrm_string(*++argv);
|
||||||
}
|
}
|
||||||
} else if (*p) {
|
} else if (*p) {
|
||||||
if (!*cfg.host) {
|
if (!*cfg.host) {
|
||||||
char *q = p;
|
char *q = p;
|
||||||
|
|
||||||
|
do_defaults(NULL, &cfg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the hostname starts with "telnet:", set the
|
* If the hostname starts with "telnet:", set the
|
||||||
* protocol to Telnet and process the string as a
|
* protocol to Telnet and process the string as a
|
||||||
@ -441,6 +449,7 @@ int main(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* Start up the connection.
|
* Start up the connection.
|
||||||
*/
|
*/
|
||||||
|
logctx = log_init(NULL);
|
||||||
{
|
{
|
||||||
char *error;
|
char *error;
|
||||||
char *realhost;
|
char *realhost;
|
||||||
@ -453,7 +462,6 @@ int main(int argc, char **argv)
|
|||||||
fprintf(stderr, "Unable to open connection:\n%s\n", error);
|
fprintf(stderr, "Unable to open connection:\n%s\n", error);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
logctx = log_init(NULL);
|
|
||||||
back->provide_logctx(backhandle, logctx);
|
back->provide_logctx(backhandle, logctx);
|
||||||
ldisc = ldisc_create(NULL, back, backhandle, NULL);
|
ldisc = ldisc_create(NULL, back, backhandle, NULL);
|
||||||
sfree(realhost);
|
sfree(realhost);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user