服务器提交了协议违规。 Section = ResponseHeader Detail ='Content-Length'标头值无效 [英] The server committed a protocol violation. Section=ResponseHeader Detail='Content-Length' header value is invalid

查看:84
本文介绍了服务器提交了协议违规。 Section = ResponseHeader Detail ='Content-Length'标头值无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将应用程序从.Net 1.1升级到.Net 2.0后,我们开始针对特定网络摄像机出现上述错误。 1.1中的代码有效,但在2.0中抛出协议违规错误。

After upgrading an application from .Net 1.1 to .Net 2.0 we started having the above error for a particular network camera.  The code in 1.1 works, but throws protocol violation error in 2.0.

我发现此错误的唯一解决方案是设置useUnsafeHeader设置为true。我试过这个并且通过代码和配置文件实际实现了它,但是当连接到某个网络摄像机时我仍然会收到错误。

The only solution I've found for this error is to set the useUnsafeHeader setting to true.  I have tried this and actually implemented it through code and through a config file, but I still get the error when connecting to a certain network camera.

实际应用程序连接到网络摄像机并处理包含一系列jpeg的流数据。但我创建了一个虚拟应用程序,只是为了复制确切的问题,并希望解决它。代码如下。您基本上可以创建一个Windows应用程序并粘贴代码,它应该可以工作,可能只需更改命名空间....

The actual application connects to a network camera and processes the streaming data from it containing a series of jpegs.  But I have created a dummy application just to replicate the exact problem and hopefully to resolve it.  The code is provided below.  You can basically create a windows application and paste the code in, it should work, might just have to change the namespace....

如上所述,我连接的服务器是许多网络摄像机中的一个,所以无论如何我无法改变它,我需要处理它的流来显示并保存它们来的jpegs。

As mentioned above, the server I am connecting is one of many network cameras, so I can not change it in anyway, I need to process the stream from it to display and save the jpegs as they come.

以下代码适用于.Net 1.0和.Net 1.1,但在.Net 2.0中不起作用。

The code below works in .Net 1.0 and .Net 1.1, but does not work in .Net 2.0.

以下代码适用于许多其他网络摄像机,但它只是一个制造商的一个网络摄像头,这是不适用的。不幸的是,制造商非常受欢迎,所以我们需要能够处理这个硬件。

The code below works for many other network cameras, but it is just one network camera from one manufacturer that this won't work for.  Unfortunately that manufacturer is very popular so we need to be able to handle this hardware.




Code Snippet

推荐答案

我想帮助你,但我无法重现代理服务器背后的问题。你能得到一个网络嗅探跟踪日志供我查看?


这篇关于服务器提交了协议违规。 Section = ResponseHeader Detail ='Content-Length'标头值无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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