Skip to content

Commit

Permalink
daemon/session2: comment on event propagation
Browse files Browse the repository at this point in the history
Minor, but I believe quite important. I stumbled across this while
writing the protocol layer article and thought it was not emphasized
enough in the docs.
  • Loading branch information
Oto Šťáva committed Aug 28, 2024
1 parent 672dd13 commit 654a60c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion daemon/session2.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,12 @@ enum protolayer_event_cb_result {
*
* When `PROTOLAYER_EVENT_PROPAGATE` is returned, iteration over the sequence
* of layers continues. When `PROTOLAYER_EVENT_CONSUME` is returned, iteration
* stops. */
* stops.
*
* **IMPORTANT:** A well-behaved layer will **ALWAYS** propagate events it knows
* nothing about. Only ever consume events you actually have good reason to
* consume (like TLS consumes `CONNECT` from TCP, because it needs to perform
* its own handshake first). */
typedef enum protolayer_event_cb_result (*protolayer_event_cb)(
enum protolayer_event_type event, void **baton,
struct session2 *session, void *sess_data);
Expand Down

0 comments on commit 654a60c

Please sign in to comment.