You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Martin Storsjö (JIRA)" <ji...@apache.org> on 2011/02/26 22:09:58 UTC

[jira] Created: (HARMONY-6682) SocketOutputStream doesn't handle short writes properly

SocketOutputStream doesn't handle short writes properly
-------------------------------------------------------

                 Key: HARMONY-6682
                 URL: https://issues.apache.org/jira/browse/HARMONY-6682
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: Tested/noticed on Android, same issue identified in the Harmony code base, too
            Reporter: Martin Storsjö


Even blocking writes can return before the full amount is written, e.g. if a signal is received, or for any other arbitrary reason.

The java.io.OutputStream.write() interface that SocketOutputStream implements returns void, and cannot report short writes to the caller, and therefore is required to loop to retry writing until everything is written, or until writing fails.

The same issue is reported to Android at https://review.source.android.com/21459.


-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Re: [jira] Updated: (HARMONY-6682) SocketOutputStream doesn't handle short writes properly

Posted by Ray Chen <cl...@gmail.com>.
Hi Martin,
Thank you for your patch!

Is that possible to give a test case to show the problem clearly?

Thanks!

2011/2/27 Martin Storsjö (JIRA) <ji...@apache.org>

>
>     [
> https://issues.apache.org/jira/browse/HARMONY-6682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Martin Storsjö updated HARMONY-6682:
> ------------------------------------
>
>    Attachment: outputstream-shortwrite.patch
>
> Patch fixing the issue
>
> > SocketOutputStream doesn't handle short writes properly
> > -------------------------------------------------------
> >
> >                 Key: HARMONY-6682
> >                 URL: https://issues.apache.org/jira/browse/HARMONY-6682
> >             Project: Harmony
> >          Issue Type: Bug
> >          Components: Classlib
> >         Environment: Tested/noticed on Android, same issue identified in
> the Harmony code base, too
> >            Reporter: Martin Storsjö
> >         Attachments: outputstream-shortwrite.patch
> >
> >
> > Even blocking writes can return before the full amount is written, e.g.
> if a signal is received, or for any other arbitrary reason.
> > The java.io.OutputStream.write() interface that SocketOutputStream
> implements returns void, and cannot report short writes to the caller, and
> therefore is required to loop to retry writing until everything is written,
> or until writing fails.
> > The same issue is reported to Android at
> https://review.source.android.com/21459.
>
> --
> This message is automatically generated by JIRA.
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>


-- 
Regards,

Ray Chen

[jira] Updated: (HARMONY-6682) SocketOutputStream doesn't handle short writes properly

Posted by "Martin Storsjö (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Storsjö updated HARMONY-6682:
------------------------------------

    Attachment: outputstream-shortwrite.patch

Patch fixing the issue

> SocketOutputStream doesn't handle short writes properly
> -------------------------------------------------------
>
>                 Key: HARMONY-6682
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6682
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Tested/noticed on Android, same issue identified in the Harmony code base, too
>            Reporter: Martin Storsjö
>         Attachments: outputstream-shortwrite.patch
>
>
> Even blocking writes can return before the full amount is written, e.g. if a signal is received, or for any other arbitrary reason.
> The java.io.OutputStream.write() interface that SocketOutputStream implements returns void, and cannot report short writes to the caller, and therefore is required to loop to retry writing until everything is written, or until writing fails.
> The same issue is reported to Android at https://review.source.android.com/21459.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (HARMONY-6682) SocketOutputStream doesn't handle short writes properly

Posted by "Martin Storsjö (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003525#comment-13003525 ] 

Martin Storsjö commented on HARMONY-6682:
-----------------------------------------

The same issue is also reported to Android as a normal issue, in http://code.google.com/p/android/issues/detail?id=15304.

> SocketOutputStream doesn't handle short writes properly
> -------------------------------------------------------
>
>                 Key: HARMONY-6682
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6682
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Tested/noticed on Android, same issue identified in the Harmony code base, too
>            Reporter: Martin Storsjö
>         Attachments: outputstream-shortwrite.patch
>
>
> Even blocking writes can return before the full amount is written, e.g. if a signal is received, or for any other arbitrary reason.
> The java.io.OutputStream.write() interface that SocketOutputStream implements returns void, and cannot report short writes to the caller, and therefore is required to loop to retry writing until everything is written, or until writing fails.
> The same issue is reported to Android at https://review.source.android.com/21459.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira