Deco is not properly closing an http connection to its web-server

Deco is not properly closing an http connection to its web-server

Deco is not properly closing an http connection to its web-server
Deco is not properly closing an http connection to its web-server
a week ago
Model: Deco XE75 Pro  
Hardware Version: V1
Firmware Version: 1.4.5 Build 20241129 Rel. 47521

Hello there!

 

I have a weird issue with my Deco router when sending HTTP requests to it.

 

It always has these headers in the response:

```

Connection: close

Transfer-Encoding: chunked
```

Which is fine, and most of the time everything works as intended: the client receives a correct response and closes the TCP connection.

 

But sometimes (about 2.5% of requests in my testing), the router starts the response as usual, giving out all the data, but instead of sending the last empty chunk to specify that all the data had been transferred, the router starts to repeatedly send Keep-Alive packets, does it for ~30 seconds, and then closes the connection with a [FIN, ACK] packet.

So the client never receives the empty chunk and thinks that the server closed the connection prematurely, which results in some kind of error on every client that I've tried.

 

What I have tried:

1. Sending `Connection: close` header from client, hoping that the router won't send Keep-Alive

2. Switching to HTTP 1.0 protocol

3. Rebooting all the routers in my mesh

4. Different client implementations (python requests lib, curl, Bruno)

 

The behavior persists. Except that while using HTTP 1.0, curl does not expect the empty chunk, and it is not resulting in an error, but it still takes 30 seconds to wait while the server closes the connection to return a response, so it is far from ideal.

 

I didn't find anything suspicious in the router logs for that matter; however, I have them attached below.

 

Here is a bash script that I was using for testing:

```
success=0; fail=0; for i in {1..1000}; do echo "Running request $i"; curl --silent --request POST --url 'http://<router_ip>/cgi-bin/luci/;stok=/login?form=keys&operation=read' > /dev/null; rc=$?; ((rc==0?success++:fail++)); done; echo "Success:$success Fail:$fail"

```

Here I have gathered the router logs while this was happening, as well as Wireshark traces of good and bad responses:

https://drive.google.com/drive/folders/1kKIYcusk27JozP3pSsOb7RcQGklFs7zY?usp=sharing

 

Please tell me if I can help you by providing some more information

Thank you!

  1      
  1      
#1
Options
3 Reply
Re:Deco is not properly closing an http connection to its web-server
a week ago
Need help with the Deco app, setup, Ethernet backhaul, network switch or rolling back firmware? Router or AP mode? https://community.tp-link.com/us/home/forum/topic/699816?page=1
  0  
  0  
#2
Options
Re:Deco is not properly closing an http connection to its web-server
a week ago

  @Yundin 

Hi, I'll forward your testing result to the senior engineer for further analysis.

 By the way, have you noticed any abnormal network behaviors or performance decline when the connected client never receives the empty HTTP chunk?

Or what kinds of errors have you received?

"So the client never receives the empty chunk and thinks that the server closed the connection prematurely, which results in some kind of error on every client that I've tried."

 

Wait for your reply.

Best regards.

  1  
  1  
#3
Options
Re:Deco is not properly closing an http connection to its web-server
a week ago - last edited a week ago

  @David-TP 

Thank you for hopping in!

So the flow of a bad response looks like this

 

Using python requests lib:

1. Sending requests

2. Hanging for 30s

3. Getting exception: "requests.exceptions.ChunkedEncodingError: Response ended prematurely"

 

Using curl:

1. Sending requests

2. Hanging for 30s

3. Getting exception: "curl: (18) transfer closed with outstanding read data remaining"

 

Using Bruno:

1. Sending requests

2. Hanging for 30s

3. Getting exception: "stream has been aborted"

 

All network functions, including requests to other devices and services both inside and outside the home network, work perfectly fine during this issue, with no performance degradation whatsoever.

 

This issue is important to me because it makes it significantly harder to integrate Deco into third-party smart home systems like Home Assistant. The frequent hanging and failing requests make it impossible to reliably determine the router’s status.

  1  
  1  
#4
Options