forked from andeya/erpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.go
661 lines (616 loc) · 19.7 KB
/
plugin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
// Copyright 2015-2018 HenryLee. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package tp
import (
"fmt"
"net"
"github.com/henrylee2cn/goutil"
"github.com/henrylee2cn/goutil/errors"
)
// Plug-ins during runtime
type (
// Plugin plugin background
Plugin interface {
Name() string
}
// PreNewPeerPlugin is executed before creating peer.
PreNewPeerPlugin interface {
Plugin
PreNewPeer(*PeerConfig, *PluginContainer) error
}
// PostNewPeerPlugin is executed after creating peer.
PostNewPeerPlugin interface {
Plugin
PostNewPeer(EarlyPeer) error
}
// PostRegPlugin is executed after registering handler.
PostRegPlugin interface {
Plugin
PostReg(*Handler) error
}
// PostListenPlugin is executed between listening and accepting.
PostListenPlugin interface {
Plugin
PostListen(net.Addr) error
}
// PostDialPlugin is executed after dialing.
PostDialPlugin interface {
Plugin
PostDial(PreSession) *Rerror
}
// PostAcceptPlugin is executed after accepting connection.
PostAcceptPlugin interface {
Plugin
PostAccept(PreSession) *Rerror
}
// PreWriteCallPlugin is executed before writing CALL message.
PreWriteCallPlugin interface {
Plugin
PreWriteCall(WriteCtx) *Rerror
}
// PostWriteCallPlugin is executed after successful writing CALL message.
PostWriteCallPlugin interface {
Plugin
PostWriteCall(WriteCtx) *Rerror
}
// PreWriteReplyPlugin is executed before writing REPLY message.
PreWriteReplyPlugin interface {
Plugin
PreWriteReply(WriteCtx) *Rerror
}
// PostWriteReplyPlugin is executed after successful writing REPLY message.
PostWriteReplyPlugin interface {
Plugin
PostWriteReply(WriteCtx) *Rerror
}
// PreWritePushPlugin is executed before writing PUSH message.
PreWritePushPlugin interface {
Plugin
PreWritePush(WriteCtx) *Rerror
}
// PostWritePushPlugin is executed after successful writing PUSH message.
PostWritePushPlugin interface {
Plugin
PostWritePush(WriteCtx) *Rerror
}
// PreReadHeaderPlugin is executed before reading message header.
PreReadHeaderPlugin interface {
Plugin
PreReadHeader(PreCtx) error
}
// PostReadCallHeaderPlugin is executed after reading CALL message header.
PostReadCallHeaderPlugin interface {
Plugin
PostReadCallHeader(ReadCtx) *Rerror
}
// PreReadCallBodyPlugin is executed before reading CALL message body.
PreReadCallBodyPlugin interface {
Plugin
PreReadCallBody(ReadCtx) *Rerror
}
// PostReadCallBodyPlugin is executed after reading CALL message body.
PostReadCallBodyPlugin interface {
Plugin
PostReadCallBody(ReadCtx) *Rerror
}
// PostReadPushHeaderPlugin is executed after reading PUSH message header.
PostReadPushHeaderPlugin interface {
Plugin
PostReadPushHeader(ReadCtx) *Rerror
}
// PreReadPushBodyPlugin is executed before reading PUSH message body.
PreReadPushBodyPlugin interface {
Plugin
PreReadPushBody(ReadCtx) *Rerror
}
// PostReadPushBodyPlugin is executed after reading PUSH message body.
PostReadPushBodyPlugin interface {
Plugin
PostReadPushBody(ReadCtx) *Rerror
}
// PostReadReplyHeaderPlugin is executed after reading REPLY message header.
PostReadReplyHeaderPlugin interface {
Plugin
PostReadReplyHeader(ReadCtx) *Rerror
}
// PreReadReplyBodyPlugin is executed before reading REPLY message body.
PreReadReplyBodyPlugin interface {
Plugin
PreReadReplyBody(ReadCtx) *Rerror
}
// PostReadReplyBodyPlugin is executed after reading REPLY message body.
PostReadReplyBodyPlugin interface {
Plugin
PostReadReplyBody(ReadCtx) *Rerror
}
// PostDisconnectPlugin is executed after disconnection.
PostDisconnectPlugin interface {
Plugin
PostDisconnect(BaseSession) *Rerror
}
)
// PluginContainer a plugin container
type PluginContainer struct {
*pluginSingleContainer
left *pluginSingleContainer
middle *pluginSingleContainer
right *pluginSingleContainer
refreshTree func()
}
// newPluginContainer new a plugin container.
func newPluginContainer() *PluginContainer {
p := &PluginContainer{
pluginSingleContainer: newPluginSingleContainer(),
left: newPluginSingleContainer(),
middle: newPluginSingleContainer(),
right: newPluginSingleContainer(),
}
p.refreshTree = func() { p.refresh() }
return p
}
func (p *PluginContainer) cloneAndAppendMiddle(plugins ...Plugin) *PluginContainer {
middle := newPluginSingleContainer()
middle.plugins = append(p.middle.GetAll(), plugins...)
newPluginContainer := newPluginContainer()
newPluginContainer.middle = middle
newPluginContainer.left = p.left
newPluginContainer.right = p.right
newPluginContainer.refresh()
oldRefreshTree := p.refreshTree
p.refreshTree = func() {
oldRefreshTree()
newPluginContainer.refresh()
}
return newPluginContainer
}
// AppendLeft appends plugins on the left side of the pluginContainer.
func (p *PluginContainer) AppendLeft(plugins ...Plugin) {
p.left.appendLeft(plugins...)
p.refreshTree()
}
// AppendRight appends plugins on the right side of the pluginContainer.
func (p *PluginContainer) AppendRight(plugins ...Plugin) {
p.right.appendRight(plugins...)
p.refreshTree()
}
// Remove removes a plugin by it's name.
func (p *PluginContainer) Remove(pluginName string) error {
err := p.pluginSingleContainer.remove(pluginName)
if err != nil {
return err
}
p.left.remove(pluginName)
p.middle.remove(pluginName)
p.right.remove(pluginName)
p.refreshTree()
return nil
}
func (p *PluginContainer) refresh() {
count := len(p.left.plugins) + len(p.middle.plugins) + len(p.right.plugins)
allPlugins := make([]Plugin, count)
copy(allPlugins[0:], p.left.plugins)
copy(allPlugins[0+len(p.left.plugins):], p.middle.plugins)
copy(allPlugins[0+len(p.left.plugins)+len(p.middle.plugins):], p.right.plugins)
m := make(map[string]bool, count)
for _, plugin := range allPlugins {
if plugin == nil {
Fatalf("plugin cannot be nil!")
return
}
if m[plugin.Name()] {
Fatalf("repeat add plugin: %s", plugin.Name())
return
}
m[plugin.Name()] = true
}
p.pluginSingleContainer.plugins = allPlugins
}
// pluginSingleContainer plugins container.
type pluginSingleContainer struct {
plugins []Plugin
}
// newPluginSingleContainer new a plugin container.
func newPluginSingleContainer() *pluginSingleContainer {
return &pluginSingleContainer{
plugins: make([]Plugin, 0),
}
}
// appendLeft appends plugins on the left side of the pluginContainer.
func (p *pluginSingleContainer) appendLeft(plugins ...Plugin) {
if len(plugins) == 0 {
return
}
p.plugins = append(plugins, p.plugins...)
}
// appendRight appends plugins on the right side of the pluginContainer.
func (p *pluginSingleContainer) appendRight(plugins ...Plugin) {
if len(plugins) == 0 {
return
}
p.plugins = append(p.plugins, plugins...)
}
// GetByName returns a plugin instance by it's name.
func (p *pluginSingleContainer) GetByName(pluginName string) Plugin {
if p.plugins == nil {
return nil
}
for _, plugin := range p.plugins {
if plugin.Name() == pluginName {
return plugin
}
}
return nil
}
// GetAll returns all activated plugins.
func (p *pluginSingleContainer) GetAll() []Plugin {
return p.plugins
}
// remove removes a plugin by it's name.
func (p *pluginSingleContainer) remove(pluginName string) error {
if p.plugins == nil {
return errors.New("no plugins are registered yet")
}
if len(pluginName) == 0 {
//return error: cannot delete an unamed plugin
return errors.New("plugin with an empty name cannot be removed")
}
indexToRemove := -1
for i, plugin := range p.plugins {
if plugin.Name() == pluginName {
indexToRemove = i
break
}
}
if indexToRemove == -1 {
return errors.New("cannot remove a plugin which isn't exists")
}
p.plugins = append(p.plugins[:indexToRemove], p.plugins[indexToRemove+1:]...)
return nil
}
// PreNewPeer executes the defined plugins before creating peer.
func (p *PluginContainer) preNewPeer(peerConfig *PeerConfig) {
var err error
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PreNewPeerPlugin); ok {
if err = _plugin.PreNewPeer(peerConfig, p); err != nil {
Fatalf("[PreNewPeerPlugin:%s] %s", plugin.Name(), err.Error())
return
}
}
}
}
// PostNewPeer executes the defined plugins after creating peer.
func (p *pluginSingleContainer) postNewPeer(peer EarlyPeer) {
var err error
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostNewPeerPlugin); ok {
if err = _plugin.PostNewPeer(peer); err != nil {
Fatalf("[PostNewPeerPlugin:%s] %s", plugin.Name(), err.Error())
return
}
}
}
}
// PostReg executes the defined plugins before registering handler.
func (p *pluginSingleContainer) postReg(h *Handler) {
var err error
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostRegPlugin); ok {
if err = _plugin.PostReg(h); err != nil {
Fatalf("[PostRegPlugin:%s] register handler:%s %s, error:%s", plugin.Name(), h.RouterTypeName(), h.Name(), err.Error())
return
}
}
}
}
// PostListen is executed between listening and accepting.
func (p *pluginSingleContainer) postListen(addr net.Addr) {
var err error
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostListenPlugin); ok {
if err = _plugin.PostListen(addr); err != nil {
Fatalf("[PostListenPlugin:%s] network:%s, addr:%s, error:%s", plugin.Name(), addr.Network(), addr.String(), err.Error())
return
}
}
}
return
}
// PostDial executes the defined plugins after dialing.
func (p *pluginSingleContainer) postDial(sess PreSession) (rerr *Rerror) {
var pluginName string
defer func() {
if p := recover(); p != nil {
Errorf("[PostDialPlugin:%s] network:%s, addr:%s, panic:%v\n%s", pluginName, sess.RemoteAddr().Network(), sess.RemoteAddr().String(), p, goutil.PanicTrace(2))
rerr = rerrDialFailed.Copy().SetReason(fmt.Sprint(p))
}
}()
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostDialPlugin); ok {
pluginName = plugin.Name()
if rerr = _plugin.PostDial(sess); rerr != nil {
Debugf("[PostDialPlugin:%s] network:%s, addr:%s, error:%s", pluginName, sess.RemoteAddr().Network(), sess.RemoteAddr().String(), rerr.String())
return rerr
}
}
}
return nil
}
// PostAccept executes the defined plugins after accepting connection.
func (p *pluginSingleContainer) postAccept(sess PreSession) (rerr *Rerror) {
var pluginName string
defer func() {
if p := recover(); p != nil {
Errorf("[PostAcceptPlugin:%s] network:%s, addr:%s, panic:%v\n%s", pluginName, sess.RemoteAddr().Network(), sess.RemoteAddr().String(), p, goutil.PanicTrace(2))
rerr = rerrInternalServerError.Copy().SetReason(fmt.Sprint(p))
}
}()
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostAcceptPlugin); ok {
pluginName = plugin.Name()
if rerr = _plugin.PostAccept(sess); rerr != nil {
Debugf("[PostAcceptPlugin:%s] network:%s, addr:%s, error:%s", pluginName, sess.RemoteAddr().Network(), sess.RemoteAddr().String(), rerr.String())
return rerr
}
}
}
return nil
}
// PreWriteCall executes the defined plugins before writing CALL message.
func (p *pluginSingleContainer) preWriteCall(ctx WriteCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PreWriteCallPlugin); ok {
if rerr = _plugin.PreWriteCall(ctx); rerr != nil {
Debugf("[PreWriteCallPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PostWriteCall executes the defined plugins after successful writing CALL message.
func (p *pluginSingleContainer) postWriteCall(ctx WriteCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostWriteCallPlugin); ok {
if rerr = _plugin.PostWriteCall(ctx); rerr != nil {
Errorf("[PostWriteCallPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PreWriteReply executes the defined plugins before writing REPLY message.
func (p *pluginSingleContainer) preWriteReply(ctx WriteCtx) {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PreWriteReplyPlugin); ok {
if rerr = _plugin.PreWriteReply(ctx); rerr != nil {
Errorf("[PreWriteReplyPlugin:%s] %s", plugin.Name(), rerr.String())
return
}
}
}
}
// PostWriteReply executes the defined plugins after successful writing REPLY message.
func (p *pluginSingleContainer) postWriteReply(ctx WriteCtx) {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostWriteReplyPlugin); ok {
if rerr = _plugin.PostWriteReply(ctx); rerr != nil {
Errorf("[PostWriteReplyPlugin:%s] %s", plugin.Name(), rerr.String())
return
}
}
}
}
// PreWritePush executes the defined plugins before writing PUSH message.
func (p *pluginSingleContainer) preWritePush(ctx WriteCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PreWritePushPlugin); ok {
if rerr = _plugin.PreWritePush(ctx); rerr != nil {
Debugf("[PreWritePushPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PostWritePush executes the defined plugins after successful writing PUSH message.
func (p *pluginSingleContainer) postWritePush(ctx WriteCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostWritePushPlugin); ok {
if rerr = _plugin.PostWritePush(ctx); rerr != nil {
Errorf("[PostWritePushPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PreReadHeader executes the defined plugins before reading message header.
func (p *pluginSingleContainer) preReadHeader(ctx PreCtx) error {
var err error
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PreReadHeaderPlugin); ok {
if err = _plugin.PreReadHeader(ctx); err != nil {
Debugf("[PreReadHeaderPlugin:%s] disconnected when reading: %s", plugin.Name(), err.Error())
return err
}
}
}
return nil
}
// PostReadCallHeader executes the defined plugins after reading CALL message header.
func (p *pluginSingleContainer) postReadCallHeader(ctx ReadCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostReadCallHeaderPlugin); ok {
if rerr = _plugin.PostReadCallHeader(ctx); rerr != nil {
Errorf("[PostReadCallHeaderPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PreReadCallBody executes the defined plugins before reading CALL message body.
func (p *pluginSingleContainer) preReadCallBody(ctx ReadCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PreReadCallBodyPlugin); ok {
if rerr = _plugin.PreReadCallBody(ctx); rerr != nil {
Errorf("[PreReadCallBodyPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PostReadCallBody executes the defined plugins after reading CALL message body.
func (p *pluginSingleContainer) postReadCallBody(ctx ReadCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostReadCallBodyPlugin); ok {
if rerr = _plugin.PostReadCallBody(ctx); rerr != nil {
Errorf("[PostReadCallBodyPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PostReadPushHeader executes the defined plugins after reading PUSH message header.
func (p *pluginSingleContainer) postReadPushHeader(ctx ReadCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostReadPushHeaderPlugin); ok {
if rerr = _plugin.PostReadPushHeader(ctx); rerr != nil {
Errorf("[PostReadPushHeaderPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PreReadPushBody executes the defined plugins before reading PUSH message body.
func (p *pluginSingleContainer) preReadPushBody(ctx ReadCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PreReadPushBodyPlugin); ok {
if rerr = _plugin.PreReadPushBody(ctx); rerr != nil {
Errorf("[PreReadPushBodyPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PostReadPushBody executes the defined plugins after reading PUSH message body.
func (p *pluginSingleContainer) postReadPushBody(ctx ReadCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostReadPushBodyPlugin); ok {
if rerr = _plugin.PostReadPushBody(ctx); rerr != nil {
Errorf("[PostReadPushBodyPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PostReadReplyHeader executes the defined plugins after reading REPLY message header.
func (p *pluginSingleContainer) postReadReplyHeader(ctx ReadCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostReadReplyHeaderPlugin); ok {
if rerr = _plugin.PostReadReplyHeader(ctx); rerr != nil {
Errorf("[PostReadReplyHeaderPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PreReadReplyBody executes the defined plugins before reading REPLY message body.
func (p *pluginSingleContainer) preReadReplyBody(ctx ReadCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PreReadReplyBodyPlugin); ok {
if rerr = _plugin.PreReadReplyBody(ctx); rerr != nil {
Errorf("[PreReadReplyBodyPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PostReadReplyBody executes the defined plugins after reading REPLY message body.
func (p *pluginSingleContainer) postReadReplyBody(ctx ReadCtx) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostReadReplyBodyPlugin); ok {
if rerr = _plugin.PostReadReplyBody(ctx); rerr != nil {
Errorf("[PostReadReplyBodyPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
// PostDisconnect executes the defined plugins after disconnection.
func (p *pluginSingleContainer) postDisconnect(sess BaseSession) *Rerror {
var rerr *Rerror
for _, plugin := range p.plugins {
if _plugin, ok := plugin.(PostDisconnectPlugin); ok {
if rerr = _plugin.PostDisconnect(sess); rerr != nil {
Errorf("[PostDisconnectPlugin:%s] %s", plugin.Name(), rerr.String())
return rerr
}
}
}
return nil
}
func warnInvaildHandlerHooks(plugin []Plugin) {
for _, p := range plugin {
switch p.(type) {
case PreNewPeerPlugin:
Debugf("invalid PreNewPeerPlugin in router: %s", p.Name())
case PostNewPeerPlugin:
Debugf("invalid PostNewPeerPlugin in router: %s", p.Name())
case PostDialPlugin:
Debugf("invalid PostDialPlugin in router: %s", p.Name())
case PostAcceptPlugin:
Debugf("invalid PostAcceptPlugin in router: %s", p.Name())
case PreWriteCallPlugin:
Debugf("invalid PreWriteCallPlugin in router: %s", p.Name())
case PostWriteCallPlugin:
Debugf("invalid PostWriteCallPlugin in router: %s", p.Name())
case PreWritePushPlugin:
Debugf("invalid PreWritePushPlugin in router: %s", p.Name())
case PostWritePushPlugin:
Debugf("invalid PostWritePushPlugin in router: %s", p.Name())
case PreReadHeaderPlugin:
Debugf("invalid PreReadHeaderPlugin in router: %s", p.Name())
case PostReadCallHeaderPlugin:
Debugf("invalid PostReadCallHeaderPlugin in router: %s", p.Name())
case PostReadPushHeaderPlugin:
Debugf("invalid PostReadPushHeaderPlugin in router: %s", p.Name())
}
}
}