Jakob Borg
1a703efa78
lib/model: Fix accounting error in rescan with multiple subs ( fixes #3028 )
...
When doing prefix scans in the database, "foo" should not be considered
a prefix of "foo2". Instead, it should match "foo" exactly and also
strings with the prefix "foo/". This is more restrictive than what the
standard leveldb prefix scan does so we add some code to enforce it.
Also exposes the initialScanCompleted on the rwfolder for testing, and
change it to be a channel (so we can wait for it from another
goroutine). Otherwise we can't be sure when the initial scan has
completed, and we need to wait for that or it might pick up changes
we're doing at an unexpected time.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3067
2016-05-09 12:56:21 +00:00
Jakob Borg
8b7b0a03eb
lib/config: Don't require restart when adding folders/devices or changing listen address
...
The VersioningConfig change is because it defaults to nil but gets
deserialized to map[string]string{}. Now prepare() enforces a single
representation of the empty map.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3065
2016-05-09 11:30:19 +00:00
Jakob Borg
0761d804a4
cmd/syncthing: Use random folder ID for default folder, limit random charset
...
This uses the same charset as the Javascript code, excluding confusing
characters like 0, O, I, 1, l etc.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3064
2016-05-09 09:43:40 +00:00
Jakob Borg
3ad42d9279
lib/util: Should seed random number generator on startup
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3063
2016-05-09 09:36:42 +00:00
klemens
bd41e21c26
all: Correct spelling in comments
...
Skip-check: authors pr-build-mac
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3056
2016-05-08 10:54:22 +00:00
Jakob Borg
39899e40bf
cmd/syncthing: Use ReadAll + json.Unmarshal in places were we care about consuming the reader
...
Because json.NewDecoder(r).Decode(&v) doesn't necessarily consume all
data on the reader, that means an HTTP connection can't be reused. We
don't do a lot of HTTP traffic where we read JSON responses, but the
discovery is one such place. The other two are for POSTs from the GUI,
where it's not exactly critical but still nice if the connection still
can be keep-alive'd after the request as well.
Also ensure that we call req.Body.Close() for clarity, even though this
should by all accounts not really be necessary.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3050
2016-05-06 22:01:56 +00:00
Jakob Borg
5d337bb24f
lib/ignore: Handle bare commas in ignore patterns ( fixes #3042 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3048
2016-05-06 15:45:11 +00:00
Jakob Borg
dd5909568f
lib/upgrade: Don't attempt processing files larger than expected max binary size (ref #3045 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3047
2016-05-06 14:14:19 +00:00
Jakob Borg
38166e976f
lib/upgrade: Enforce limits on download archives ( fixes #3045 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3046
2016-05-06 13:58:34 +00:00
Jakob Borg
d6a7ffe0d4
lib/upgrade: Auto upgrade signature should cover version & arch ( fixes #3044 )
...
New signature is the HMAC of archive name (which includes the release
version and architecture) plus the contents of the binary. This is
expected in a new file "release.sig" which may be present in a
subdirectory. The new release tools put this in [.]metadata/release.sig.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3043
2016-05-06 13:30:35 +00:00
Jakob Borg
2e840134d2
lib/protocol: Add Request benchmarks over raw and TLS encrypted TCP channels
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3040
2016-05-04 23:07:07 +00:00
Jakob Borg
66e1be33cf
lib/protocol: Delete erroneously checked in test binary
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3039
2016-05-04 22:09:07 +00:00
Audrius Butkevicius
674fc566bb
lib/connections: Refactor
...
1. Removes separate relay lists and relay clients/services, just makes it a listen address
2. Easier plugging-in of other transports
3. Allows "hot" disabling and enabling NAT services
4. Allows "hot" listen address changes
5. Changes listen address list with a preferable "default" value just like for discovery
6. Debounces global discovery announcements as external addresses change (which it might alot upon starting)
7. Stops this whole "pick other peers relay by latency". This information is no longer available,
but I don't think it matters as most of the time other peer only has one relay.
8. Rename ListenAddress to ListenAddresses, as well as in javascript land.
9. Stop serializing deprecated values to JSON
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2982
2016-05-04 19:38:12 +00:00
Jakob Borg
09832abe50
lib/config: Change folder type attribute to a FolderType type
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3032
2016-05-04 11:26:36 +00:00
Audrius Butkevicius
eabd2fc936
lib/model: Use factories for creating folders
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3029
2016-05-04 10:47:33 +00:00
Jakob Borg
6720906ee5
lib/ignore: Refactor: notMatched should be one of the constants
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3031
2016-05-04 07:15:56 +00:00
Audrius Butkevicius
abb96802cb
lib/ignores: Use bitmask for result
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3030
2016-05-01 15:58:23 +00:00
Audrius Butkevicius
29fa05ae05
lib/model: Discard download progress upon receiving an index update ( fixes #2993 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3023
2016-05-01 06:49:29 +00:00
Audrius Butkevicius
49387f9494
lib/protocol: Clean up error values, unused flags
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3025
2016-04-30 04:35:38 +00:00
Audrius Butkevicius
8cf3a7aeda
lib/model: Prettify tests ( fixes #3014 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3016
2016-04-26 20:19:30 +00:00
Jakob Borg
b8c5cf1142
lib/model: Refactor: complete renaming of p -> f
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3015
2016-04-26 15:11:19 +00:00
Lars K.W. Gohlke
236f121c4e
lib/model: Refactor out folder and folderscan types, simplify somewhat
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3007
2016-04-26 14:01:46 +00:00
Audrius Butkevicius
2467678bd4
lib/dialer: Add env var to disable proxy fallback ( fixes #3006 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3009
2016-04-24 16:30:20 +00:00
Lars K.W. Gohlke
e87c1abd4e
all: Clean up dead code
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3005
2016-04-22 21:15:36 +00:00
Lars K.W. Gohlke
dffc34559b
lib/config: Remove dead code
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3004
2016-04-22 20:30:58 +00:00
Audrius Butkevicius
4aa6ecb122
lib/model: Do not use WRONLY (ref #2584 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2994
2016-04-22 08:12:10 +00:00
Jakob Borg
ccfcdf7f48
cmd/syncthing: Don't compact database at startup
...
This happens automatically in the background anyway, and it can take a
long time on low powered devices at an inconvenient time. We just want
to get up and running as quickly as possible.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3000
2016-04-22 07:34:11 +00:00
Audrius Butkevicius
ea54525a33
lib/connections: Try not to deadlock ( fixes #2987 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2991
2016-04-18 20:25:31 +00:00
Jakob Borg
b81c8d2e1b
lib/model: Drop incoming updates for ignored items ( fixes #1701 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2975
2016-04-18 18:35:31 +00:00
Audrius Butkevicius
1c7af1a72e
lib/upnp: Fix port order
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2980
2016-04-16 22:44:07 +00:00
Audrius Butkevicius
e61f424ade
lib/{nat,pmp}: Fix shadowing and nil IPs
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2979
2016-04-16 16:48:07 +00:00
Jakob Borg
fa1cfd94d0
lib/versioner: Refactor for testing, speed up test
...
Test now takes <1 second instead of 100 seconds
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2978
2016-04-15 14:26:39 +00:00
Jakob Borg
f6953624dd
lib/model: Test should pass go vet inspections
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2977
2016-04-15 11:41:18 +00:00
AudriusButkevicius
1a5f524ae4
lib/model, lib/protocol: Implement temporary indexes ( fixes #950 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2252
2016-04-15 10:59:41 +00:00
Audrius Butkevicius
c49453c519
lib/pmp: Add NAT-PMP support (ref #698 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2968
2016-04-13 18:50:40 +00:00
Jakob Borg
52c7804f32
lib/connections: Silence vet and lint warnings
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2971
2016-04-13 11:50:51 +00:00
Audrius Butkevicius
19b4f3bfb4
lib/nat: Add a nat package and service to track mappings on multiple IGDs
2016-04-10 19:36:38 +00:00
Jakob Borg
f3ac421266
lib/protocol: Comment the bit numbers for flags in IndexMessage
2016-04-10 10:47:30 +00:00
Michael Ploujnikov
7533a61203
unifySubs: add two trivial test cases
2016-04-10 02:41:28 +00:00
Michael Ploujnikov
467d338fe4
lib/model: Scanning unknown items is OK as long as the parent is known ( fixes #2915 )
2016-04-09 11:25:06 +00:00
Audrius Butkevicius
6130578d18
lib/db: Empty slice is not nil ( fixes #2872 )
2016-04-09 07:46:19 +00:00
Audrius Butkevicius
4389bb037d
lib/model: Add option for overwriting names on connect ( fixes #2912 )
2016-04-09 07:43:47 +00:00
Audrius Butkevicius
2eb8a9ef56
all: Dead code cleanup
2016-04-09 01:10:31 +00:00
Audrius Butkevicius
5a98af622d
lib/ignore: Implement deletable ignores using (?d) prefix ( fixes #1362 )
2016-04-07 09:34:07 +00:00
Jakob Borg
181939c841
lib/ignore: Correct case insensitive matching on Mac/Windows
...
There was a bug in that we only did the lowercase folding when the
pattern had an explicit (?i), which is not the case on Windows/Mac
necessarily.
2016-04-05 06:35:51 +00:00
Jakob Borg
1934b3a5b6
lib/ignore: Remove pattern for foo/** which is already covered by foo/
...
Actual speed difference according to benchmarks is hidden in the noise
Also make the "pattern" field for each entry match what is actually
evaluated.
2016-04-04 13:22:25 +01:00
Jakob Borg
cc1d122352
lib/model: Correctly detect deleted but previously ignored files as deleted
2016-04-04 11:53:55 +01:00
Jakob Borg
a4f0b85462
lib/config: Disable cacheIgnoredFiles, new default is disabled
2016-04-03 20:18:16 +01:00
Jakob Borg
4c3cd4c9e3
lib/ignore: Replace lib/fnmatch with github.com/gobwas/glob
...
Because it's literally ten times faster:
benchmark old ns/op new ns/op delta
BenchmarkMatch-8 13842 1200 -91.33%
BenchmarkMatchCached-8 139 147 +5.76%
benchmark old allocs new allocs delta
BenchmarkMatch-8 0 0 +0.00%
BenchmarkMatchCached-8 0 0 +0.00%
benchmark old bytes new bytes delta
BenchmarkMatch-8 12 0 -100.00%
BenchmarkMatchCached-8 0 0 +0.00%
2016-04-02 20:03:24 +01:00
Jakob Borg
a551686d37
lib/discovery: Receiving a new announcement should be non-blocking
...
Pretty sure the intention of the select was for it to be non-blocking.
Not that it will matter almost ever.
2016-04-01 07:24:04 +00:00