@@ -95,37 +95,6 @@ impl Dispatcher {
95
95
}
96
96
}
97
97
98
- /// Lets the root context to create its child context.
99
- fn create_child_context ( & self , context_id : u32 , root_context_id : u32 ) -> bool {
100
- if !self . roots . borrow ( ) . contains_key ( & root_context_id) {
101
- panic ! ( "invalid root_context_id" )
102
- }
103
- if let Some ( child_context) = self
104
- . roots
105
- . borrow_mut ( )
106
- . get_mut ( & root_context_id)
107
- . and_then ( |root| root. on_create_child_context ( context_id) )
108
- {
109
- if match child_context {
110
- ChildContext :: HttpContext ( http_context) => self
111
- . http_streams
112
- . borrow_mut ( )
113
- . insert ( context_id, http_context)
114
- . is_some ( ) ,
115
- ChildContext :: StreamContext ( stream_context) => self
116
- . streams
117
- . borrow_mut ( )
118
- . insert ( context_id, stream_context)
119
- . is_some ( ) ,
120
- } {
121
- panic ! ( "duplicate context_id" )
122
- }
123
- true
124
- } else {
125
- false
126
- }
127
- }
128
-
129
98
fn create_stream_context ( & self , context_id : u32 , root_context_id : u32 ) {
130
99
if !self . roots . borrow ( ) . contains_key ( & root_context_id) {
131
100
panic ! ( "invalid root_context_id" )
@@ -176,8 +145,6 @@ impl Dispatcher {
176
145
fn on_create_context ( & self , context_id : u32 , root_context_id : u32 ) {
177
146
if root_context_id == 0 {
178
147
self . create_root_context ( context_id)
179
- } else if self . create_child_context ( context_id, root_context_id) {
180
- // root context created a child context by himself
181
148
} else if self . new_http_stream . get ( ) . is_some ( ) {
182
149
self . create_http_context ( context_id, root_context_id) ;
183
150
} else if self . new_stream . get ( ) . is_some ( ) {
0 commit comments