HttpChannelOverHttp关闭后码头的数据过多 [英] Jetty too much data after closed for HttpChannelOverHttp

查看:104
本文介绍了HttpChannelOverHttp关闭后码头的数据过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在上传一个音频文件> 10s时遇到问题,并给了我这个错误:

I'm having trouble with upload one audio file >10s and gives me this error:

WARN:oejh.HttpParser:qtp1359061041-19: badMessage: java.lang.IllegalStateException: too much data after closed for HttpChannelOverHttp@7fd0cbe{r=5,a=IDLE,uri=-}

如果我上传音频文件< 10s,就可以了.

If I upload audio file <10s it goes ok.

我在Google上进行了搜索,但找不到任何解决方案. 有什么解决办法吗?

I searched on google, but I couldn't find any solution for this. There's any solution for this?

推荐答案

我正在使用Cordova 3.3.0,问题出在上传上.下面的代码解决了我的情况:

I'm using Cordova 3.3.0, and the problem was on the upload. The code below solved my case:

var options = new FileUploadOptions();
    options.fileKey="file";
    options.fileName=name;
    options.mimeType = "audio/amr";
    options.headers = {
        Connection: "close"
    }
    options.chunkedMode = false;

为什么码头会不断给我too much data after closed(将尽我所能解释).在执行另一个连接和请求之后,必须关闭该连接.例如,我的上传继续重复使用相同的请求,并溢出请求并给我消息.因此,基本上,对于每个请求,必须关闭并打开一个新请求.

From why jetty keep giving me the too much data after closed(Will try my best to explain). The connection must be closed after do another connection and request. For example, my upload keep reusing the same request and overflow the request and give me the message. So basically, for each request, must close and open new one.

为预防起见,我在jetty.xml

<Set name="outputBufferSize"><Property name="jetty.output.buffer.size" default="65536" /></Set>
<Set name="requestHeaderSize"><Property name="jetty.request.header.size" default="16384" /></Set>
<Set name="responseHeaderSize"><Property name="jetty.response.header.size" default="16384" /></Set>

这篇关于HttpChannelOverHttp关闭后码头的数据过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆