Skip to content

Commit

Permalink
Merge pull request #271 from cloudwego/release/v0.4.1
Browse files Browse the repository at this point in the history
chore: release v0.4.1
  • Loading branch information
joway authored Jun 28, 2023
2 parents a8756d2 + 05a42c0 commit e19afcc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
compatibility-test:
strategy:
matrix:
go: [ 1.15, 1.19 ]
go: [ 1.15, "1.20" ]
os: [ X64, ARM64 ]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -25,6 +25,22 @@ jobs:
run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./...
- name: Benchmark
run: go test -bench=. -benchmem -run=none ./...
windows-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build Test
run: go vet -v ./...
style-test:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions net_io.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build darwin || netbsd || freebsd || openbsd || dragonfly || linux
// +build darwin netbsd freebsd openbsd dragonfly linux

package netpoll

import "syscall"
Expand Down
3 changes: 3 additions & 0 deletions poll_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build darwin || netbsd || freebsd || openbsd || dragonfly || linux
// +build darwin netbsd freebsd openbsd dragonfly linux

package netpoll

func (p *defaultPoll) Alloc() (operator *FDOperator) {
Expand Down
27 changes: 9 additions & 18 deletions sys_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,18 @@ func iovecs(bs [][]byte, ivs []syscall.Iovec) (iovLen int) {
continue
}
ivs[iovLen].Base = &chunk[0]
ivs[iovLen].SetLen(l)
totalLen += l
iovLen++
}
// iovecs limit length to 2GB(2^31)
if totalLen <= math.MaxInt32 {
return iovLen
}
// reset here
totalLen = math.MaxInt32
for i := 0; i < iovLen; i++ {
l := int(ivs[i].Len)
if l < totalLen {
totalLen -= l
continue
if totalLen < math.MaxInt32 {
ivs[iovLen].SetLen(l)
iovLen++
} else {
newLen := math.MaxInt32 - totalLen + l
ivs[iovLen].SetLen(newLen)
iovLen++
return iovLen
}
ivs[i].SetLen(totalLen)
iovLen = i + 1
resetIovecs(nil, ivs[iovLen:])
return iovLen
}

return iovLen
}

Expand Down

0 comments on commit e19afcc

Please sign in to comment.