Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of truncation of incomplete response data of HTTP service

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

The knowledge points of this article "how to solve the problem of incomplete response data truncation of HTTP service response data" are not quite understood by most people, so the editor summarizes the following contents. The content is detailed, the steps are clear, and it has a certain reference value. I hope you can gain something after reading this article. Let's take a look at this article entitled "how to solve the problem of incomplete response data truncation of HTTP service response data".

Background

The xml data of Dahua camera Onvif protocol response did not carry a namespace, which led to the failure of Onvif protocol service parsing. In order to be compatible with this camera, it was decided to modify onvif_client and ignore the namespace. Since there is no problem with the camera locally, you need to start the HTTP server to simulate the Onvif protocol, receive the http request sent by the Onvif client and respond.

problem

After a request from the onvif client is modified, the ip and the port are successfully connected to the HTTP server, the request is successful, but the xml data of the HTTP service response is truncated, and the packet grab shows that the connection is closed after the HTTP server data is sent.

Solution

With the help of the leader, the reason is that the http request sent by the onvif client does not carry a keep-alive header, which causes the http connection to be not a persistent connection and the HTTP server shuts down actively. Check the HTTP server source code to find keep-alive

Grep-rn "keep-alive". /

Find key information

If the connection header is present in the request and its value isn't keep-alive, then close

View the source code

Find the key code and comment out the close logo to ensure the integrity of the data transmission without carrying the keep-alive request header.

The above is the content of this article on "how to solve the problem of incomplete response data truncation of HTTP service response data". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report