Mantis - Hessian
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
3268 | minor | always | 01-15-09 13:39 | 02-24-09 18:44 | |
|
|||||
Reporter: | emil | Platform: | |||
Assigned To: | OS: | ||||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.2.1 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | |||
|
|||||
Summary: | 0003268: Circular references in Hessian Flex | ||||
Description: |
(rep by bryan) In the current implementation ( hessian-flex-3.2.0-src.jar ): If an Object which is Serialized contains a circular reference to itself i.e. Project -> Project, then HessianOutput will crash with a stack overflow. The reason for this, is it doesn't do anything to handle circular references, I suspect a more complete handling would require a rewrite of the handleObject and handleObject10 methods passing recursively a Map of reference objects down the call stack to properly solve this the reference way. This code just fixes it one level deep, but it's better than nothing and fixes the most common case. [-- Attachment 0000002: HessianOutput.patch.txt --] [-- Type: text/plain, Encoding: 7bit, Size: 0.8K --] Index: flex/hessian/src/hessian/io/HessianOutput.as =================================================================== --- flex/hessian/src/hessian/io/HessianOutput.as (revision 190) +++ flex/hessian/src/hessian/io/HessianOutput.as (working copy) @@ -376,7 +376,15 @@ if (key != "hessianTypeName") { writeObject(key); - writeObject(obj[key]); + //Very crude, yet it works, prevent crashing on recursive +relationships by not sending them + if(obj[key] != obj){ + writeObject(obj[key]); + } + else{ + trace("should be writing a reference here but writing null is +the " + + "next best thing when encountering a circular +references"); + writeNull(); + } } break; |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|