Skip to content

Commit

Permalink
release go 1.15
Browse files Browse the repository at this point in the history
1.15 backport:
discard pidfiles; procd for openwrt can generate it. windows even don't need such functionality.

(cherry picked from commit f28d174)

# Conflicts:
#	.github/workflows/repique_release.yml
#	README.md
  • Loading branch information
AZ-X committed Jun 2, 2022
1 parent ca9c530 commit 141c616
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 225 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
## Repique is an advanced DNS stub which can run on different OS such as Windows, Linux, OpenWRT.

### ![golang 1.18.2](https://github.com/AZ-X/MEDIA/blob/master/PNG/repique_presentation/repique1.18.2.png?raw=true)

### ![openwrt](https://github.com/AZ-X/MEDIA/blob/master/PNG/repique_presentation/fin.PNG?raw=true)

## Repique is unique in the world because:
Expand Down Expand Up @@ -245,7 +247,7 @@ Check out [Releases Page](https://github.com/AZ-X/pique/releases)

### Installation

[Download the latest release with golang 1.15 for AMD64 on Windows or Linux](https://github.com/AZ-X/pique/releases/tag/v1.2.8)
[Download the latest release with golang 1.15 for AMD64 on Windows or Linux](https://github.com/AZ-X/pique/releases/tag/v1.2.10)

> Notice:
> Releases for OpenWRT won't be included in this repository @github.
Expand All @@ -259,6 +261,19 @@ Since version v1.1.5 of repique, you can use its sub-modules as libraries formal

However you still can get the source code and reuse it by 'git-clone' whatever the version is.

#### Practicable Build with Golang 1.18 or above

There are two options to build from the branch special for go1.18:

1. Change the source code by yourself and compile it.
1. Mod your own compiler just like what I did, then just compile the source code without modification.

There won't be any binary release targeting 1.18 because the risk of CoT (compiler of things) is extraordinary thus I am quite sluggard to alter the form of linknames.

[branch 1.18 works as below](https://github.com/AZ-X/pique/tree/repique-release-golang1.18)

![repique golang 1.18 double wing](https://raw.githubusercontent.com/AZ-X/MEDIA/master/PNG/repique_presentation/repique1.18.png)

#### X-Copy deployment

There is no additional service or setup to run repique.
Expand Down
150 changes: 0 additions & 150 deletions repique/behaviors/pidfile_linux.go

This file was deleted.

39 changes: 0 additions & 39 deletions repique/behaviors/pidfile_windows.go

This file was deleted.

25 changes: 12 additions & 13 deletions repique/conceptions/bats_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type Cache struct {
*sync.RWMutex
entries map[interface{}]*entry
push chan interface{}
push2 chan interface{}
delete chan interface{}
set chan *struct{K interface{}; V *entry}
full chan bool
Expand Down Expand Up @@ -50,7 +49,6 @@ func NewCache(size int) *Cache {
cache.entries = make(map[interface{}]*entry, size)
cache.keys.headTail = cache.keys.pack(1<<dequeueBits-1, 1<<dequeueBits-1)
cache.push = make(chan interface{}, common.Min(size, bufsize))
cache.push2 = make(chan interface{}, common.Min(size, bufsize))
cache.delete = make(chan interface{}, common.Min(size, bufsize))
cache.set = make(chan *struct{K interface{}; V *entry}, common.Min(size, bufsize))
cache.full = make(chan bool, common.Min(size, bufsize))
Expand All @@ -61,8 +59,6 @@ func NewCache(size int) *Cache {
case key := <-cache.push:
full := !cache.keys.pushHead(key)
cache.full <- full
case key := <-cache.push2:
cache.keys.pushHead(key)
case key := <-cache.delete:
cache.Lock()
delete(cache.entries, key)
Expand Down Expand Up @@ -115,17 +111,20 @@ func (m *Cache) Add(key, value interface{}) {
return
}
m.RUnlock()
m.push <- key
if full := <- m.full; full {
for {
m.push <- key
if full := <- m.full; !full {
break
}
if evictee_key, ok := m.keys.popTail(); ok {
m.push2 <- key
m.RLock()
if evictee, ok := m.entries[evictee_key]; ok {
m.RUnlock()
m.delete <- evictee_key
evictee.delete()
} else {
m.RUnlock()
for {
if evictee, ok := m.entries[evictee_key]; ok {
m.RUnlock()
m.delete <- evictee_key
evictee.delete()
break
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion repique/features/dns/channels/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (r *Remote) Init(cfg *Config, f FChannelByName) {

func (r *Remote) Handle(s *Session) Channel {
r.f(Channel_Stub).Handle(s)
if r.cache_enabled && s.LastState != R_OK {
if r.cache_enabled && s.LastState != R_OK && s.LastError != Error_Stub_Internal {
if s.rep_job == nil {
s.rep_job = &sync.Once{}
}
Expand Down
Loading

0 comments on commit 141c616

Please sign in to comment.