Skip to content

Commit

Permalink
chore: Remove unnecessary if in httpupgrade (XTLS#3413)
Browse files Browse the repository at this point in the history
CI: not create zip file when not releasing

Makefile: remove unneccesary `install` target &

Add build to `.PHONY` target
  • Loading branch information
AsenHu authored and Fangliding committed Jun 5, 2024
1 parent 075051a commit c04b2d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ on:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/*.yml"
- ".github/workflows/release.yml"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/*.yml"
- ".github/workflows/release.yml"
jobs:
prepare:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
run: |
mkdir -p build_assets
make
find . -maxdepth 1 -type f -regex '.*\(wxray\|xray\|xray_softfloat\)\(\|.exe\)' -exec mv {} ./build_assets/ \;
find . -maxdepth 1 -type f -regex './\(wxray\|xray\|xray_softfloat\)\(\|.exe\)' -exec mv {} ./build_assets/ \;
- name: Restore Cache
uses: actions/cache/restore@v4
Expand All @@ -198,6 +198,7 @@ jobs:
cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE
- name: Create ZIP archive
if: github.event_name == 'release'
shell: bash
run: |
pushd build_assets || exit 1
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ endif
ifeq ($(shell echo "$(GOARCH)" | grep -Eq "(mips|mipsle)" && echo true),true) #
ADDITION = GOMIPS=softfloat go build -o $(NAME)_softfloat -trimpath -ldflags "$(LDFLAGS)" -v $(MAIN)
endif
.PHONY: clean
.PHONY: clean build

build:
go build -o $(OUTPUT) $(PARAMS) $(MAIN)
$(ADDITION)

install:
go build -o $(PREFIX)/bin/$(OUTPUT) $(PARAMS) $(MAIN)

clean:
go clean -v -i $(PWD)
rm -f xray xray.exe wxray.exe xray_softfloat
6 changes: 1 addition & 5 deletions transport/internet/httpupgrade/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@ func (s *server) Handle(conn net.Conn) (stat.Connection, error) {
Port: int(0),
}
}
if remoteAddr == nil {
return nil, newError("remoteAddr is nil")
}

conn = newConnection(conn, remoteAddr)
return stat.Connection(conn), nil
return stat.Connection(newConnection(conn, remoteAddr)), nil
}

func (s *server) keepAccepting() {
Expand Down

0 comments on commit c04b2d1

Please sign in to comment.