int nghttp2_stream_attach_item(nghttp2_stream *stream, nghttp2_outbound_item *item, nghttp2_session *session) { assert((stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_ALL) == 0); assert(stream->item == NULL); DEBUGF(fprintf(stderr, "stream: stream=%d attach item=%p\n", stream->stream_id, item)); stream->item = item; return stream_update_dep_on_attach_item(stream, session); }
int nghttp2_stream_resume_deferred_item(nghttp2_stream *stream, uint8_t flags) { assert(stream->item); DEBUGF(fprintf(stderr, "stream: stream=%d resume item=%p flags=%02x\n", stream->stream_id, stream->item, flags)); stream->flags &= ~flags; if (stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_ALL) { return 0; } return stream_update_dep_on_attach_item(stream); }
int nghttp2_stream_attach_item(nghttp2_stream *stream, nghttp2_outbound_item *item) { int rv; assert((stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_ALL) == 0); assert(stream->item == NULL); DEBUGF("stream: stream=%d attach item=%p\n", stream->stream_id, item); stream->item = item; rv = stream_update_dep_on_attach_item(stream); if (rv != 0) { /* This may relave stream->queued == 1, but stream->item == NULL. But only consequence of this error is fatal one, and session destruction. In that execution path, these inconsistency does not matter. */ stream->item = NULL; return rv; } return 0; }