Flash 对 php 文件的请求在 Safari 中挂起
过去两天我们花了几个小时来研究这个问题,想弄清楚到底发生了什么,但我们找不到任何线索。 这就是发生的事情;我们有一个 Flash 应用程序,允许人们下订单。用户配置一个产品,该产品的图像由 Flash 动态生成并呈现给用户。当满意时,他们可以向服务器发送订单。图像的字节数组和一些其他变量被发送到服务器,该服务器处理订单并生成包含订单摘要和产品图像的 PDF。然后订单脚本将所有内容发送回浏览器。
除了 OSX 10.4 上的 Safari 之外,一切都进展顺利。有时订单会通过,但大多数时候 Safari 会挂起。当查看 Safari 中的“活动”窗口时,它表明它正在等待订单脚本并且它是“0 字节?”。 我们认为服务器出现问题,因此尝试了其他几台服务器,但问题仍然存在。 最初,我们使用简单的帖子来处理订单,但为了解决此问题,我们采用了一些更复杂的方法,例如通过 AMFPHP 进行 Flash 远程处理。这也没有解决问题。
我们使用 Charles 来监视 http 流量,以确定请求是否完全离开浏览器,但奇怪的是,当 Charles 运行时,我们无法重现该问题。
我希望有人知道发生了什么,因为我们无法弄清楚。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是一个疯狂的猜测:
获取 PDF 是否是 1 个 http 请求的结果,该请求既将所有需要的数据发送到服务器并获取 pdf 作为结果?否则,这可能是一个时间问题 - 您确定在请求 pdf 时服务器上所有数据都可用吗?对于所有浏览器品牌/版本来说,网站允许的并行连接数量并不相同,这可能会影响发生“冲突”的可能性。
简单测试:在将数据发送到服务器和检索 pdf 之间引入延迟,看看是否有任何影响。
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.