Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Request to php file from Flash hangs in Safari

The last two days we've been going over this problem for several hours to figure out what's going on and we can't find any clues. Here's what's happening; We have a Flash application that allows people to place orders. Users configure a product and an image of that product is generated by Flash on the fly and presented to the user. When satisfied, they can send an order to the server. A byte array of the image and some other variables are sent to the server which processes the order and generates a PDF with a summary of the order and the image of the product. The order script then sends everything back to the browser.

This is all going really well, except for Safari on OSX 10.4. Occasionally the order comes through but most of the time Safari hangs. When looking at the Activity window in Safari it states that it's waiting for the order script and that it's "0 bytes of ?". We thought there was something wrong with the server so we've tried several other servers but the problem persists. Initially we used a simple post to process the order but, in an effort to solve this problem we resorted to some more sophisticated methods as Flash remoting via AMFPHP. This didn't solve the problem either.

We use Charles to monitor the http trafic to figure out whether the requests are leaving the browser at all but the strange thing is that when Charles is running, we can't reproduce the problem.

I hope someone has any clue what's happening because we can't figure it out.

like image 488
onomio Avatar asked Feb 06 '10 15:02

onomio


1 Answers

just a wild guess:

Is getting the PDF back the result of 1 http request that both sends all needed data to the server and gets the pdf as a result? Otherwise this could be a timing issue - are you sure all data is available at the server the moment the pdf is being requested? The number of allowd parallel connections to a website is not the same for all browser brands/versions, and maybe that could influence the likelyhood of a 'clash' happening.

Easy test: introduce a delay between sending the data to the server and retrieving the pdf and see if that has any effect.

like image 137
Simon Groenewolt Avatar answered Oct 27 '22 01:10

Simon Groenewolt