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
b06fa25a
Commit
b06fa25a
authored
May 20, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compile error with -Wshadow. Fixed const cast.
parent
6f066d7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
27 deletions
+28
-27
lib/spdylay_client_cert_vector.c
lib/spdylay_client_cert_vector.c
+3
-3
lib/spdylay_frame.c
lib/spdylay_frame.c
+22
-22
lib/spdylay_session.c
lib/spdylay_session.c
+3
-2
No files found.
lib/spdylay_client_cert_vector.c
View file @
b06fa25a
...
...
@@ -68,12 +68,12 @@ int spdylay_client_cert_vector_init(spdylay_client_cert_vector *certvec,
certvec
->
size
=
certvec
->
capacity
=
size
;
certvec
->
last_slot
=
0
;
if
(
certvec
->
capacity
)
{
size_t
size
=
sizeof
(
spdylay_origin
*
)
*
certvec
->
capacity
;
certvec
->
vector
=
malloc
(
size
);
size_t
vec_
size
=
sizeof
(
spdylay_origin
*
)
*
certvec
->
capacity
;
certvec
->
vector
=
malloc
(
vec_
size
);
if
(
certvec
->
vector
==
NULL
)
{
return
SPDYLAY_ERR_NOMEM
;
}
memset
(
certvec
->
vector
,
0
,
size
);
memset
(
certvec
->
vector
,
0
,
vec_
size
);
}
else
{
certvec
->
vector
=
NULL
;
}
...
...
lib/spdylay_frame.c
View file @
b06fa25a
...
...
@@ -195,11 +195,11 @@ int spdylay_frame_unpack_nv_check_name(uint8_t *buf, size_t buflen,
{
uint32_t
n
;
size_t
i
;
const
uint8_t
**
i
nde
x
;
const
uint8_t
**
i
d
x
;
n
=
spdylay_frame_get_nv_len
(
in
,
len_size
);
assert
(
n
*
sizeof
(
char
*
)
<=
buflen
);
in
+=
len_size
;
i
nde
x
=
(
const
uint8_t
**
)
buf
;
i
d
x
=
(
const
uint8_t
**
)
buf
;
for
(
i
=
0
;
i
<
n
;
++
i
)
{
uint32_t
len
;
size_t
j
;
...
...
@@ -207,7 +207,7 @@ int spdylay_frame_unpack_nv_check_name(uint8_t *buf, size_t buflen,
if
(
len
==
0
)
{
return
SPDYLAY_ERR_INVALID_HEADER_BLOCK
;
}
*
i
nde
x
++
=
in
;
*
i
d
x
++
=
in
;
in
+=
len_size
;
for
(
j
=
0
;
j
<
len
;
++
j
)
{
unsigned
char
c
=
in
[
j
];
...
...
@@ -225,11 +225,11 @@ int spdylay_frame_unpack_nv_check_name(uint8_t *buf, size_t buflen,
len_size
==
2
?
spdylay_length_prefix_str_compar2
:
spdylay_length_prefix_str_compar4
);
i
nde
x
=
(
const
uint8_t
**
)
buf
;
len1
=
spdylay_frame_get_nv_len
(
*
i
nde
x
,
len_size
);
i
d
x
=
(
const
uint8_t
**
)
buf
;
len1
=
spdylay_frame_get_nv_len
(
*
i
d
x
,
len_size
);
for
(
i
=
1
;
i
<
n
;
++
i
)
{
len2
=
spdylay_frame_get_nv_len
(
*
(
i
nde
x
+
i
),
len_size
);
if
(
len1
==
len2
&&
memcmp
(
*
(
i
ndex
+
i
-
1
)
+
len_size
,
*
(
inde
x
+
i
)
+
len_size
,
len2
=
spdylay_frame_get_nv_len
(
*
(
i
d
x
+
i
),
len_size
);
if
(
len1
==
len2
&&
memcmp
(
*
(
i
dx
+
i
-
1
)
+
len_size
,
*
(
id
x
+
i
)
+
len_size
,
len1
)
==
0
)
{
return
SPDYLAY_ERR_INVALID_HEADER_BLOCK
;
}
...
...
@@ -245,7 +245,7 @@ int spdylay_frame_unpack_nv(char ***nv_ptr, const uint8_t *in, size_t inlen,
size_t
nvlen
,
buflen
;
int
r
;
size_t
i
;
char
*
buf
,
**
i
nde
x
,
*
data
;
char
*
buf
,
**
i
d
x
,
*
data
;
uint32_t
n
;
int
invalid_header_block
=
0
;
r
=
spdylay_frame_count_unpack_nv_space
(
&
nvlen
,
&
buflen
,
in
,
inlen
,
len_size
);
...
...
@@ -265,7 +265,7 @@ int spdylay_frame_unpack_nv(char ***nv_ptr, const uint8_t *in, size_t inlen,
free
(
buf
);
return
r
;
}
i
nde
x
=
(
char
**
)
buf
;
i
d
x
=
(
char
**
)
buf
;
data
=
buf
+
(
nvlen
*
2
+
1
)
*
sizeof
(
char
*
);
n
=
spdylay_frame_get_nv_len
(
in
,
len_size
);
in
+=
len_size
;
...
...
@@ -289,8 +289,8 @@ int spdylay_frame_unpack_nv(char ***nv_ptr, const uint8_t *in, size_t inlen,
for
(
stop
=
data
+
len
;
data
!=
stop
;
++
data
)
{
if
(
*
data
==
'\0'
)
{
*
i
nde
x
++
=
name
;
*
i
nde
x
++
=
val
;
*
i
d
x
++
=
name
;
*
i
d
x
++
=
val
;
if
(
val
==
data
)
{
invalid_header_block
=
1
;
}
...
...
@@ -301,11 +301,11 @@ int spdylay_frame_unpack_nv(char ***nv_ptr, const uint8_t *in, size_t inlen,
++
data
;
in
+=
len
;
*
i
nde
x
++
=
name
;
*
i
nde
x
++
=
val
;
*
i
d
x
++
=
name
;
*
i
d
x
++
=
val
;
}
*
i
nde
x
=
NULL
;
assert
((
size_t
)((
char
*
)
i
nde
x
-
buf
)
==
(
nvlen
*
2
)
*
sizeof
(
char
*
));
*
i
d
x
=
NULL
;
assert
((
size_t
)((
char
*
)
i
d
x
-
buf
)
==
(
nvlen
*
2
)
*
sizeof
(
char
*
));
*
nv_ptr
=
(
char
**
)
buf
;
return
invalid_header_block
?
SPDYLAY_ERR_INVALID_HEADER_BLOCK
:
0
;
}
...
...
@@ -406,7 +406,7 @@ char** spdylay_frame_nv_copy(const char **nv)
{
int
i
;
char
*
buf
;
char
**
i
nde
x
,
*
data
;
char
**
i
d
x
,
*
data
;
size_t
buflen
=
0
;
for
(
i
=
0
;
nv
[
i
];
++
i
)
{
buflen
+=
strlen
(
nv
[
i
])
+
1
;
...
...
@@ -416,16 +416,16 @@ char** spdylay_frame_nv_copy(const char **nv)
if
(
buf
==
NULL
)
{
return
NULL
;
}
i
nde
x
=
(
char
**
)
buf
;
i
d
x
=
(
char
**
)
buf
;
data
=
buf
+
(
i
+
1
)
*
sizeof
(
char
*
);
for
(
i
=
0
;
nv
[
i
];
++
i
)
{
size_t
len
=
strlen
(
nv
[
i
])
+
1
;
memcpy
(
data
,
nv
[
i
],
len
);
*
i
nde
x
++
=
data
;
*
i
d
x
++
=
data
;
data
+=
len
;
}
*
i
nde
x
=
NULL
;
*
i
d
x
=
NULL
;
return
(
char
**
)
buf
;
}
...
...
@@ -465,7 +465,7 @@ char** spdylay_frame_nv_norm_copy(const char **nv)
}
/* Table to translate SPDY/3 header names to SPDY/2. */
static
char
*
spdylay_nv_3to2
[]
=
{
static
c
onst
c
har
*
spdylay_nv_3to2
[]
=
{
":host"
,
"host"
,
":method"
,
"method"
,
":path"
,
"url"
,
...
...
@@ -481,7 +481,7 @@ void spdylay_frame_nv_3to2(char **nv)
for
(
i
=
0
;
nv
[
i
];
i
+=
2
)
{
for
(
j
=
0
;
spdylay_nv_3to2
[
j
];
j
+=
2
)
{
if
(
strcmp
(
nv
[
i
],
spdylay_nv_3to2
[
j
])
==
0
)
{
nv
[
i
]
=
spdylay_nv_3to2
[
j
+
1
];
nv
[
i
]
=
(
char
*
)
spdylay_nv_3to2
[
j
+
1
];
break
;
}
}
...
...
@@ -494,7 +494,7 @@ void spdylay_frame_nv_2to3(char **nv)
for
(
i
=
0
;
nv
[
i
];
i
+=
2
)
{
for
(
j
=
0
;
spdylay_nv_3to2
[
j
];
j
+=
2
)
{
if
(
strcmp
(
nv
[
i
],
spdylay_nv_3to2
[
j
+
1
])
==
0
)
{
nv
[
i
]
=
spdylay_nv_3to2
[
j
];
nv
[
i
]
=
(
char
*
)
spdylay_nv_3to2
[
j
];
break
;
}
}
...
...
lib/spdylay_session.c
View file @
b06fa25a
...
...
@@ -1375,11 +1375,12 @@ static int spdylay_session_after_frame_sent(spdylay_session *session)
data_frame
->
stream_id
)
!=
0
)
{
spdylay_active_outbound_item_reset
(
&
session
->
aob
);
}
else
{
spdylay_outbound_item
*
item
=
spdylay_session_get_next_ob_item
(
session
);
spdylay_outbound_item
*
next_item
;
next_item
=
spdylay_session_get_next_ob_item
(
session
);
/* If priority of this stream is higher or equal to other stream
waiting at the top of the queue, we continue to send this
data. */
if
(
item
==
NULL
||
session
->
aob
.
item
->
pri
<=
item
->
pri
)
{
if
(
next_item
==
NULL
||
session
->
aob
.
item
->
pri
<=
next_
item
->
pri
)
{
size_t
next_readmax
;
spdylay_stream
*
stream
;
stream
=
spdylay_session_get_stream
(
session
,
data_frame
->
stream_id
);
...
...
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