Bugzilla – Attachment 1241 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
diff (text/plain), 1.30 KB, created by
Thue Janus Kristensen
on 2007-02-20 20:58:50 AEDT
(
hide
)
Description:
A patch for sftp buffer handling applies to 4.5p1
Filename:
MIME Type:
Creator:
Thue Janus Kristensen
Created:
2007-02-20 20:58:50 AEDT
Size:
1.30 KB
patch
obsolete
>diff -u old/sftp-server.c new/sftp-server.c >--- old/sftp-server.c 2006-08-05 04:39:40.000000000 +0200 >+++ new/sftp-server.c 2007-02-20 10:43:11.000000000 +0100 >@@ -1295,7 +1295,12 @@ > 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. >+ * Also, if the iqueue is almost full we are not interested in more input. */ >+ if (buffer_check_alloc(&oqueue, SFTP_MAX_MSG_LENGTH + 4) && >+ buffer_check_alloc(&iqueue, 4*4096)) >+ FD_SET(in, rset); >+ > olen = buffer_len(&oqueue); > if (olen > 0) > FD_SET(out, wset); >@@ -1308,7 +1313,8 @@ > } > > /* copy stdin to iqueue */ >- if (FD_ISSET(in, rset)) { >+ if (buffer_check_alloc(&iqueue, 4*4096) && >+ FD_ISSET(in, rset)) { > char buf[4*4096]; > len = read(in, buf, sizeof buf); > if (len == 0) { >@@ -1331,7 +1337,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(); > } > } >Only in new/: sftp-server.c~ >Only in new/: sftp-server.c.orig >Only in new/: ssh_prng_cmds >Only in new/: survey.sh
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