Bugzilla – Attachment 1238 Details for
Bug 1286
SFTP keeps reading input until it runs out of buffer space
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
A patch for sftp buffer handling applies to 4.5p1
4.5p1.diff (text/plain), 1.14 KB, created by
Thue Janus Kristensen
on 2007-02-19 03:58:21 AEDT
(
hide
)
Description:
A patch for sftp buffer handling applies to 4.5p1
Filename:
MIME Type:
Creator:
Thue Janus Kristensen
Created:
2007-02-19 03:58:21 AEDT
Size:
1.14 KB
patch
obsolete
>diff -ur sletmig2/openssh-4.5p1/sftp-server.c openssh-4.5p1/sftp-server.c >--- sletmig2/openssh-4.5p1/sftp-server.c 2006-08-05 04:39:40.000000000 +0200 >+++ openssh-4.5p1/sftp-server.c 2007-02-18 17:37:39.000000000 +0100 >@@ -1295,7 +1295,10 @@ > memset(rset, 0, set_size); > memset(wset, 0, set_size); > >- FD_SET(in, rset); >+ /* If the oqueue is close to full then we want to wait on just the output. */ >+ if (buffer_check_alloc(&oqueue, SFTP_MAX_MSG_LENGTH + 4)) >+ FD_SET(in, rset); >+ > olen = buffer_len(&oqueue); > if (olen > 0) > FD_SET(out, wset); >@@ -1308,7 +1311,8 @@ > } > > /* copy stdin to iqueue */ >- if (FD_ISSET(in, rset)) { >+ if (buffer_check_alloc(&iqueue, SFTP_MAX_MSG_LENGTH + 4) && >+ FD_ISSET(in, rset)) { > char buf[4*4096]; > len = read(in, buf, sizeof buf); > if (len == 0) { >@@ -1331,7 +1335,10 @@ > buffer_consume(&oqueue, len); > } > } >- /* process requests from client */ >- process(); >+ /* process requests from client. If the output buffer >+ * is critical then don't create more data by >+ * processing more requests. */ >+ if (buffer_check_alloc(&oqueue, SFTP_MAX_MSG_LENGTH + 4)) >+ process(); > } > }
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 1286
:
1238
|
1239
|
1241
|
1282