nghttp2_data_source_read_callback: Replace eof with uint32_t *data_flags

Replace int *eof with uint32_t *data_flags so that we can easily
extend functionality if we have to (but we don't do if possible).
This commit is contained in:
Tatsuhiro Tsujikawa
2014-04-05 17:59:24 +09:00
parent a0d93e7744
commit e7ad3633c7
8 changed files with 52 additions and 34 deletions

View File

@@ -328,7 +328,7 @@ static char* percent_decode(const uint8_t *value, size_t valuelen)
static ssize_t file_read_callback
(nghttp2_session *session, int32_t stream_id,
uint8_t *buf, size_t length, int *eof,
uint8_t *buf, size_t length, uint32_t *data_flags,
nghttp2_data_source *source, void *user_data)
{
int fd = source->fd;
@@ -338,7 +338,7 @@ static ssize_t file_read_callback
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
}
if(r == 0) {
*eof = 1;
*data_flags |= NGHTTP2_DATA_FLAG_EOF;
}
return r;
}