Monday, November 27, 2006

filBuf bug

One of my cohorts is attempting to diagnose a filbuf issue on one of our production servers. It doesn't appear to be a coldFusion bug per se. It looks like it's probably an issue with the xmlparser that ships with cfmx6.1.

From my co-worker:

Here's a coldfusion file that demonstrates the issue and also includes my super lame hack for fixing it. all the fix does is put spaces around the brackets, since it's the >] and ]> constructs that seem to cause the error. if you're interested in the java file that demonstrates the problem when run under the JRE that comes with cfmx6.1, I can provide that, too.

<cfparam name="url.fixforwddx" default="false">

<cfsetting requesttimeout="1200">
<cfflush interval="100">

<cfset chars = "]]>">
<cfset chars2 = "">
<cfloop from="1" to="20000" index="i">
<cfset chars2 = chars2 & chars>
<cfwddx action="cfml2wddx" input="#chars2#" output="mywddx">

<cfif url.fixforwddx>
<cfset mywddx = fixForWDDX(mywddx)>
<!--- make sure both the deserialization and the check for wddx work --->
<!--- NOTE: add ?fixforwddx=true to the URL to apply the fix and see this not throw an error --->
<cfset y = isWDDX("#mywddx#")>
<cfwddx action="wddx2cfml" input="#mywddx#" output="z">

<cfoutput>#i# iswddx? #y#</cfoutput>

<cffunction name="fixForWDDX">
<cfargument name="text">
<cfset var text2 = "">
<cfset text2 = replace(text,"]>"," ] >","ALL")>
<cfset text2 = replace(text2,">]","> ] ","ALL")>
<cfreturn text2>

Any help greatly appreciated.

No comments:

Post a Comment