Anonymous | Login | Signup for a new account | 11-22-2024 08:17 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0003268 | [Hessian] | minor | always | 01-15-09 13:39 | 02-24-09 18:44 | ||||
Reporter | emil | View Status | public | ||||||
Assigned To | |||||||||
Priority | normal | Resolution | fixed | Platform | |||||
Status | closed | OS | |||||||
Projection | none | OS Version | |||||||
ETA | none | Fixed in Version | Product Version | 3.2.1 | |||||
Product Build | |||||||||
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 | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed. 26 unique queries executed. |