File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ var DEFAULT_TYPES = [
26
26
messages . Cancel ,
27
27
null , // pause
28
28
null , // resume
29
- null // end
29
+ null , // end
30
+ messages . Unhave ,
31
+ messages . Unwant
30
32
]
31
33
32
34
var DEFAULT_EVENTS = [
@@ -38,7 +40,9 @@ var DEFAULT_EVENTS = [
38
40
'cancel' ,
39
41
'pause' ,
40
42
'resume' ,
41
- 'end'
43
+ 'end' ,
44
+ 'unhave' ,
45
+ 'unwant'
42
46
]
43
47
44
48
while ( DEFAULT_EVENTS . length < 64 ) { // reserved
@@ -117,6 +121,14 @@ function use (extensions) {
117
121
return this . protocol . _send ( this , 8 , null )
118
122
}
119
123
124
+ Channel . prototype . unhave = function ( message ) {
125
+ return this . protocol . _send ( this , 9 , null )
126
+ }
127
+
128
+ Channel . prototype . unwant = function ( message ) {
129
+ return this . protocol . _send ( this , 10 , null )
130
+ }
131
+
120
132
Channel . prototype . close = function ( ) { // non graceful close
121
133
this . protocol . _close ( this )
122
134
}
Original file line number Diff line number Diff line change @@ -45,3 +45,13 @@ message Cancel {
45
45
optional uint64 bytes = 2 ;
46
46
optional bool hash = 3 ;
47
47
}
48
+
49
+ message Unhave {
50
+ required uint64 start = 1 ;
51
+ optional uint64 end = 2 ;
52
+ }
53
+
54
+ message Unwant {
55
+ required uint64 start = 1 ;
56
+ optional uint64 end = 2 ;
57
+ }
You can’t perform that action at this time.
0 commit comments