mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	debug admin socket
This commit is contained in:
		
							parent
							
								
									94dd231e13
								
							
						
					
					
						commit
						6ce16d8192
					
				
					 4 changed files with 12 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -377,7 +377,7 @@ func (a *admin) getAuthBoxPubs() string {
 | 
			
		|||
 | 
			
		||||
func (a *admin) addAuthBoxPub(bstr string) (err error) {
 | 
			
		||||
	boxBytes, err := hex.DecodeString(bstr)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		var box boxPubKey
 | 
			
		||||
		copy(box[:], boxBytes)
 | 
			
		||||
		a.core.peers.addAuthBoxPub(&box)
 | 
			
		||||
| 
						 | 
				
			
			@ -387,7 +387,7 @@ func (a *admin) addAuthBoxPub(bstr string) (err error) {
 | 
			
		|||
 | 
			
		||||
func (a *admin) removeAuthBoxPub(bstr string) (err error) {
 | 
			
		||||
	boxBytes, err := hex.DecodeString(bstr)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		var box boxPubKey
 | 
			
		||||
		copy(box[:], boxBytes)
 | 
			
		||||
		a.core.peers.removeAuthBoxPub(&box)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,6 +44,7 @@ func (c *Core) init(bpub *boxPubKey,
 | 
			
		|||
	c.log = log.New(ioutil.Discard, "", 0)
 | 
			
		||||
	c.boxPub, c.boxPriv = *bpub, *bpriv
 | 
			
		||||
	c.sigPub, c.sigPriv = *spub, *spriv
 | 
			
		||||
	c.admin.core = c
 | 
			
		||||
	c.sigs.init()
 | 
			
		||||
	c.searches.init(c)
 | 
			
		||||
	c.dht.init(c)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -397,10 +397,11 @@ func (c *Core) DEBUG_setIfceExpr(expr *regexp.Regexp) {
 | 
			
		|||
	c.ifceExpr = expr
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *Core) DEBUG_addAuthBoxPub(boxBytes []byte) {
 | 
			
		||||
	var box boxPubKey
 | 
			
		||||
	copy(box[:], boxBytes)
 | 
			
		||||
	c.peers.addAuthBoxPub(&box)
 | 
			
		||||
func (c *Core) DEBUG_addAuthBoxPub(boxStr string) {
 | 
			
		||||
	err := c.admin.addAuthBoxPub(boxStr)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		panic(err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue