Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 78220 Details for
Bug 202758
[ftp] ftp hangs when I try to copy some files to a remote site
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for NET-73 (cmd-seq-hang.patch)
cmd-seq-hang.patch (text/plain), 2.66 KB, created by
Martin Oberhuber
on 2007-09-12 14:28:41 EDT
(
hide
)
Description:
Patch for NET-73 (cmd-seq-hang.patch)
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2007-09-12 14:28:41 EDT
Size:
2.66 KB
patch
obsolete
>Index: src/java/org/apache/commons/net/telnet/TelnetInputStream.java >=================================================================== >--- src/java/org/apache/commons/net/telnet/TelnetInputStream.java (revision 396613) >+++ src/java/org/apache/commons/net/telnet/TelnetInputStream.java (working copy) >@@ -103,14 +103,19 @@ > // TelnetOutputStream writing through the telnet client at same time > // as a processDo/Will/etc. command invoked from TelnetInputStream > // tries to write. >- private int __read() throws IOException >+ private int __read(boolean mayBlock) throws IOException > { > int ch; > > _loop: > while (true) > { >- // Exit only when we reach end of stream. >+ >+ // If there is no more data AND we were told not to block, just return -2. (More efficient than exception.) >+ if(!mayBlock && super.available() == 0) >+ return -2; >+ >+ // Otherwise, exit only when we reach end of stream. > if ((ch = super.read()) < 0) > return -1; > >@@ -357,12 +362,13 @@ > //__alreadyread = false; > __readIsWaiting = true; > int ch; >- >+ boolean mayBlock = true; // block on the first read only >+ > do > { > try > { >- if ((ch = __read()) < 0) >+ if ((ch = __read(mayBlock)) < 0) > if(ch != -2) > return (ch); > } >@@ -396,6 +402,11 @@ > if (__isClosed) > return (-1); > } >+ >+ // Reads should not block on subsequent iterations. Potentially, this could happen if the >+ // remaining buffered socket data consists entirely of Telnet command sequence and no "user" data. >+ mayBlock = false; >+ > } > // Continue reading as long as there is data available and the queue is not full. > while (super.available() > 0 && __bytesAvailable < __queue.length - 1); >@@ -541,7 +552,7 @@ > { > try > { >- if ((ch = __read()) < 0) >+ if ((ch = __read(true)) < 0) > break; > } > catch (InterruptedIOException e)
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 202758
:
77956
|
77957
|
77976
|
77991
|
78057
|
78076
|
78218
| 78220