@@ -28,7 +28,7 @@ const IP4: u32 = 4;
2828const IP6 : u32 = 41 ;
2929const P2P_WEBRTC_DIRECT : u32 = 276 ;
3030const P2P_WEBRTC_STAR : u32 = 275 ;
31- const WEBRTC : u32 = 280 ;
31+ const WEBRTC_DIRECT : u32 = 280 ;
3232const CERTHASH : u32 = 466 ;
3333const P2P_WEBSOCKET_STAR : u32 = 479 ;
3434const MEMORY : u32 = 777 ;
@@ -92,7 +92,7 @@ pub enum Protocol<'a> {
9292 Ip6 ( Ipv6Addr ) ,
9393 P2pWebRtcDirect ,
9494 P2pWebRtcStar ,
95- WebRTC ,
95+ WebRTCDirect ,
9696 Certhash ( Multihash ) ,
9797 P2pWebSocketStar ,
9898 /// Contains the "port" to contact. Similar to TCP or UDP, 0 means "assign me a port".
@@ -210,11 +210,7 @@ impl<'a> Protocol<'a> {
210210 }
211211 "p2p-websocket-star" => Ok ( Protocol :: P2pWebSocketStar ) ,
212212 "p2p-webrtc-star" => Ok ( Protocol :: P2pWebRtcStar ) ,
213- "webrtc" => {
214- log:: warn!( "Parsed deprecated /webrtc. Use /webrtc-direct instead." ) ;
215- Ok ( Protocol :: WebRTC )
216- }
217- "webrtc-direct" => Ok ( Protocol :: WebRTC ) ,
213+ "webrtc-direct" => Ok ( Protocol :: WebRTCDirect ) ,
218214 "certhash" => {
219215 let s = iter. next ( ) . ok_or ( Error :: InvalidProtocolString ) ?;
220216 let ( _base, decoded) = multibase:: decode ( s) ?;
@@ -296,7 +292,7 @@ impl<'a> Protocol<'a> {
296292 }
297293 P2P_WEBRTC_DIRECT => Ok ( ( Protocol :: P2pWebRtcDirect , input) ) ,
298294 P2P_WEBRTC_STAR => Ok ( ( Protocol :: P2pWebRtcStar , input) ) ,
299- WEBRTC => Ok ( ( Protocol :: WebRTC , input) ) ,
295+ WEBRTC_DIRECT => Ok ( ( Protocol :: WebRTCDirect , input) ) ,
300296 CERTHASH => {
301297 let ( n, input) = decode:: usize ( input) ?;
302298 let ( data, rest) = split_at ( n, input) ?;
@@ -479,7 +475,7 @@ impl<'a> Protocol<'a> {
479475 }
480476 Protocol :: P2pWebSocketStar => w. write_all ( encode:: u32 ( P2P_WEBSOCKET_STAR , & mut buf) ) ?,
481477 Protocol :: P2pWebRtcStar => w. write_all ( encode:: u32 ( P2P_WEBRTC_STAR , & mut buf) ) ?,
482- Protocol :: WebRTC => w. write_all ( encode:: u32 ( WEBRTC , & mut buf) ) ?,
478+ Protocol :: WebRTCDirect => w. write_all ( encode:: u32 ( WEBRTC_DIRECT , & mut buf) ) ?,
483479 Protocol :: Certhash ( hash) => {
484480 w. write_all ( encode:: u32 ( CERTHASH , & mut buf) ) ?;
485481 let bytes = hash. to_bytes ( ) ;
@@ -511,7 +507,7 @@ impl<'a> Protocol<'a> {
511507 Ip6 ( a) => Ip6 ( a) ,
512508 P2pWebRtcDirect => P2pWebRtcDirect ,
513509 P2pWebRtcStar => P2pWebRtcStar ,
514- WebRTC => WebRTC ,
510+ WebRTCDirect => WebRTCDirect ,
515511 Certhash ( hash) => Certhash ( hash) ,
516512 P2pWebSocketStar => P2pWebSocketStar ,
517513 Memory ( a) => Memory ( a) ,
@@ -549,7 +545,7 @@ impl<'a> Protocol<'a> {
549545 Ip6 ( _) => "ip6" ,
550546 P2pWebRtcDirect => "p2p-webrtc-direct" ,
551547 P2pWebRtcStar => "p2p-webrtc-star" ,
552- WebRTC => "webrtc-direct" ,
548+ WebRTCDirect => "webrtc-direct" ,
553549 Certhash ( _) => "certhash" ,
554550 P2pWebSocketStar => "p2p-websocket-star" ,
555551 Memory ( _) => "memory" ,
0 commit comments