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
f2d94573
Commit
f2d94573
authored
Apr 01, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename framebuflen as framerv, cause it is not a length
parent
f5ead55f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
66 deletions
+66
-66
lib/nghttp2_session.c
lib/nghttp2_session.c
+60
-60
lib/nghttp2_session.h
lib/nghttp2_session.h
+6
-6
No files found.
lib/nghttp2_session.c
View file @
f2d94573
...
...
@@ -1476,7 +1476,7 @@ static int session_headers_add_pad(nghttp2_session *session,
static
int
nghttp2_session_prep_frame
(
nghttp2_session
*
session
,
nghttp2_outbound_item
*
item
)
{
ssize_t
frame
buflen
=
0
;
ssize_t
frame
rv
=
0
;
int
rv
;
if
(
item
->
frame_cat
==
NGHTTP2_CAT_CTRL
)
{
...
...
@@ -1519,20 +1519,20 @@ static int nghttp2_session_prep_frame(nghttp2_session *session,
return
rv
;
}
}
frame
buflen
=
nghttp2_frame_pack_headers
(
&
session
->
aob
.
framebufs
,
&
frame
->
headers
,
&
session
->
hd_deflater
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
nghttp2_frame_pack_headers
(
&
session
->
aob
.
framebufs
,
&
frame
->
headers
,
&
session
->
hd_deflater
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
DEBUGF
(
fprintf
(
stderr
,
"send: before padding, HEADERS serialized in %zd bytes
\n
"
,
nghttp2_bufs_len
(
&
session
->
aob
.
framebufs
)));
frame
buflen
=
session_headers_add_pad
(
session
,
frame
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
session_headers_add_pad
(
session
,
frame
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
switch
(
frame
->
headers
.
cat
)
{
...
...
@@ -1568,18 +1568,18 @@ static int nghttp2_session_prep_frame(nghttp2_session *session,
if
(
rv
!=
0
)
{
return
rv
;
}
frame
buflen
=
nghttp2_frame_pack_priority
(
&
session
->
aob
.
framebufs
,
&
frame
->
priority
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
nghttp2_frame_pack_priority
(
&
session
->
aob
.
framebufs
,
&
frame
->
priority
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
break
;
}
case
NGHTTP2_RST_STREAM
:
frame
buflen
=
nghttp2_frame_pack_rst_stream
(
&
session
->
aob
.
framebufs
,
&
frame
->
rst_stream
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
nghttp2_frame_pack_rst_stream
(
&
session
->
aob
.
framebufs
,
&
frame
->
rst_stream
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
break
;
case
NGHTTP2_SETTINGS
:
{
...
...
@@ -1587,10 +1587,10 @@ static int nghttp2_session_prep_frame(nghttp2_session *session,
if
(
rv
!=
0
)
{
return
rv
;
}
frame
buflen
=
nghttp2_frame_pack_settings
(
&
session
->
aob
.
framebufs
,
&
frame
->
settings
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
nghttp2_frame_pack_settings
(
&
session
->
aob
.
framebufs
,
&
frame
->
settings
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
break
;
}
...
...
@@ -1608,15 +1608,15 @@ static int nghttp2_session_prep_frame(nghttp2_session *session,
}
frame
->
push_promise
.
promised_stream_id
=
session
->
next_stream_id
;
session
->
next_stream_id
+=
2
;
frame
buflen
=
nghttp2_frame_pack_push_promise
(
&
session
->
aob
.
framebufs
,
&
frame
->
push_promise
,
&
session
->
hd_deflater
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
nghttp2_frame_pack_push_promise
(
&
session
->
aob
.
framebufs
,
&
frame
->
push_promise
,
&
session
->
hd_deflater
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
frame
buflen
=
session_headers_add_pad
(
session
,
frame
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
session_headers_add_pad
(
session
,
frame
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
stream
=
nghttp2_session_get_stream
(
session
,
frame
->
hd
.
stream_id
);
...
...
@@ -1638,10 +1638,10 @@ static int nghttp2_session_prep_frame(nghttp2_session *session,
break
;
}
case
NGHTTP2_PING
:
frame
buflen
=
nghttp2_frame_pack_ping
(
&
session
->
aob
.
framebufs
,
&
frame
->
ping
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
nghttp2_frame_pack_ping
(
&
session
->
aob
.
framebufs
,
&
frame
->
ping
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
break
;
case
NGHTTP2_WINDOW_UPDATE
:
{
...
...
@@ -1650,10 +1650,10 @@ static int nghttp2_session_prep_frame(nghttp2_session *session,
if
(
rv
!=
0
)
{
return
rv
;
}
frame
buflen
=
nghttp2_frame_pack_window_update
(
&
session
->
aob
.
framebufs
,
&
frame
->
window_update
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
nghttp2_frame_pack_window_update
(
&
session
->
aob
.
framebufs
,
&
frame
->
window_update
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
break
;
}
...
...
@@ -1665,18 +1665,18 @@ static int nghttp2_session_prep_frame(nghttp2_session *session,
peer that last-stream-id. */
return
NGHTTP2_ERR_GOAWAY_ALREADY_SENT
;
}
frame
buflen
=
nghttp2_frame_pack_goaway
(
&
session
->
aob
.
framebufs
,
&
frame
->
goaway
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
frame
rv
=
nghttp2_frame_pack_goaway
(
&
session
->
aob
.
framebufs
,
&
frame
->
goaway
);
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
break
;
case
NGHTTP2_ALTSVC
:
frame
buflen
=
nghttp2_frame_pack_altsvc
(
&
session
->
aob
.
framebufs
,
&
frame
->
altsvc
);
frame
rv
=
nghttp2_frame_pack_altsvc
(
&
session
->
aob
.
framebufs
,
&
frame
->
altsvc
);
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
break
;
...
...
@@ -1724,17 +1724,17 @@ static int nghttp2_session_prep_frame(nghttp2_session *session,
nghttp2_active_outbound_item_reset
(
&
session
->
aob
);
return
NGHTTP2_ERR_DEFERRED
;
}
frame
buflen
=
nghttp2_session_pack_data
(
session
,
&
session
->
aob
.
framebufs
,
next_readmax
,
data_frame
);
if
(
frame
buflen
==
NGHTTP2_ERR_DEFERRED
)
{
frame
rv
=
nghttp2_session_pack_data
(
session
,
&
session
->
aob
.
framebufs
,
next_readmax
,
data_frame
);
if
(
frame
rv
==
NGHTTP2_ERR_DEFERRED
)
{
nghttp2_stream_defer_data
(
stream
,
item
,
NGHTTP2_DEFERRED_NONE
);
session
->
aob
.
item
=
NULL
;
nghttp2_active_outbound_item_reset
(
&
session
->
aob
);
return
NGHTTP2_ERR_DEFERRED
;
}
if
(
frame
buflen
==
NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE
)
{
if
(
frame
rv
==
NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE
)
{
rv
=
nghttp2_stream_detach_data
(
stream
,
&
session
->
ob_pq
);
if
(
nghttp2_is_fatal
(
rv
))
{
...
...
@@ -1746,10 +1746,10 @@ static int nghttp2_session_prep_frame(nghttp2_session *session,
if
(
rv
!=
0
)
{
return
rv
;
}
return
frame
buflen
;
return
frame
rv
;
}
if
(
frame
buflen
<
0
)
{
return
frame
buflen
;
if
(
frame
rv
<
0
)
{
return
frame
rv
;
}
return
0
;
}
else
{
...
...
@@ -2161,7 +2161,7 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session)
return
0
;
}
assert
(
rv
>
=
0
);
assert
(
rv
=
=
0
);
return
0
;
}
...
...
@@ -5358,10 +5358,10 @@ int nghttp2_session_add_settings(nghttp2_session *session, uint8_t flags,
return
0
;
}
ssize_
t
nghttp2_session_pack_data
(
nghttp2_session
*
session
,
nghttp2_bufs
*
bufs
,
size_t
datamax
,
nghttp2_private_data
*
frame
)
in
t
nghttp2_session_pack_data
(
nghttp2_session
*
session
,
nghttp2_bufs
*
bufs
,
size_t
datamax
,
nghttp2_private_data
*
frame
)
{
ssize_t
rv
;
int
eof_flags
;
...
...
@@ -5446,7 +5446,7 @@ ssize_t nghttp2_session_pack_data(nghttp2_session *session,
frame
->
hd
.
flags
|=
hd
.
flags
;
frame
->
padlen
=
padlen
;
return
nghttp2_buf_len
(
buf
)
;
return
0
;
}
void
*
nghttp2_session_get_stream_user_data
(
nghttp2_session
*
session
,
...
...
lib/nghttp2_session.h
View file @
f2d94573
...
...
@@ -621,8 +621,8 @@ nghttp2_stream_group* nghttp2_session_get_stream_group
* filled using |frame->data_prd|. The length of payload is at most
* |datamax| bytes.
*
* This function returns
the size of packed frame if it succeeds, or
*
one of the following
negative error codes:
* This function returns
0 if it succeeds, or one of the following
* negative error codes:
*
* NGHTTP2_ERR_DEFERRED
* The DATA frame is postponed.
...
...
@@ -633,10 +633,10 @@ nghttp2_stream_group* nghttp2_session_get_stream_group
* NGHTTP2_ERR_CALLBACK_FAILURE
* The read_callback failed (session error).
*/
ssize_
t
nghttp2_session_pack_data
(
nghttp2_session
*
session
,
nghttp2_bufs
*
bufs
,
size_t
datamax
,
nghttp2_private_data
*
frame
);
in
t
nghttp2_session_pack_data
(
nghttp2_session
*
session
,
nghttp2_bufs
*
bufs
,
size_t
datamax
,
nghttp2_private_data
*
frame
);
/*
* Returns top of outbound frame queue. This function returns NULL if
...
...
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