Bugzilla – Attachment 1340 Details for
Bug 1354
slight problems with sftp client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for draining the acks properly
sftp-drain-acks.patch (text/plain), 1.95 KB, created by
Tomas Mraz
on 2007-08-14 19:45:31 AEST
(
hide
)
Description:
Patch for draining the acks properly
Filename:
MIME Type:
Creator:
Tomas Mraz
Created:
2007-08-14 19:45:31 AEST
Size:
1.95 KB
patch
obsolete
>--- sftp-client.c.drain-acks 2007-08-14 11:20:09.000000000 +0200 >+++ sftp-client.c 2007-08-14 11:22:42.000000000 +0200 >@@ -992,7 +992,8 @@ int > do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, > int pflag) > { >- int local_fd, status; >+ int local_fd; >+ int status = SSH2_FX_OK; > u_int handle_len, id, type; > u_int64_t offset; > char *handle, *data; >@@ -1074,7 +1075,7 @@ do_upload(struct sftp_conn *conn, char * > * Simulate an EOF on interrupt, allowing ACKs from the > * server to drain. > */ >- if (interrupted) >+ if (interrupted || status != SSH2_FX_OK) > len = 0; > else do > len = read(local_fd, data, conn->transfer_buflen); >@@ -1131,18 +1132,6 @@ do_upload(struct sftp_conn *conn, char * > fatal("Can't find request for ID %u", r_id); > TAILQ_REMOVE(&acks, ack, tq); > >- if (status != SSH2_FX_OK) { >- error("Couldn't write to remote file \"%s\": %s", >- remote_path, fx2txt(status)); >- if (showprogress) >- stop_progress_meter(); >- do_close(conn, handle, handle_len); >- close(local_fd); >- xfree(data); >- xfree(ack); >- status = -1; >- goto done; >- } > debug3("In write loop, ack for %u %u bytes at %llu", > ack->id, ack->len, (unsigned long long)ack->offset); > ++ackid; >@@ -1154,21 +1143,25 @@ do_upload(struct sftp_conn *conn, char * > stop_progress_meter(); > xfree(data); > >+ if (status != SSH2_FX_OK) { >+ error("Couldn't write to remote file \"%s\": %s", >+ remote_path, fx2txt(status)); >+ status = -1; >+ } >+ > if (close(local_fd) == -1) { > error("Couldn't close local file \"%s\": %s", local_path, > strerror(errno)); >- do_close(conn, handle, handle_len); > status = -1; >- goto done; > } > > /* Override umask and utimes if asked */ > if (pflag) > do_fsetstat(conn, handle, handle_len, &a); > >- status = do_close(conn, handle, handle_len); >+ if (do_close(conn, handle, handle_len) != SSH2_FX_OK) >+ status = -1; > >-done: > xfree(handle); > buffer_free(&msg); > return(status);
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
Actions:
View
|
Diff
Attachments on
bug 1354
: 1340 |
1341