HTTP2::stream

Description

Gets or sets the stream attributes including id and priority. The subcommands include commands to get the current stream id. The subcommands also include commands to get or set the current stream priority.

Syntax

HTTP2::stream
HTTP2::stream id
HTTP2::stream priority
HTTP2::stream <priority>

HTTP2::stream

  • Returns the stream id. Returns 0 if HTTP/2 is not active.

HTTP2::stream id

  • Returns the stream id. Returns 0 if HTTP/2 is not active.

HTTP2::stream priority

  • Returns the priority of the current stream.

HTTP2::stream priority <priority>

  • Sets the priority of the current active stream. The return is 0 is the priority was set. Return is an error if the priority is out of bounds (exceeding 8 bits).

Examples

when HTTP_REQUEST {
  if {[HTTP2::version] != 0} {
    set new_pri [URI::query [HTTP::uri] pri]
    if { $new_pri != "" } {
      HTTP2::priority $new_pri
    }
    HTTP::header insert "X-HTTP2-Values stream/priority " "[HTTP2::stream]/[HTTP2::priority]"
  }
}