Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Use bitflags instead of bitfields for various configs/settings/states #12

Merged
merged 5 commits into from
May 26, 2017

Conversation

NathanFrench
Copy link
Collaborator

@NathanFrench NathanFrench commented May 26, 2017

Most of these are used internally only - but if not - use the following functions now:

evhtp_(enable|disable)_flag : EVHTP_FLAG_ENABLE_100_CONT, EVHTP_FLAG_ENABLE_REUSEPORT. EVHTP_FLAG_ENABLE_NODELAY. EVHTP_FLAG_ENABLE_DEFER_ACCEPT, EVHTP_FLAG_DEFAULTS

evhtp_connection_(enable|disable)_flag: EVHTP_CONN_FLAG_ERROR, EVHTP_CONN_FLAG_OWNER, EVHTP_CONN_FLAG_VHOST_VIA_SNI, EVHTP_CONN_FLAG_PAUSED. EVHTP_CONN_FLAG_CONNECTED, EVHTP_CONN_FLAG_WAITING, EVHTP_CONN_FLAG_FREE_CONN. EVHTP_CONN_FLAG_KEEPALIVE

evhtp_request_(enable|disable)_flag: EVHTP_REQ_FLAG_KEEPALIVE, EVHTP_REQ_FLAG_FINISHED, EVHTP_REQ_FLAG_CHUNKED, EVHTP_REQ_FLAG_ERROR

- Each context will now contain a context-specific bitmask containing
  proper configuration and ownership information.

- Side-effects: the evhtp struct has been changed to reflect this
  new ordering. This removes the following defined variables:

    disable_100_cont;
    enable_reuseport;
    enable_nodelay;
    enable_defer_accept;

  Use the following bitmask instead:

    EVHTP_FLAG_ENABLE_100_CONT (on by defualt)
    EVHTP_FLAG_ENABLE_REUSEPORT
    EVHTP_FLAG_ENABLE_NODELAY
    EVHTP_FLAG_ENABLE_DEFER_ACCEPT

- Optimally, use the evhtp_enable_flag() and or evhtp_set_flags() for
  best future uses.
- The following bitflags have been replaced with the following bitmasks
   inside the connection context.

  error     : EVHTP_CONN_FLAG_ERROR
  owner     : EVHTP_CONN_FLAG_OWNER
  vhost_via : EVHTP_CONN_FLAG_VHOST_VIA_SNI
  paused    : EVHTP_CONN_FLAG_PAUSED
  connected : EVHTP_CONN_FLAG_CONNECTED
  waiting   : EVHTP_CONN_FLAG_WAITING
  free      : EVHTP_CONN_FLAG_FREE_CONN
  keepalive : EVHTP_CONN_FLAG_KEEPALIVE

- Side effects: users should not notice any changes, these
  are mostly internal flags.
- created evhtp_(type)_[enable|diable] functions for setting and
  unsetting flags for each datatype.
- general cleanup.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant