Bugzilla – Attachment 1724 Details for
Bug 1588
sftp client produces unnecessary message upon connecting to host
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
delay printing connect message until after sftp protocol is raised
sftp.diff (text/plain), 2.87 KB, created by
Damien Miller
on 2009-11-20 11:29:33 AEDT
(
hide
)
Description:
delay printing connect message until after sftp protocol is raised
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2009-11-20 11:29:33 AEDT
Size:
2.87 KB
patch
obsolete
>Index: sftp.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sftp.c,v >retrieving revision 1.111 >diff -u -p -r1.111 sftp.c >--- sftp.c 18 Aug 2009 18:36:21 -0000 1.111 >+++ sftp.c 20 Nov 2009 00:28:01 -0000 >@@ -47,18 +47,15 @@ > #include "sftp-common.h" > #include "sftp-client.h" > >+#define DEFAULT_COPY_BUFLEN 32768 /* Size of buffer for up/download */ >+#define DEFAULT_NUM_REQUESTS 64 /* # concurrent outstanding requests */ >+ > /* File to read commands from */ > FILE* infile; > > /* Are we in batchfile mode? */ > int batchmode = 0; > >-/* Size of buffer used when copying files */ >-size_t copy_buffer_len = 32768; >- >-/* Number of concurrent outstanding requests */ >-size_t num_requests = 64; >- > /* PID of ssh transport process */ > static pid_t sshpid = -1; > >@@ -164,7 +161,7 @@ static const struct CMD cmds[] = { > { NULL, -1} > }; > >-int interactive_loop(int fd_in, int fd_out, char *file1, char *file2); >+int interactive_loop(struct sftp_conn *, char *file1, char *file2); > > /* ARGSUSED */ > static void >@@ -1447,12 +1444,11 @@ prompt(EditLine *el) > } > > int >-interactive_loop(int fd_in, int fd_out, char *file1, char *file2) >+interactive_loop(struct sftp_conn *conn, char *file1, char *file2) > { > char *pwd; > char *dir = NULL; > char cmd[2048]; >- struct sftp_conn *conn; > int err, interactive; > EditLine *el = NULL; > History *hl = NULL; >@@ -1474,10 +1470,6 @@ interactive_loop(int fd_in, int fd_out, > el_source(el, NULL); > } > >- conn = do_init(fd_in, fd_out, copy_buffer_len, num_requests); >- if (conn == NULL) >- fatal("Couldn't initialise connection to server"); >- > pwd = do_realpath(conn, "."); > if (pwd == NULL) > fatal("Need cwd"); >@@ -1646,6 +1638,9 @@ main(int argc, char **argv) > arglist args; > extern int optind; > extern char *optarg; >+ struct sftp_conn *conn; >+ size_t copy_buffer_len = DEFAULT_COPY_BUFLEN; >+ size_t num_requests = DEFAULT_NUM_REQUESTS; > > /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ > sanitise_stdfd(); >@@ -1788,20 +1783,27 @@ main(int argc, char **argv) > addargs(&args, "%s", (sftp_server != NULL ? > sftp_server : "sftp")); > >- if (!batchmode) >- fprintf(stderr, "Connecting to %s...\n", host); > connect_to_server(ssh_program, args.list, &in, &out); > } else { > args.list = NULL; > addargs(&args, "sftp-server"); > >- if (!batchmode) >- fprintf(stderr, "Attaching to %s...\n", sftp_direct); > connect_to_server(sftp_direct, args.list, &in, &out); > } > freeargs(&args); > >- err = interactive_loop(in, out, file1, file2); >+ conn = do_init(in, out, copy_buffer_len, num_requests); >+ if (conn == NULL) >+ fatal("Couldn't initialise connection to server"); >+ >+ if (!batchmode) { >+ if (sftp_direct == NULL) >+ fprintf(stderr, "Connected to %s.\n", host); >+ else >+ fprintf(stderr, "Attached to %s.\n", sftp_direct); >+ } >+ >+ err = interactive_loop(conn, file1, file2); > > close(in); > close(out);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 1588
:
1624
|
1625
| 1724