Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIAL service improvement to handle zero size SSDP request. #4680

Open
wants to merge 1 commit into
base: 24.lts.1+
Choose a base branch
from

Conversation

iuriionishchenko
Copy link
Collaborator

DIAL service improvement to handle zero size SSDP request.

b/268088112

Change-Id: Icf349616bbf65bbf3408f54a9f5d27b8fdf7bf76

b/268088112

Change-Id: Icf349616bbf65bbf3408f54a9f5d27b8fdf7bf76
@iuriionishchenko
Copy link
Collaborator Author

In some cases iPhone sends SSDP request with data length 0 or for some reason recvfrom() returns 0.
But expected value should be greater than 0 or negative value. This update allows to handle requests that have data length equal to 0.

@@ -126,7 +126,7 @@ void DialUdpServer::AcceptAndProcessConnection() {
auto err_code = socket_->RecvFrom(
read_buf_.get(), kReadBufferSize, &client_address_,
base::Bind(&DialUdpServer::DidRead, base::Unretained(this)));
if (err_code > 0) {
if (err_code >= 0) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some cases iPhone sends SSDP request with data length 0 or for some reason recvfrom() returns 0 and DialUdpServer::DidRead() is not called as callback function (line 128). But DialUdpServer::DidRead() must be called to initiate receiving of next request. This update allows to handle requests that have data length equal to 0 and call DialUdpServer::DidRead()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants