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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cobalt/network/dial/dial_udp_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()

// RecvFrom can also return the number of received bytes right away as well.
DidRead(err_code);
} else if (err_code != net::ERR_IO_PENDING) {
Expand Down
Loading