• Home
  • Raw
  • Download

Lines Matching refs:we

4 In this tutorial, we are going to write a single-threaded, event-based
27 example program, when creating the ``SSL_CTX`` object, we store the
29 allocated buffer. This is safe because we only create one ``SSL_CTX``
92 identifier. In this tutorial, we advertise the specific HTTP/2
96 OpenSSL implementation, we just assign the pointer to the NPN buffers
97 we filled in earlier. The NPN callback function is set to the
100 In ``alpn_select_proto_cb()``, we use `nghttp2_select_next_protocol()`
135 A single HTTP/2 session can have multiple streams. To manage them, we
196 Here we create the ``http2_session_data`` object. The connection's
249 Here we validate that HTTP/2 is negotiated, and if not, drop
253 ``BEV_EVENT_TIMEOUT`` events, we just simply tear down the connection.
260 completed successfully. After this we are ready to begin communicating
290 Since we are creating a server, we use `nghttp2_session_server_new()`
312 In the example SETTINGS frame we've set
320 Since bufferevent may buffer more than the first 24 bytes from the client, we
322 this pending data. To process the received data, we call the
346 In this function, we feed all unprocessed but already received data to
350 outgoing frames. To send any pending outgoing frames, we immediately
383 Since we use bufferevent to abstract network I/O, we just write the
385 continues to write all frames queued so far. If we were writing the
387 call in the ``send_callback()``, we'd soon receive an ``EAGAIN`` or
391 when writing to the bufferevent, we have to regulate the amount data
393 achieve this, we check the size of the output buffer and if it reaches
394 more than or equal to ``OUTPUT_WOULDBLOCK_THRESHOLD`` bytes, we stop
408 In this function, we just call ``session_recv()`` to process incoming
430 First we check whether we should drop the connection or not. The
437 Since we are using bufferevent and its deferred callback option, the
439 ``writecb()`` is called. To handle this, we check whether the output
440 buffer is empty or not. If all of these conditions are met, we drop
443 Otherwise, we call ``session_send()`` to process the pending output
444 data. Remember that in ``send_callback()``, we must not write all data to
472 the HEADERS frame has several roles in the HTTP/2 protocol, we check
474 a request HEADERS, we create a ``http2_stream_data`` object to store
481 In this example server, we want to serve files relative to the current working
516 example program, we ignore the ``:method`` header field and always
547 First we retrieve the ``http2_stream_data`` object associated with the
550 cannot be served for some reason (e.g. file is not found), we send a
551 404 response using ``error_reply()``. Otherwise, we open
576 server, we use it as a file descriptor. We also set the
598 If an error occurs while reading the file, we return
602 that we have finished reading the file.
624 Lastly, we destroy the ``http2_stream_data`` object in this function,
625 since the stream is about to close and we no longer need the object.