Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

Patch for OutputWriter.write() #20

Closed
glassfishrobot opened this issue Jul 24, 2007 · 8 comments
Closed

Patch for OutputWriter.write() #20

glassfishrobot opened this issue Jul 24, 2007 · 8 comments

Comments

@glassfishrobot
Copy link

From the community, fyaoxy "at" gmail.com, a patch contribution for
com.sun.grizzly.util.OutputWriter.java

Index:
F:/svn/grizzly/modules/grizzly/src/main/java/com/sun/grizzly/util/OutputWriter.java

===================================================================


F:/svn/grizzly/modules/grizzly/src/main/java/com/sun/grizzly/util/OutputWriter.java
(revision 394)

+++
F:/svn/grizzly/modules/grizzly/src/main/java/com/sun/grizzly/util/OutputWriter.java
(working copy)

@@ -86,14 +86,13 @@

try {
while ( bb.hasRemaining() ) {
int len = socketChannel.write(bb);

  • attempts++;

  • if (len < 0) { - throw new EOFException(); - }

  • bytesProduced += len;

  • if (len == 0) {

    • if (len>0) { + attempts = 0; + bytesProduced += len; + }

    else {

    • //handle write count = 0;NOTE write() return result >=0, no <0
      exist.
    • attempts++;

    if ( writeSelector == null ){
    writeSelector = SelectorFactory.getSelector();
    if ( writeSelector == null)

    { @@ -111,8 +110,7 @@ }

    else

    { attempts--; }

  • } else { - attempts = 0; + //handle write count = 0 end; }

    }
    } finally {

Environment

Operating System: All
Platform: All

Affected Versions

[1.9.22]

@glassfishrobot
Copy link
Author

Reported by huntch@java.net

@glassfishrobot
Copy link
Author

Was assigned to jfarcand@java.net

@glassfishrobot
Copy link
Author

File: OutputWriter.java.patch
Attached By: huntch@java.net

@glassfishrobot
Copy link
Author

huntch@java.net said:
Created an attachment (id=2)
OutputWriter.java patch file

@glassfishrobot
Copy link
Author

jfarcand@java.net said:
Patch applied. Available in 1.6.0

Thanks!

@glassfishrobot
Copy link
Author

jfarcand@java.net said:
Fix milestones

@glassfishrobot
Copy link
Author

Marked as fixed on Wednesday, December 16th 2009, 6:14:11 pm

@glassfishrobot
Copy link
Author

This issue was imported from java.net JIRA GRIZZLY-20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant