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

Function on_data_chunk_recv_cb

modules/http2/h2_session.c:234–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234static int on_data_chunk_recv_cb(nghttp2_session *ngh2, uint8_t flags,
235 int32_t stream_id,
236 const uint8_t *data, size_t len, void *userp)
237{
238 h2_session *session = (h2_session *)userp;
239 apr_status_t status = APR_EINVAL;
240 h2_stream * stream;
241 int rv = 0;
242
243 stream = get_stream(session, stream_id);
244 if (stream) {
245 ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, session->c1,
246 H2_SSSN_STRM_MSG(session, stream_id, "write %ld bytes of DATA"),
247 (long)len);
248 status = h2_stream_recv_DATA(stream, flags, data, len);
249 }
250 else {
251 ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c1, APLOGNO(03064)
252 H2_SSSN_STRM_MSG(session, stream_id,
253 "on_data_chunk for unknown stream"));
254 rv = NGHTTP2_ERR_CALLBACK_FAILURE;
255 }
256
257 if (status != APR_SUCCESS) {
258 /* count this as consumed explicitly as no one will read it */
259 nghttp2_session_consume(session->ngh2, stream_id, len);
260 }
261 return rv;
262}
263
264static int on_stream_close_cb(nghttp2_session *ngh2, int32_t stream_id,
265 uint32_t error_code, void *userp)

Callers

nothing calls this directly

Calls 2

get_streamFunction · 0.85
h2_stream_recv_DATAFunction · 0.85

Tested by

no test coverage detected