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

WriteEntry Constructor called with Incorrect Parameters in Transport::asyncWriteImpl #1168

Open
dgreatwood opened this issue Nov 18, 2023 · 0 comments

Comments

@dgreatwood
Copy link
Contributor

dgreatwood commented Nov 18, 2023

There is a fragment of code in transport.cc:

                        // pop_front kills buffer - so we cannot continue loop or use buffer
                        // after this point
                        wq.pop_front();
                        wq.push_front(WriteEntry(std::move(deferred), bufferHolder, flags));

BUT the WriteEntry constructor is:

WriteEntry(Async::Deferred<ssize_t> deferred_, BufferHolder buffer_,
                       Fd peerFd_, int flags_ = 0)

So this invocation of the WriteEntry constructor is passing variable flags as the input to Fd peerFd_. This only compiles because both flags and type Fd have type int, and then the missing WriteEntry constructor parameter (flags_) has a default value.

Can it be changed to:
wq.push_front(WriteEntry(std::move(deferred), bufferHolder, fd, flags));
(I think the parameter to add is fd? Not buffer.fd() or something else?)

Thanks!

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

No branches or pull requests

1 participant