return -1;
}
+ if(!stream) {
+ /* Abnormal call sequence: either this transfer has never opened a stream
+ * (unlikely) or the transfer has been done, cleaned up its resources, but
+ * a read() is called anyway. It is not clear what the calling sequence
+ * is for such a case. */
+ failf(data, "http2_recv: http/2 recv on a transfer never opened "
+ "or already cleared\n");
+ *err = CURLE_HTTP2;
+ return -1;
+ }
+
/* Nullify here because we call nghttp2_session_send() and they
might refer to the old buffer. */
stream->upload_mem = NULL;