开发者

Ext.encode() quits partially through

I've been observing a certa开发者_JAVA技巧in page built off Ext 3 has been responsible for sending malformed JSON to a C# handler. 95%+ of the time the JSON is OK. But sometimes the error logs show the handler received something like this (shortened in the middle, obviously):

appraisal = {"Id":"1234" [...] "rpb":false,"ex"%3

In other words, it craps out mid-JSON with a %X. X always corresponds to the character that should be there: %3 is a colon, %2 is a right square bracket. They look like URL encodings but they're not. I don't know what they are. The failures happen at random spots.

The JSON is encoded by Ext.encode(), like so:

var options = {
    params: {
        action: 'Save',
        objData: Ext.encode(myObject.data)
    }
};
SaveObj(options);

It has to be encode()'s fault because the object itself is fine and the logs indicate the handler receives the bad JSON in that form. But how is it encode()'s fault? What can be done to prevent this?


Surprisingly enough, this was a networking problem, not ExtJS' fault. One of our servers was killing < 1% of requests halfway through transmission.

To those looking at this thread for help: sorry the answer is rather unsatisfying. I do recommend the suggestion I received as a possible solution, though!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜