mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	Update link_sctp_linux.go
This commit is contained in:
		
							parent
							
								
									5f3a6c7d6c
								
							
						
					
					
						commit
						62324db959
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -63,7 +63,7 @@ func (l *linkSCTP) dial(url *url.URL, options linkOptions, sintf string) error {
 | 
				
			||||||
	//l.core.log.Printf("Read buffer %d", rbuf)
 | 
						//l.core.log.Printf("Read buffer %d", rbuf)
 | 
				
			||||||
	//l.core.log.Printf("Write buffer %d", wbuf)
 | 
						//l.core.log.Printf("Write buffer %d", wbuf)
 | 
				
			||||||
	conn.(*sctp.SCTPConn).SetEvents(sctp.SCTP_EVENT_DATA_IO)
 | 
						conn.(*sctp.SCTPConn).SetEvents(sctp.SCTP_EVENT_DATA_IO)
 | 
				
			||||||
	return l.handler(url.String(), info, conn, options, false)
 | 
						return l.handler(url.String(), info, conn, options, false, false)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (l *linkSCTP) listen(url *url.URL, sintf string) (*Listener, error) {
 | 
					func (l *linkSCTP) listen(url *url.URL, sintf string) (*Listener, error) {
 | 
				
			||||||
| 
						 | 
					@ -114,7 +114,7 @@ func (l *linkSCTP) listen(url *url.URL, sintf string) (*Listener, error) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			l.core.log.Printf("Read buffer %d", rbuf)
 | 
								l.core.log.Printf("Read buffer %d", rbuf)
 | 
				
			||||||
		        l.core.log.Printf("Write buffer %d", wbuf)
 | 
							        l.core.log.Printf("Write buffer %d", wbuf)
 | 
				
			||||||
			if err = l.handler(name, info, conn, linkOptions{}, true); err != nil {
 | 
								if err = l.handler(name, info, conn, linkOptions{}, true, addr.IP.IsLinkLocalUnicast()); err != nil {
 | 
				
			||||||
				l.core.log.Errorln("Failed to create inbound link:", err)
 | 
									l.core.log.Errorln("Failed to create inbound link:", err)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -125,13 +125,13 @@ func (l *linkSCTP) listen(url *url.URL, sintf string) (*Listener, error) {
 | 
				
			||||||
	return entry, nil
 | 
						return entry, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (l *linkSCTP) handler(name string, info linkInfo, conn net.Conn, options linkOptions, incoming bool) error {
 | 
					func (l *linkSCTP) handler(name string, info linkInfo, conn net.Conn, options linkOptions, incoming bool, force boo) error {
 | 
				
			||||||
	return l.links.create(
 | 
						return l.links.create(
 | 
				
			||||||
		conn,     // connection
 | 
							conn,     // connection
 | 
				
			||||||
		name,     // connection name
 | 
							name,     // connection name
 | 
				
			||||||
		info,     // connection info
 | 
							info,     // connection info
 | 
				
			||||||
		incoming, // not incoming
 | 
							incoming, // not incoming
 | 
				
			||||||
		false,    // not forced
 | 
							force,    // not forced
 | 
				
			||||||
		options,  // connection options
 | 
							options,  // connection options
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue