nghttp2_session_resume_data: Return error if no deferred data exist

This commit is contained in:
Tatsuhiro Tsujikawa 2014-04-03 00:01:35 +09:00
parent 580a19e097
commit c53c1dc669
2 changed files with 4 additions and 6 deletions

View File

@ -1848,7 +1848,8 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
* negative error codes:
*
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The stream does not exist or no deferred data exist.
* The stream does not exist; or no deferred data exist; or data
* was deferred by flow control.
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
*/

View File

@ -5468,14 +5468,11 @@ int nghttp2_session_resume_data(nghttp2_session *session, int32_t stream_id)
nghttp2_stream *stream;
stream = nghttp2_session_get_stream(session, stream_id);
if(stream == NULL ||
nghttp2_stream_check_deferred_by_flow_control(stream)) {
nghttp2_stream_check_deferred_by_flow_control(stream) ||
!nghttp2_stream_check_deferred_data(stream)) {
return NGHTTP2_ERR_INVALID_ARGUMENT;
}
if(!nghttp2_stream_check_deferred_data(stream)) {
return 0;
}
rv = nghttp2_stream_resume_deferred_data(stream, &session->ob_pq);
if(nghttp2_is_fatal(rv)) {