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
f429cc45
Commit
f429cc45
authored
Feb 01, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added SETTINGS send/recv. Added missing RST_STREAM send.
parent
0b75800c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
lib/spdylay_session.c
lib/spdylay_session.c
+42
-0
lib/spdylay_session.h
lib/spdylay_session.h
+6
-0
No files found.
lib/spdylay_session.c
View file @
f429cc45
...
...
@@ -145,6 +145,9 @@ static void spdylay_outbound_item_free(spdylay_outbound_item *item)
case
SPDYLAY_RST_STREAM
:
spdylay_frame_rst_stream_free
(
&
item
->
frame
->
rst_stream
);
break
;
case
SPDYLAY_SETTINGS
:
spdylay_frame_settings_free
(
&
item
->
frame
->
settings
);
break
;
case
SPDYLAY_NOOP
:
/* We don't have any public API to add NOOP, so here is
unreachable. */
...
...
@@ -222,6 +225,9 @@ int spdylay_session_add_frame(spdylay_session *session,
}
break
;
}
case
SPDYLAY_SETTINGS
:
/* Should SPDYLAY_SETTINGS have higher priority? */
break
;
case
SPDYLAY_NOOP
:
/* We don't have any public API to add NOOP, so here is
unreachable. */
...
...
@@ -403,6 +409,20 @@ ssize_t spdylay_session_prep_frame(spdylay_session *session,
}
break
;
}
case
SPDYLAY_RST_STREAM
:
framebuflen
=
spdylay_frame_pack_rst_stream
(
&
framebuf
,
&
item
->
frame
->
rst_stream
);
if
(
framebuflen
<
0
)
{
return
framebuflen
;
}
break
;
case
SPDYLAY_SETTINGS
:
framebuflen
=
spdylay_frame_pack_settings
(
&
framebuf
,
&
item
->
frame
->
settings
);
if
(
framebuflen
<
0
)
{
return
framebuflen
;
}
break
;
case
SPDYLAY_NOOP
:
/* We don't have any public API to add NOOP, so here is
unreachable. */
...
...
@@ -535,6 +555,9 @@ static int spdylay_session_after_frame_sent(spdylay_session *session)
spdylay_session_close_stream
(
session
,
frame
->
rst_stream
.
stream_id
,
frame
->
rst_stream
.
status_code
);
break
;
case
SPDYLAY_SETTINGS
:
/* nothing to do */
break
;
case
SPDYLAY_NOOP
:
/* We don't have any public API to add NOOP, so here is
unreachable. */
...
...
@@ -865,6 +888,14 @@ int spdylay_session_on_rst_stream_received(spdylay_session *session,
return
0
;
}
int
spdylay_session_on_settings_received
(
spdylay_session
*
session
,
spdylay_frame
*
frame
)
{
/* TODO Check ID/value pairs and persist them if necessary. */
spdylay_session_call_on_ctrl_frame_received
(
session
,
SPDYLAY_SETTINGS
,
frame
);
return
0
;
}
int
spdylay_session_on_ping_received
(
spdylay_session
*
session
,
spdylay_frame
*
frame
)
{
...
...
@@ -990,6 +1021,17 @@ static int spdylay_session_process_ctrl_frame(spdylay_session *session)
spdylay_frame_rst_stream_free
(
&
frame
.
rst_stream
);
}
break
;
case
SPDYLAY_SETTINGS
:
r
=
spdylay_frame_unpack_settings
(
&
frame
.
settings
,
session
->
iframe
.
headbuf
,
sizeof
(
session
->
iframe
.
headbuf
),
session
->
iframe
.
buf
,
session
->
iframe
.
len
);
if
(
r
==
0
)
{
r
=
spdylay_session_on_settings_received
(
session
,
&
frame
);
spdylay_frame_settings_free
(
&
frame
.
settings
);
}
break
;
case
SPDYLAY_NOOP
:
break
;
case
SPDYLAY_PING
:
...
...
lib/spdylay_session.h
View file @
f429cc45
...
...
@@ -202,6 +202,12 @@ int spdylay_session_on_syn_reply_received(spdylay_session *session,
int
spdylay_session_on_rst_stream_received
(
spdylay_session
*
session
,
spdylay_frame
*
frame
);
/*
* Called when SETTINGS is received. Received frame is |frame|.
*/
int
spdylay_session_on_settings_received
(
spdylay_session
*
session
,
spdylay_frame
*
frame
);
/*
* Called when PING is received. Received frame is |frame|.
*/
...
...
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