You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "jrudolph (via GitHub)" <gi...@apache.org> on 2023/01/26 10:52:14 UTC

[GitHub] [incubator-pekko] jrudolph commented on a diff in pull request #44: stream: fix regression in JsonFraming

jrudolph commented on code in PR #44:
URL: https://github.com/apache/incubator-pekko/pull/44#discussion_r1087680362


##########
stream/src/main/scala/org/apache/pekko/stream/impl/JsonObjectParser.scala:
##########
@@ -117,21 +117,22 @@ import pekko.util.ByteString
     val bufSize = buffer.length
 
     skipToNextObject(bufSize)
+    val maxObjectLengthIndex = if (pos + maximumObjectLength < 0) Int.MaxValue else pos + maximumObjectLength

Review Comment:
   @He-Pin what do you think about this solution? This way we catch the overflow directly. On the other hand, such a big `maximumObjectLength` is unlikely to work anyway because we cannot accommodate such a big object including any padding into our buffer... (i.e. we'll still fail in `offer`). Supporting huge objects is not economical in any case right now because of the buffer management issue.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org