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
76800dc8
Commit
76800dc8
authored
Oct 30, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused functions
parent
7d282cd0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
101 deletions
+0
-101
lib/nghttp2_buf.c
lib/nghttp2_buf.c
+0
-10
lib/nghttp2_buf.h
lib/nghttp2_buf.h
+0
-16
lib/nghttp2_helper.c
lib/nghttp2_helper.c
+0
-17
lib/nghttp2_helper.h
lib/nghttp2_helper.h
+0
-19
tests/main.c
tests/main.c
+0
-2
tests/nghttp2_buf_test.c
tests/nghttp2_buf_test.c
+0
-36
tests/nghttp2_buf_test.h
tests/nghttp2_buf_test.h
+0
-1
No files found.
lib/nghttp2_buf.c
View file @
76800dc8
...
...
@@ -80,16 +80,6 @@ int nghttp2_buf_reserve(nghttp2_buf *buf, size_t new_cap)
return
0
;
}
int
nghttp2_buf_pos_reserve
(
nghttp2_buf
*
buf
,
size_t
new_rel_cap
)
{
return
nghttp2_buf_reserve
(
buf
,
nghttp2_buf_pos_offset
(
buf
)
+
new_rel_cap
);
}
int
nghttp2_buf_last_reserve
(
nghttp2_buf
*
buf
,
size_t
new_rel_cap
)
{
return
nghttp2_buf_reserve
(
buf
,
nghttp2_buf_last_offset
(
buf
)
+
new_rel_cap
);
}
void
nghttp2_buf_reset
(
nghttp2_buf
*
buf
)
{
buf
->
pos
=
buf
->
last
=
buf
->
mark
=
buf
->
begin
;
...
...
lib/nghttp2_buf.h
View file @
76800dc8
...
...
@@ -107,22 +107,6 @@ void nghttp2_buf_free(nghttp2_buf *buf);
*/
int
nghttp2_buf_reserve
(
nghttp2_buf
*
buf
,
size_t
new_cap
);
/*
* This function behaves like nghttp2_buf_reserve(), but new capacity
* is calculated as nghttp2_buf_pos_offset(buf) + new_rel_cap. In
* other words, this function reserves memory at least |new_rel_cap|
* bytes from buf->pos.
*/
int
nghttp2_buf_pos_reserve
(
nghttp2_buf
*
buf
,
size_t
new_rel_cap
);
/*
* This function behaves like nghttp2_buf_reserve(), but new capacity
* is calculated as nghttp2_buf_last_offset(buf) + new_rel_cap. In
* other words, this function reserves memory at least |new_rel_cap|
* bytes from buf->last.
*/
int
nghttp2_buf_last_reserve
(
nghttp2_buf
*
buf
,
size_t
new_rel_cap
);
/*
* Resets pos, last, mark member of |buf| to buf->begin.
*/
...
...
lib/nghttp2_helper.c
View file @
76800dc8
...
...
@@ -55,23 +55,6 @@ uint32_t nghttp2_get_uint32(const uint8_t *data)
return
ntohl
(
n
);
}
int
nghttp2_reserve_buffer
(
uint8_t
**
buf_ptr
,
size_t
*
buflen_ptr
,
size_t
min_length
)
{
if
(
min_length
>
*
buflen_ptr
)
{
uint8_t
*
temp
;
min_length
=
(
min_length
+
4095
)
/
4096
*
4096
;
temp
=
realloc
(
*
buf_ptr
,
min_length
);
if
(
temp
==
NULL
)
{
return
NGHTTP2_ERR_NOMEM
;
}
else
{
*
buf_ptr
=
temp
;
*
buflen_ptr
=
min_length
;
}
}
return
0
;
}
void
*
nghttp2_memdup
(
const
void
*
src
,
size_t
n
)
{
void
*
dest
;
...
...
lib/nghttp2_helper.h
View file @
76800dc8
...
...
@@ -58,25 +58,6 @@ uint16_t nghttp2_get_uint16(const uint8_t *data);
*/
uint32_t
nghttp2_get_uint32
(
const
uint8_t
*
data
);
/*
* Ensures that buffer |*buf_ptr| with |*buflen_ptr| length has at
* least |min_length| bytes. If |min_length| > |*buflen_ptr|,
* allocates new buffer having at least |min_length| bytes and assigns
* its pointer to |*buf_ptr| and allocated number of bytes to
* |*buflen_ptr|. The memory pointed by |*buf_ptr| previously may
* change. No memory copy is done between old and new buffer.
* |*buf_ptr| and |*buflen_ptr| are only updated iff this function
* succeeds.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
*
* NGHTTP2_ERR_NOMEM
* Out of memory.
*/
int
nghttp2_reserve_buffer
(
uint8_t
**
buf_ptr
,
size_t
*
buflen_ptr
,
size_t
min_length
);
/*
* Allocates |n| bytes of memory and copy the memory region pointed by
* |src| with the length |n| bytes into it. Returns the allocated memory.
...
...
tests/main.c
View file @
76800dc8
...
...
@@ -317,8 +317,6 @@ int main(int argc, char* argv[])
!
CU_add_test
(
pSuite
,
"bufs_remove"
,
test_nghttp2_bufs_remove
)
||
!
CU_add_test
(
pSuite
,
"bufs_reset"
,
test_nghttp2_bufs_reset
)
||
!
CU_add_test
(
pSuite
,
"bufs_advance"
,
test_nghttp2_bufs_advance
)
||
!
CU_add_test
(
pSuite
,
"bufs_seek_present"
,
test_nghttp2_bufs_seek_last_present
)
||
!
CU_add_test
(
pSuite
,
"bufs_next_present"
,
test_nghttp2_bufs_next_present
)
||
!
CU_add_test
(
pSuite
,
"bufs_realloc"
,
test_nghttp2_bufs_realloc
)
...
...
tests/nghttp2_buf_test.c
View file @
76800dc8
...
...
@@ -253,42 +253,6 @@ void test_nghttp2_bufs_advance(void)
nghttp2_bufs_free
(
&
bufs
);
}
void
test_nghttp2_bufs_seek_last_present
(
void
)
{
int
rv
;
nghttp2_bufs
bufs
;
rv
=
nghttp2_bufs_init
(
&
bufs
,
250
,
3
);
CU_ASSERT
(
0
==
rv
);
rv
=
nghttp2_bufs_advance
(
&
bufs
);
CU_ASSERT
(
0
==
rv
);
rv
=
nghttp2_bufs_addb
(
&
bufs
,
5
);
CU_ASSERT
(
0
==
rv
);
bufs
.
cur
=
bufs
.
head
;
/* cur is unchanged because cur is empty */
nghttp2_bufs_seek_last_present
(
&
bufs
);
CU_ASSERT
(
bufs
.
cur
==
bufs
.
head
);
rv
=
nghttp2_bufs_addb
(
&
bufs
,
1
);
CU_ASSERT
(
0
==
rv
);
nghttp2_bufs_seek_last_present
(
&
bufs
);
CU_ASSERT
(
bufs
.
cur
==
bufs
.
head
->
next
);
/* cur is unchanged */
nghttp2_bufs_seek_last_present
(
&
bufs
);
CU_ASSERT
(
bufs
.
cur
==
bufs
.
head
->
next
);
nghttp2_bufs_free
(
&
bufs
);
}
void
test_nghttp2_bufs_next_present
(
void
)
{
int
rv
;
...
...
tests/nghttp2_buf_test.h
View file @
76800dc8
...
...
@@ -31,7 +31,6 @@ void test_nghttp2_bufs_orb(void);
void
test_nghttp2_bufs_remove
(
void
);
void
test_nghttp2_bufs_reset
(
void
);
void
test_nghttp2_bufs_advance
(
void
);
void
test_nghttp2_bufs_seek_last_present
(
void
);
void
test_nghttp2_bufs_next_present
(
void
);
void
test_nghttp2_bufs_realloc
(
void
);
...
...
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