mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Merge pull request #643 from adamruzicka/mtu
Unify MTU datatypes across the codebase
This commit is contained in:
		
						commit
						2fc6f9a71d
					
				
					 13 changed files with 51 additions and 37 deletions
				
			
		| 
						 | 
				
			
			@ -99,7 +99,7 @@ type Session struct {
 | 
			
		|||
	Coords      []uint64         // The coordinates of the remote node
 | 
			
		||||
	BytesSent   uint64           // Bytes sent to the session
 | 
			
		||||
	BytesRecvd  uint64           // Bytes received from the session
 | 
			
		||||
	MTU         uint16           // The maximum supported message size of the session
 | 
			
		||||
	MTU         MTU              // The maximum supported message size of the session
 | 
			
		||||
	Uptime      time.Duration    // How long this session has been active for
 | 
			
		||||
	WasMTUFixed bool             // This field is no longer used
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -364,8 +364,8 @@ func (c *Core) SetNodeInfo(nodeinfo interface{}, nodeinfoprivacy bool) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
// GetMaximumSessionMTU returns the maximum allowed session MTU size.
 | 
			
		||||
func (c *Core) GetMaximumSessionMTU() uint16 {
 | 
			
		||||
	var mtu uint16
 | 
			
		||||
func (c *Core) GetMaximumSessionMTU() MTU {
 | 
			
		||||
	var mtu MTU
 | 
			
		||||
	phony.Block(&c.router, func() {
 | 
			
		||||
		mtu = c.router.sessions.myMaximumMTU
 | 
			
		||||
	})
 | 
			
		||||
| 
						 | 
				
			
			@ -375,7 +375,7 @@ func (c *Core) GetMaximumSessionMTU() uint16 {
 | 
			
		|||
// SetMaximumSessionMTU sets the maximum allowed session MTU size. The default
 | 
			
		||||
// value is 65535 bytes. Session pings will be sent to update all open sessions
 | 
			
		||||
// if the MTU has changed.
 | 
			
		||||
func (c *Core) SetMaximumSessionMTU(mtu uint16) {
 | 
			
		||||
func (c *Core) SetMaximumSessionMTU(mtu MTU) {
 | 
			
		||||
	phony.Block(&c.router, func() {
 | 
			
		||||
		if c.router.sessions.myMaximumMTU != mtu {
 | 
			
		||||
			c.router.sessions.myMaximumMTU = mtu
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue