Commit Graph

23 Commits

Author SHA1 Message Date
Nick Mathewson
39d09ea081 doxygen: add @file declarations for src/lib
If a file doesn't use the file command (either \file or @file),
Doxygen won't try to process it.

These declarations also turned up a doxygen warning for
crypto_ope.c; I fixed that too.
2019-10-26 11:13:29 -04:00
David Goulet
f7e8b3b68c Merge branch 'tor-github/pr/1040' 2019-06-11 11:59:39 -04:00
Nick Mathewson
60213a3621 Run "make autostyle." 2019-06-05 09:33:35 -04:00
Taylor Yu
a8a0144d11 Multiple subscribers or publishers per subsystem
Allow a subsystem to register to publish or subscribe a given message
from multiple places.

Part of ticket 29976.
2019-05-22 16:33:19 -05:00
Nick Mathewson
721e65a1d5 Add comments to include.am files to note where new sources go
This mechanism isn't perfect, and sometimes it will guess wrong,
but it will help our automation.
2019-05-02 09:37:18 -04:00
Nick Mathewson
f58587a68d Don't unconditionally deref pub and sub in lint_message_consistency
This can't actually result in a null pointer dereference, since
pub_excl and sub_excl are only set when the corresponding smartlists
are nonempty.  But coverity isn't smart enough to figure that out,
and we shouldn't really be depending on it.

Bug 29938; CID 1444257.  Bug not in any released Tor.
2019-03-28 09:19:23 -04:00
Nick Mathewson
203e9138d1 Remove message/subsystem numbers from log messages
Having the numbers in those messages makes some of the unit test
unstable, by causing them to depend on the initialization order of
the naming objects.
2019-03-26 19:56:39 -04:00
Nick Mathewson
ddb31dd583 Rename one case of c_type to c_ptr_type. 2019-03-25 16:35:34 -04:00
Nick Mathewson
3f0bfe1d29 Rename DISPATCH_DEFINE_TYPE() to DISPATCH_REGISTER_TYPE()
Also fix a grammar error in a comment.
2019-03-25 16:35:34 -04:00
Nick Mathewson
28fd4996ac Various documentation notes and tweaks for pubsub 2019-03-25 16:35:34 -04:00
Nick Mathewson
a8ca464cee Log warning messages _before_ exiting because of earlier dcfg failure
This helps diagnostics.
2019-03-25 16:35:34 -04:00
Nick Mathewson
4bdff5e3e9 practracker compliance: split lint_message into more logical parts 2019-03-25 16:35:34 -04:00
Nick Mathewson
3552cd69bd coverage: Exclude lines in pubsub_pub that can only be reached on bug 2019-03-25 16:35:34 -04:00
Nick Mathewson
2e7f80d5f4 pubsub_check.c: Stop accepting NULL prefix, which we never send.
(Our code to handle it was broken, too)
2019-03-25 16:35:34 -04:00
Nick Mathewson
beedadbeac Try a different approach to making publish function seem used.
We want the DISPATCH_ADD_PUB() macro to count as making a
DECLARE_PUBLISH() invocation "used", so let's try a new approach
that preserves that idea.  The old one apparently did not work for
some versions of osx clang.
2019-03-25 16:35:34 -04:00
Nick Mathewson
94feec59cf move pubsub_connector_t typedef to pubsub_connect.h 2019-03-25 16:35:34 -04:00
Nick Mathewson
22ad8658cd Correct doxygen @file directives 2019-03-25 16:35:34 -04:00
Nick Mathewson
3d6bf7b36e Document several issues found by Taylor 2019-03-25 16:35:34 -04:00
Nick Mathewson
02e0a39d39 Add msgtypes.h include to pubsub_build.h
(The header won't compile without it.)
2019-03-25 16:35:33 -04:00
Nick Mathewson
24df14eb09 Pubsub: macros for ease-of-use and typesafety. 2019-03-25 16:35:33 -04:00
Nick Mathewson
a7681525ab Add function to clear publish bindings.
When we clean up, we'd like to clear all the bindings that refer to
a dispatch_t, so that they don't have dangling pointers to it.
2019-03-25 16:35:33 -04:00
Nick Mathewson
271a671822 pubsub: relationship checking functionality
This code tries to prevent a large number of possible errors by
enforcing different restrictions on the messages that different
modules publish and subscribe to.

Some of these rules are probably too strict, and some too lax: we
should feel free to change them as needed as we move forward and
learn more.
2019-03-25 16:35:33 -04:00
Nick Mathewson
9e60482b80 Pubsub: an OO layer on top of lib/dispatch
This "publish/subscribe" layer sits on top of lib/dispatch, and
tries to provide more type-safety and cross-checking for the
lower-level layer.

Even with this commit, we're still not done: more checking will come
in the next commit, and a set of usability/typesafety macros will
come after.
2019-03-25 16:35:33 -04:00