Skip to content

all: Remove dead code, fix lost msgLen checks - #6129

Merged
calmh merged 4 commits into
syncthing:masterfrom
AudriusButkevicius:cleanup
Nov 6, 2019
Merged

calmh merged 4 commits into
syncthing:masterfrom
AudriusButkevicius:cleanup

Conversation

@AudriusButkevicius

Copy link
Copy Markdown
Member

Diff speaks for itself

Comment thread cmd/syncthing/main.go
)

const (
exitSuccess = 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably use these instead for all of these

Comment thread lib/protocol/protocol.go
msgLen := int32(binary.BigEndian.Uint32(fourByteBuf))
if msgLen < 0 {
return nil, fmt.Errorf("negative message length %d", msgLen)
} else if msgLen > MaxMessageLen {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What prompted this? I'm sure the change is fine, but curious how you came about it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MaxMessageLen was shown as unused in my IDE. It seems to have gone missing when the BufferPool was introduced.

@calmh
calmh merged commit 98a1ade into syncthing:master Nov 6, 2019
@AudriusButkevicius
AudriusButkevicius deleted the cleanup branch November 6, 2019 07:30
@calmh calmh added this to the v1.3.2 milestone Nov 8, 2019
calmh added a commit to calmh/syncthing that referenced this pull request Nov 11, 2019
* master:
  docker: Add stdiscosrv and strelaysrv Dockerfiles (syncthing#6143)
  lib/protocol: Buffer allocation when compressing (fixes syncthing#6146) (syncthing#6147)
  golang-ci: Upgrade, skipping the white space complainer
  all: Cleanups enabled by Go 1.12
  lib/tlsutil: Remove Go 1.12 TLS 1.3 beta opt-in
  lib/api: Make theme paths relative (syncthing#6142)
  gui, lib/api: Adds support for prefers-color-scheme (fixes syncthing#6115)
  lib/api: Reset mtime after theme change (fixes syncthing#5810) (syncthing#6140)
  lib/model: Remove some testing deadlocks (syncthing#6138)
  lib/model: Add test for previous commit
  lib/model: Add initial deviceStatRefs on model creation (fixes syncthing#6136) (syncthing#6137)
  lib/model: Add folders on start in model (syncthing#6135)
  cmd/stbench: rm -r cmd/stbench (syncthing#6131)
  lib/api: Slightly unflake TestCSRFRequired by allowing longer timeout
  Fix bufferpool puts (ref syncthing#4976) (syncthing#6125)
  all: Remove dead code, fix lost msgLen checks (syncthing#6129)
  lib/upnp: Fix outdated comment (syncthing#6110)
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Nov 5, 2020
@syncthing syncthing locked and limited conversation to collaborators Nov 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants