Fix HEADERS padding is not added

This commit is contained in:
Tatsuhiro Tsujikawa 2014-02-11 17:21:34 +09:00
parent cf0b880b15
commit 788072af9b
1 changed files with 3 additions and 3 deletions

View File

@ -1156,13 +1156,13 @@ static ssize_t nghttp2_session_prep_frame(nghttp2_session *session,
nghttp2_session_after_frame_sent(). */ nghttp2_session_after_frame_sent(). */
framebuflen += frame->headers.padlen; framebuflen += frame->headers.padlen;
} else if(frame->hd.length <= NGHTTP2_MAX_FRAME_LENGTH && } else if(frame->hd.length <= NGHTTP2_MAX_FRAME_LENGTH &&
padded_payloadlen > frame->hd.length) { frame->headers.padlen > 0) {
r = nghttp2_frame_add_pad(&session->aob.framebuf, r = nghttp2_frame_add_pad(&session->aob.framebuf,
&session->aob.framebufmax, &session->aob.framebufmax,
&session->aob.framebufoff, &session->aob.framebufoff,
&frame->hd.flags, &frame->hd.flags,
frame->hd.length, frame->hd.length - frame->headers.padlen,
padded_payloadlen - frame->hd.length); frame->headers.padlen);
if(nghttp2_is_fatal(r)) { if(nghttp2_is_fatal(r)) {
return r; return r;
} }