You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Nate McCall (JIRA)" <ji...@apache.org> on 2010/07/15 22:45:50 UTC

[jira] Created: (THRIFT-820) The readLength attribute of TBinaryProtocol is used as an instance variable and is decremented on each call of checkReadLength

The readLength attribute of TBinaryProtocol is used as an instance variable and is decremented on each call of checkReadLength
------------------------------------------------------------------------------------------------------------------------------

                 Key: THRIFT-820
                 URL: https://issues.apache.org/jira/browse/THRIFT-820
             Project: Thrift
          Issue Type: Bug
          Components: Library (Java)
    Affects Versions: 0.2, 0.3
            Reporter: Nate McCall
         Attachments: tbinaryprotocol-length-check-patch-THRIFT-820.txt

When coding towards readLength, I saw this more as a check on the message length as it comes in. Perhaps its me, but I just dont see why this should decrement giving the length header for each message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-820) The readLength attribute of TBinaryProtocol is used as an instance variable and is decremented on each call of checkReadLength

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890328#action_12890328 ] 

Jonathan Ellis commented on THRIFT-820:
---------------------------------------

The consensus in #thrift seemed to be that the "right" fix is to reset the length value for each new message, thus making it a sort of frame size for unframed connections.

> The readLength attribute of TBinaryProtocol is used as an instance variable and is decremented on each call of checkReadLength
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-820
>                 URL: https://issues.apache.org/jira/browse/THRIFT-820
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Java)
>    Affects Versions: 0.2, 0.3
>            Reporter: Nate McCall
>         Attachments: tbinaryprotocol-length-check-patch-THRIFT-820.txt
>
>
> When coding towards readLength, I saw this more as a check on the message length as it comes in. Perhaps its me, but I just dont see why this should decrement giving the length header for each message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-820) The readLength attribute of TBinaryProtocol is used as an instance variable and is decremented on each call of checkReadLength

Posted by "Nate McCall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892171#action_12892171 ] 

Nate McCall commented on THRIFT-820:
------------------------------------

FWIW, we switched to creating new TProtocolBuffer objects after each TProcessor.process call (CASSANDRA-475) so we are not so hot-to-trot on this for now. 

If the consensus is to reset the length, that's fine, but then a resetLength() method should exposed for such.

> The readLength attribute of TBinaryProtocol is used as an instance variable and is decremented on each call of checkReadLength
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-820
>                 URL: https://issues.apache.org/jira/browse/THRIFT-820
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Java)
>    Affects Versions: 0.2, 0.3
>            Reporter: Nate McCall
>         Attachments: tbinaryprotocol-length-check-patch-THRIFT-820.txt
>
>
> When coding towards readLength, I saw this more as a check on the message length as it comes in. Perhaps its me, but I just dont see why this should decrement giving the length header for each message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-820) The readLength attribute of TBinaryProtocol is used as an instance variable and is decremented on each call of checkReadLength

Posted by "Nate McCall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nate McCall updated THRIFT-820:
-------------------------------

    Attachment: tbinaryprotocol-length-check-patch-THRIFT-820.txt

> The readLength attribute of TBinaryProtocol is used as an instance variable and is decremented on each call of checkReadLength
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-820
>                 URL: https://issues.apache.org/jira/browse/THRIFT-820
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Java)
>    Affects Versions: 0.2, 0.3
>            Reporter: Nate McCall
>         Attachments: tbinaryprotocol-length-check-patch-THRIFT-820.txt
>
>
> When coding towards readLength, I saw this more as a check on the message length as it comes in. Perhaps its me, but I just dont see why this should decrement giving the length header for each message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.