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

Ticket30007 v2 refactor control response formatting #984

Merged
merged 9 commits into from May 3, 2019

Conversation

Labels
None yet
Projects
None yet
3 participants
@tlyu
Copy link
Contributor

@tlyu tlyu commented Apr 26, 2019

This is a rebased version of #956, rebased on #980. I verified that the Coccinelle changes are equivalent by diffing the output of the Coccinelle run against the rebased committed previous Coccinelle output.

@coveralls
Copy link

@coveralls coveralls commented Apr 26, 2019

Pull Request Test Coverage Report for Build 4907

  • 42 of 215 (19.53%) changed or added relevant lines in 5 files are covered.
  • 31 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.02%) to 62.342%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/feature/control/control.c 0 4 0.0%
src/feature/control/control_getinfo.c 0 7 0.0%
src/feature/control/control_auth.c 0 10 0.0%
src/feature/control/control_proto.c 42 100 42.0%
src/feature/control/control_cmd.c 0 94 0.0%
Files with Coverage Reduction New Missed Lines %
src/feature/control/control_getinfo.c 2 27.75%
src/feature/control/control_auth.c 6 12.09%
src/feature/control/control_cmd.c 23 15.7%
Totals Coverage Status
Change from base Build 4905: -0.02%
Covered Lines: 46310
Relevant Lines: 74284

💛 - Coveralls

tlyu added 9 commits Apr 30, 2019
Split the core reply formatting code out of control_fmt.c into
control_proto.c.  The remaining code in control_format.c deals with
specific subsystems and will eventually move to join those subsystems.
Refer to control-spec.txt grammar productions in comments in
control_proto.c for clarity.
Create a set of abstractions for controller commands and events to
output replies to the control channel.  The control protocol has a
relatively consistent SMTP-like structure, so it's helpful when code
that implements control commands and events doesn't explicitly format
everything on its own.
Manually fix up some reply-generating code that the Coccinelle scripts
won't match.  Some more complicated ones remain -- these are mostly
ones that accumulate data to send, and then call connection_buf_add()
or connection_write_str_to_buf() directly.
Clean up some minor formatting quirks after the Coccinelle run.
@tlyu tlyu force-pushed the ticket30007_v2 branch from 58479aa to 0900367 Apr 30, 2019
@tlyu
Copy link
Contributor Author

@tlyu tlyu commented Apr 30, 2019

Rebased to master. Re-verified Coccinelle output.

@torproject-pusher torproject-pusher merged commit 0900367 into torproject:master May 3, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment