MCPcopy Create free account
hub / github.com/apache/httpd / send_cb

Function send_cb

modules/http2/h2_session.c:187–212  ·  view source on GitHub ↗

* Callback when nghttp2 wants to send bytes back to the client. */

Source from the content-addressed store, hash-verified

185 * Callback when nghttp2 wants to send bytes back to the client.
186 */
187static ssize_t send_cb(nghttp2_session *ngh2,
188 const uint8_t *data, size_t length,
189 int flags, void *userp)
190{
191 h2_session *session = (h2_session *)userp;
192 apr_status_t rv;
193 (void)ngh2;
194 (void)flags;
195
196 if (h2_c1_io_needs_flush(&session->io)) {
197 return NGHTTP2_ERR_WOULDBLOCK;
198 }
199
200 rv = h2_c1_io_add_data(&session->io, (const char *)data, length);
201 if (APR_SUCCESS == rv) {
202 return length;
203 }
204 else if (APR_STATUS_IS_EAGAIN(rv)) {
205 return NGHTTP2_ERR_WOULDBLOCK;
206 }
207 else {
208 ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, session->c1,
209 APLOGNO(03062) "h2_session: send error");
210 return h2_session_status_from_apr_status(rv);
211 }
212}
213
214static int on_invalid_frame_recv_cb(nghttp2_session *ngh2,
215 const nghttp2_frame *frame,

Callers

nothing calls this directly

Calls 3

h2_c1_io_needs_flushFunction · 0.85
h2_c1_io_add_dataFunction · 0.85

Tested by

no test coverage detected