Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
9a3cdeb7
Commit
9a3cdeb7
authored
Jun 16, 2014
by
Alexis La Goutte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some other shorten-64-to-32 casting error found by MSVC (64bits)
Thanks for Pascal
parent
c9b63719
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
lib/nghttp2_buf.c
lib/nghttp2_buf.c
+2
-2
lib/nghttp2_hd.c
lib/nghttp2_hd.c
+16
-16
lib/nghttp2_hd_huffman.c
lib/nghttp2_hd_huffman.c
+2
-2
No files found.
lib/nghttp2_buf.c
View file @
9a3cdeb7
...
@@ -236,7 +236,7 @@ ssize_t nghttp2_bufs_len(nghttp2_bufs *bufs)
...
@@ -236,7 +236,7 @@ ssize_t nghttp2_bufs_len(nghttp2_bufs *bufs)
static
ssize_t
bufs_avail
(
nghttp2_bufs
*
bufs
)
static
ssize_t
bufs_avail
(
nghttp2_bufs
*
bufs
)
{
{
return
nghttp2_buf_avail
(
&
bufs
->
cur
->
buf
)
+
return
(
ssize_t
)
nghttp2_buf_avail
(
&
bufs
->
cur
->
buf
)
+
(
bufs
->
chunk_length
-
bufs
->
offset
)
*
(
bufs
->
max_chunk
-
bufs
->
chunk_used
);
(
bufs
->
chunk_length
-
bufs
->
offset
)
*
(
bufs
->
max_chunk
-
bufs
->
chunk_used
);
}
}
...
@@ -424,7 +424,7 @@ ssize_t nghttp2_bufs_remove(nghttp2_bufs *bufs, uint8_t **out)
...
@@ -424,7 +424,7 @@ ssize_t nghttp2_bufs_remove(nghttp2_bufs *bufs, uint8_t **out)
*
out
=
res
;
*
out
=
res
;
return
len
;
return
(
ssize_t
)
len
;
}
}
void
nghttp2_bufs_reset
(
nghttp2_bufs
*
bufs
)
void
nghttp2_bufs_reset
(
nghttp2_bufs
*
bufs
)
...
...
lib/nghttp2_hd.c
View file @
9a3cdeb7
...
@@ -483,7 +483,7 @@ static size_t encode_length(uint8_t *buf, size_t n, size_t prefix)
...
@@ -483,7 +483,7 @@ static size_t encode_length(uint8_t *buf, size_t n, size_t prefix)
*
buf
++
=
(
1
<<
7
)
|
(
n
&
0x7f
);
*
buf
++
=
(
1
<<
7
)
|
(
n
&
0x7f
);
n
>>=
7
;
n
>>=
7
;
}
else
{
}
else
{
*
buf
++
=
n
;
*
buf
++
=
(
uint8_t
)
n
;
break
;
break
;
}
}
}
while
(
n
);
}
while
(
n
);
...
@@ -883,7 +883,7 @@ static search_result search_hd_table(nghttp2_hd_context *context,
...
@@ -883,7 +883,7 @@ static search_result search_hd_table(nghttp2_hd_context *context,
size_t
i
;
size_t
i
;
uint32_t
name_hash
=
hash
(
nv
->
name
,
nv
->
namelen
);
uint32_t
name_hash
=
hash
(
nv
->
name
,
nv
->
namelen
);
uint32_t
value_hash
=
hash
(
nv
->
value
,
nv
->
valuelen
);
uint32_t
value_hash
=
hash
(
nv
->
value
,
nv
->
valuelen
);
ssize_t
left
=
-
1
,
right
=
STATIC_TABLE_LENGTH
;
ssize_t
left
=
-
1
,
right
=
(
ssize_t
)
STATIC_TABLE_LENGTH
;
int
use_index
=
(
nv
->
flags
&
NGHTTP2_NV_FLAG_NO_INDEX
)
==
0
;
int
use_index
=
(
nv
->
flags
&
NGHTTP2_NV_FLAG_NO_INDEX
)
==
0
;
if
(
use_index
)
{
if
(
use_index
)
{
...
@@ -891,10 +891,10 @@ static search_result search_hd_table(nghttp2_hd_context *context,
...
@@ -891,10 +891,10 @@ static search_result search_hd_table(nghttp2_hd_context *context,
nghttp2_hd_entry
*
ent
=
hd_ringbuf_get
(
&
context
->
hd_table
,
i
);
nghttp2_hd_entry
*
ent
=
hd_ringbuf_get
(
&
context
->
hd_table
,
i
);
if
(
ent
->
name_hash
==
name_hash
&&
name_eq
(
&
ent
->
nv
,
nv
))
{
if
(
ent
->
name_hash
==
name_hash
&&
name_eq
(
&
ent
->
nv
,
nv
))
{
if
(
res
.
index
==
-
1
)
{
if
(
res
.
index
==
-
1
)
{
res
.
index
=
i
;
res
.
index
=
(
ssize_t
)
i
;
}
}
if
(
ent
->
value_hash
==
value_hash
&&
value_eq
(
&
ent
->
nv
,
nv
))
{
if
(
ent
->
value_hash
==
value_hash
&&
value_eq
(
&
ent
->
nv
,
nv
))
{
res
.
index
=
i
;
res
.
index
=
(
ssize_t
)
i
;
res
.
name_value_match
=
1
;
res
.
name_value_match
=
1
;
return
res
;
return
res
;
}
}
...
@@ -919,11 +919,11 @@ static search_result search_hd_table(nghttp2_hd_context *context,
...
@@ -919,11 +919,11 @@ static search_result search_hd_table(nghttp2_hd_context *context,
}
}
if
(
name_eq
(
&
ent
->
nv
,
nv
))
{
if
(
name_eq
(
&
ent
->
nv
,
nv
))
{
if
(
res
.
index
==
-
1
)
{
if
(
res
.
index
==
-
1
)
{
res
.
index
=
context
->
hd_table
.
len
+
static_table
[
i
].
index
;
res
.
index
=
(
ssize_t
)(
context
->
hd_table
.
len
+
static_table
[
i
].
index
)
;
}
}
if
(
use_index
&&
if
(
use_index
&&
ent
->
value_hash
==
value_hash
&&
value_eq
(
&
ent
->
nv
,
nv
))
{
ent
->
value_hash
==
value_hash
&&
value_eq
(
&
ent
->
nv
,
nv
))
{
res
.
index
=
context
->
hd_table
.
len
+
static_table
[
i
].
index
;
res
.
index
=
(
ssize_t
)(
context
->
hd_table
.
len
+
static_table
[
i
].
index
)
;
res
.
name_value_match
=
1
;
res
.
name_value_match
=
1
;
return
res
;
return
res
;
}
}
...
@@ -1274,7 +1274,7 @@ ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater,
...
@@ -1274,7 +1274,7 @@ ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater,
return
rv
;
return
rv
;
}
}
return
buflen
;
return
(
ssize_t
)
buflen
;
}
}
size_t
nghttp2_hd_deflate_bound
(
nghttp2_hd_deflater
*
deflater
,
size_t
nghttp2_hd_deflate_bound
(
nghttp2_hd_deflater
*
deflater
,
...
@@ -1365,7 +1365,7 @@ static ssize_t hd_inflate_read_len(nghttp2_hd_inflater *inflater,
...
@@ -1365,7 +1365,7 @@ static ssize_t hd_inflate_read_len(nghttp2_hd_inflater *inflater,
maxlen
));
maxlen
));
return
NGHTTP2_ERR_HEADER_COMP
;
return
NGHTTP2_ERR_HEADER_COMP
;
}
}
return
nin
-
in
;
return
(
ssize_t
)(
nin
-
in
)
;
}
}
/*
/*
...
@@ -1428,8 +1428,8 @@ static ssize_t hd_inflate_read(nghttp2_hd_inflater *inflater,
...
@@ -1428,8 +1428,8 @@ static ssize_t hd_inflate_read(nghttp2_hd_inflater *inflater,
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
return
rv
;
return
rv
;
}
}
inflater
->
left
-=
len
;
inflater
->
left
-=
(
ssize_t
)
len
;
return
len
;
return
(
ssize_t
)
len
;
}
}
/*
/*
...
@@ -1758,7 +1758,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
...
@@ -1758,7 +1758,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
/* If rv == 1, no header was emitted */
/* If rv == 1, no header was emitted */
if
(
rv
==
0
)
{
if
(
rv
==
0
)
{
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
return
in
-
first
;
return
(
ssize_t
)(
in
-
first
)
;
}
}
}
else
{
}
else
{
inflater
->
index
=
inflater
->
left
;
inflater
->
index
=
inflater
->
left
;
...
@@ -1877,7 +1877,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
...
@@ -1877,7 +1877,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
}
}
inflater
->
state
=
NGHTTP2_HD_STATE_OPCODE
;
inflater
->
state
=
NGHTTP2_HD_STATE_OPCODE
;
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
return
in
-
first
;
return
(
ssize_t
)(
in
-
first
)
;
}
}
if
(
inflater
->
huffman_encoded
)
{
if
(
inflater
->
huffman_encoded
)
{
...
@@ -1918,7 +1918,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
...
@@ -1918,7 +1918,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
inflater
->
state
=
NGHTTP2_HD_STATE_OPCODE
;
inflater
->
state
=
NGHTTP2_HD_STATE_OPCODE
;
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
return
in
-
first
;
return
(
ssize_t
)(
in
-
first
)
;
case
NGHTTP2_HD_STATE_READ_VALUE
:
case
NGHTTP2_HD_STATE_READ_VALUE
:
rv
=
hd_inflate_read
(
inflater
,
&
inflater
->
nvbufs
,
in
,
last
);
rv
=
hd_inflate_read
(
inflater
,
&
inflater
->
nvbufs
,
in
,
last
);
if
(
rv
<
0
)
{
if
(
rv
<
0
)
{
...
@@ -1950,7 +1950,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
...
@@ -1950,7 +1950,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
inflater
->
state
=
NGHTTP2_HD_STATE_OPCODE
;
inflater
->
state
=
NGHTTP2_HD_STATE_OPCODE
;
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
return
in
-
first
;
return
(
ssize_t
)(
in
-
first
)
;
}
}
}
}
...
@@ -1978,13 +1978,13 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
...
@@ -1978,13 +1978,13 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
(
ent
->
flags
&
NGHTTP2_HD_FLAG_EMIT
)
==
0
)
{
(
ent
->
flags
&
NGHTTP2_HD_FLAG_EMIT
)
==
0
)
{
emit_indexed_header
(
nv_out
,
ent
);
emit_indexed_header
(
nv_out
,
ent
);
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_EMIT
;
return
in
-
first
;
return
(
ssize_t
)(
in
-
first
)
;
}
}
ent
->
flags
&=
~
NGHTTP2_HD_FLAG_EMIT
;
ent
->
flags
&=
~
NGHTTP2_HD_FLAG_EMIT
;
}
}
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_FINAL
;
*
inflate_flags
|=
NGHTTP2_HD_INFLATE_FINAL
;
}
}
return
in
-
first
;
return
(
ssize_t
)(
in
-
first
)
;
almost_ok:
almost_ok:
if
(
in_final
&&
inflater
->
state
!=
NGHTTP2_HD_STATE_OPCODE
)
{
if
(
in_final
&&
inflater
->
state
!=
NGHTTP2_HD_STATE_OPCODE
)
{
...
...
lib/nghttp2_hd_huffman.c
View file @
9a3cdeb7
...
@@ -95,7 +95,7 @@ static ssize_t huff_encode_sym(nghttp2_bufs *bufs, size_t *avail_ptr,
...
@@ -95,7 +95,7 @@ static ssize_t huff_encode_sym(nghttp2_bufs *bufs, size_t *avail_ptr,
*
avail_ptr
=
nghttp2_bufs_cur_avail
(
bufs
);
*
avail_ptr
=
nghttp2_bufs_cur_avail
(
bufs
);
}
}
}
}
return
rembits
;
return
(
ssize_t
)
rembits
;
}
}
size_t
nghttp2_hd_huff_encode_count
(
const
uint8_t
*
src
,
size_t
len
)
size_t
nghttp2_hd_huff_encode_count
(
const
uint8_t
*
src
,
size_t
len
)
...
@@ -203,5 +203,5 @@ ssize_t nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
...
@@ -203,5 +203,5 @@ ssize_t nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
if
(
final
&&
!
ctx
->
accept
)
{
if
(
final
&&
!
ctx
->
accept
)
{
return
NGHTTP2_ERR_HEADER_COMP
;
return
NGHTTP2_ERR_HEADER_COMP
;
}
}
return
i
;
return
(
ssize_t
)
i
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment