Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.2.8, 3.3
    • Labels:
      None
    • Workaround Description:
      Hide

      Use STATE_SOCK or STATE_TRANSFER instead of STATE

      Show
      Use STATE_SOCK or STATE_TRANSFER instead of STATE

      Description

      When receiving state, STATE fails to correctly push the state to the receiver. There is probably a bug in BlockingInputStream, as the state itself is transferred correctly.
      STATE_TRANSFER and STATE_SOCK are not affected

        Gliffy Diagrams

          Activity

          Hide
          belaban Bela Ban added a comment -

          The culprit was Draw: we use a BufferedOutputStream in DrawPanel.writeState(). This creates an internal buffer, which is flushed every 4096 bytes. This results in a message being sent to the state requester. However the buffer passed to the message is a reference to the internal buffer in BufferedOutputStream, and since this is modified again, the buffer in the message also changes !
          The solution was to copy the buffer into the message in STATE$StateOutputStream.sendMessage().

          Show
          belaban Bela Ban added a comment - The culprit was Draw: we use a BufferedOutputStream in DrawPanel.writeState(). This creates an internal buffer, which is flushed every 4096 bytes. This results in a message being sent to the state requester. However the buffer passed to the message is a reference to the internal buffer in BufferedOutputStream, and since this is modified again, the buffer in the message also changes ! The solution was to copy the buffer into the message in STATE$StateOutputStream.sendMessage().

            People

            • Assignee:
              belaban Bela Ban
              Reporter:
              belaban Bela Ban
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development