Skip to content

Fix 'recv' function 'flags_' argument default value #328

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

Merged
merged 1 commit into from
Jul 24, 2019

Conversation

xiphon
Copy link
Contributor

@xiphon xiphon commented Jun 1, 2019

No description provided.

@coveralls
Copy link

coveralls commented Jun 1, 2019

Pull Request Test Coverage Report for Build 246

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 85.62%

Files with Coverage Reduction New Missed Lines %
zmq.hpp 4 83.14%
Totals Coverage Status
Change from base Build 243: -0.3%
Covered Lines: 649
Relevant Lines: 758

💛 - Coveralls

@sigiesec
Copy link
Member

sigiesec commented Jun 1, 2019

Thanks for the PR!

It's not completely clear to me what problem this fixes. Could you add a test case that is fixed by your change?

@xiphon
Copy link
Contributor Author

xiphon commented Jun 1, 2019

flags_ argument was defaulted to 0 previously (v4.3.0), i.e. bool recv(message_t *msg_, int flags_ = 0); https://github.com/zeromq/cppzmq/blob/v4.3.0/zmq.hpp#L722

That was obviously accidentally changed in 3d4be81 resulting in non-optional flags_ breaking backward compatibility for client code invoking bool result = recv(&msg); call.

Let me know if you have any further questions.

@xiphon xiphon force-pushed the fix-recv-flags-default branch from f40558c to 46b25b2 Compare June 1, 2019 16:00
@xiphon
Copy link
Contributor Author

xiphon commented Jun 1, 2019

Updated. Added a test case.

@xiphon xiphon force-pushed the fix-recv-flags-default branch from 46b25b2 to e2fdace Compare June 1, 2019 16:05
@gummif
Copy link
Member

gummif commented Jun 1, 2019

You are correct that this is a bug, and I think the fix is simply removing the #ifdef completely, that is int flags_ = 0 as it was before.

@xiphon xiphon force-pushed the fix-recv-flags-default branch from e2fdace to 19b5222 Compare June 2, 2019 02:01
@xiphon
Copy link
Contributor Author

xiphon commented Jun 2, 2019

Updated

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.

4 participants