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
ef3caffe
Commit
ef3caffe
authored
Jul 23, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove push related members from nghttp2_stream
parent
4b6885ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
66 deletions
+0
-66
lib/nghttp2_stream.c
lib/nghttp2_stream.c
+0
-21
lib/nghttp2_stream.h
lib/nghttp2_stream.h
+0
-21
tests/main.c
tests/main.c
+0
-4
tests/nghttp2_stream_test.c
tests/nghttp2_stream_test.c
+0
-18
tests/nghttp2_stream_test.h
tests/nghttp2_stream_test.h
+0
-2
No files found.
lib/nghttp2_stream.c
View file @
ef3caffe
...
...
@@ -40,9 +40,6 @@ void nghttp2_stream_init(nghttp2_stream *stream, int32_t stream_id,
stream
->
pri
=
pri
;
stream
->
state
=
initial_state
;
stream
->
shut_flags
=
NGHTTP2_SHUT_NONE
;
stream
->
pushed_streams
=
NULL
;
stream
->
pushed_streams_length
=
0
;
stream
->
pushed_streams_capacity
=
0
;
stream
->
stream_user_data
=
stream_user_data
;
stream
->
deferred_data
=
NULL
;
stream
->
deferred_flags
=
NGHTTP2_DEFERRED_NONE
;
...
...
@@ -54,7 +51,6 @@ void nghttp2_stream_init(nghttp2_stream *stream, int32_t stream_id,
void
nghttp2_stream_free
(
nghttp2_stream
*
stream
)
{
free
(
stream
->
pushed_streams
);
nghttp2_outbound_item_free
(
stream
->
deferred_data
);
free
(
stream
->
deferred_data
);
}
...
...
@@ -64,23 +60,6 @@ void nghttp2_stream_shutdown(nghttp2_stream *stream, nghttp2_shut_flag flag)
stream
->
shut_flags
|=
flag
;
}
int
nghttp2_stream_add_pushed_stream
(
nghttp2_stream
*
stream
,
int32_t
stream_id
)
{
if
(
stream
->
pushed_streams_capacity
==
stream
->
pushed_streams_length
)
{
int32_t
*
streams
;
size_t
capacity
=
stream
->
pushed_streams_capacity
==
0
?
5
:
stream
->
pushed_streams_capacity
*
2
;
streams
=
realloc
(
stream
->
pushed_streams
,
capacity
*
sizeof
(
uint32_t
));
if
(
streams
==
NULL
)
{
return
NGHTTP2_ERR_NOMEM
;
}
stream
->
pushed_streams
=
streams
;
stream
->
pushed_streams_capacity
=
capacity
;
}
stream
->
pushed_streams
[
stream
->
pushed_streams_length
++
]
=
stream_id
;
return
0
;
}
void
nghttp2_stream_defer_data
(
nghttp2_stream
*
stream
,
nghttp2_outbound_item
*
data
,
uint8_t
flags
)
...
...
lib/nghttp2_stream.h
View file @
ef3caffe
...
...
@@ -88,14 +88,6 @@ typedef struct {
int32_t
pri
;
/* Bitwise OR of zero or more nghttp2_shut_flag values */
uint8_t
shut_flags
;
/* The array of server-pushed stream IDs which associate them to
this stream. */
int32_t
*
pushed_streams
;
/* The number of stored pushed stream ID in |pushed_streams| */
size_t
pushed_streams_length
;
/* The maximum number of stream ID the |pushed_streams| can
store. */
size_t
pushed_streams_capacity
;
/* The arbitrary data provided by user for this stream. */
void
*
stream_user_data
;
/* Deferred DATA frame */
...
...
@@ -139,19 +131,6 @@ void nghttp2_stream_free(nghttp2_stream *stream);
*/
void
nghttp2_stream_shutdown
(
nghttp2_stream
*
stream
,
nghttp2_shut_flag
flag
);
/*
* Add server-pushed |stream_id| to this stream. This happens when
* server-pushed stream is associated to this stream. This function
* returns 0 if it succeeds, or negative error code.
*
* RETURN VALUE
* ------------
*
* NGHTTP2_ERR_NOMEM
* Out of memory.
*/
int
nghttp2_stream_add_pushed_stream
(
nghttp2_stream
*
stream
,
int32_t
stream_id
);
/*
* Defer DATA frame |data|. We won't call this function in the
* situation where stream->deferred_data != NULL. If |flags| is
...
...
tests/main.c
View file @
ef3caffe
...
...
@@ -185,10 +185,6 @@ int main(int argc, char* argv[])
test_nghttp2_frame_pack_goaway
)
||
!
CU_add_test
(
pSuite
,
"frame_pack_window_update"
,
test_nghttp2_frame_pack_window_update
)
||
/* !CU_add_test(pSuite, "stream_add_pushed_stream", */
/* test_nghttp2_stream_add_pushed_stream) || */
!
CU_add_test
(
pSuite
,
"hd_deflate"
,
test_nghttp2_hd_deflate
)
||
!
CU_add_test
(
pSuite
,
"hd_inflate_indname_inc"
,
test_nghttp2_hd_inflate_indname_inc
)
||
...
...
tests/nghttp2_stream_test.c
View file @
ef3caffe
...
...
@@ -27,21 +27,3 @@
#include <CUnit/CUnit.h>
#include "nghttp2_stream.h"
void
test_nghttp2_stream_add_pushed_stream
(
void
)
{
nghttp2_stream
stream
;
int
i
,
n
;
nghttp2_stream_init
(
&
stream
,
1
,
NGHTTP2_FLAG_NONE
,
1
<<
30
,
NGHTTP2_STREAM_OPENING
,
1
,
1
,
65536
,
NULL
);
n
=
26
;
for
(
i
=
2
;
i
<
n
;
i
+=
2
)
{
CU_ASSERT
(
0
==
nghttp2_stream_add_pushed_stream
(
&
stream
,
i
));
CU_ASSERT
((
size_t
)
i
/
2
==
stream
.
pushed_streams_length
);
}
for
(
i
=
2
;
i
<
n
;
i
+=
2
)
{
CU_ASSERT
(
i
==
stream
.
pushed_streams
[
i
/
2
-
1
]);
}
CU_ASSERT
(
1
<<
30
==
stream
.
pri
);
nghttp2_stream_free
(
&
stream
);
}
tests/nghttp2_stream_test.h
View file @
ef3caffe
...
...
@@ -25,6 +25,4 @@
#ifndef NGHTTP2_STREAM_TEST_H
#define NGHTTP2_STREAM_TEST_H
void
test_nghttp2_stream_add_pushed_stream
(
void
);
#endif
/* NGHTTP2_STREAM_TEST_H */
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