hard crashes with data from Internet

Scott Rossi scott at tactilemedia.com
Sat Dec 18 16:42:32 EST 2004


Recently, Richard Gaskin wrote:

> I have an app that makes a series of HTTP calls to a server to obtain a
> list of directory contents in nested directories.  I find when I make
> single calls with some time between them the results are almost 100%
> reliable, but when I make these calls in rapid succession sometimes I
> see garbage in the returned result, where the data from the server
> should be.
> 
> The nature of the garbage suggests it may be the result of an errant
> pointer, and this issue is being tracked in Bugzilla:
> <http://support.runrev.com/bugdatabase/show_bug.cgi?id=2226>
> 
> But my question for the moment is:  Anyone seen this before and have a
> workaround in place for preventing this errant-pointer garbage?
> 
> To be more specific, the engine doesn't crash until I try to set the
> htmlText of a field to it -- can you think of a way to determine if the
> data is valid HTML?
> 
> I thought about checking the data for the presence of something like
> "</body>", but I can imagine circumstances where the garbage might also
> contain some of the returned data (though I haven't logged enough yet to
> really know how frequently, if ever, that's really the case).
> 
> That may be sufficient in most cases, but I'd sure like to find a 100%
> method if possible.  I don't mind script errors, but things that cause
> hard crashes make my work look really sloppy to the user. :)

I didn't look up the bug you make reference to but I'm assuming it's the one
where trying to grab content from the Web results in partial stack/control
script being returned in the result.  If this is the case, the method I have
been planning to use is checking for the end of the content file, such as
</html> or whatever is appropriate for the content.  Even better might be to
check for both the beginning and the end if that's possible.  Otherwise,
since every stack is different, I don't know of a reliable check
(unfortunately, the bug is not reliable either).

Regards,

Scott Rossi
Creative Director
Tactile Media, Development & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com



More information about the use-livecode mailing list