Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6682

SocketOutputStream doesn't handle short writes properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Classlib
    • None
    • Tested/noticed on Android, same issue identified in the Harmony code base, too
    • Patch Available
    • Novice

    Description

      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.

      Attachments

        1. outputstream-shortwrite.patch
          1 kB
          Martin Storsjö

        Activity

          People

            Unassigned Unassigned
            mstorsjo Martin Storsjö
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: