* Fix TODO about moving camput file's havecache up a layer into
camput itself. So now it's used for all commands (camput permanode,
camput attr, etc). Reduces HTTP requests.
* Fix camlistore.org/issue/343 -- don't do stats before uploads
in cases where it's useless. Adds a field to UploadHandle.
* Fix camlistore.org/issue/344: upload the public key whenever
uploading a signed blob. Usually this is a no-op because of the
have cache.
* Use zero (or <=0 rather), not -1, to mean unknown on UploadHandle
Size.
* More docs on public stuff.
The upload was constrained to have only 5 workers goroutines at a
time, but those goroutines could have been uploading directories and
blocked waiting for their dependent children, which never got to
upload if all 5 goroutines were uploading directories.
Now, allow an unlimited number of upload goroutines (see commit
058434449), but add a gate around things that allocate file
descriptors within the upload function.
This means that now we could have a ton of goroutines existing but
blocked on the gate, wasting ~4KB of memory each rather than the
relatively small amount of memory we used for the *node on the
container/list before.
Future CLs can reduce the memory usage and/or rewrite this.
Or maybe we forget to clean this up, but get smaller goroutine memory
usage in Go 1.3 as is being discussed. It _is_ convenient to just
launch tons of goroutines and manage dependencies with channel
operations rather than managing the dependencies state and goroutine
scheduling in your own code, just to save some memory.
Change-Id: I43d9d7795e5df4d790d6086d18e4b4b99eaacbc8
A new client configuration parameter, "trustedCerts" (list of strings)
is introduced. A certificate fingerprint is defined as the 10 digits
prefix of the sha1 of the whole certificate (in ASN1. DER form).
trustedCerts should contain the list of fingerprints of the
certificates we trust. If not empty, the server's certificate
is checked against that list, instead of using the full x509 validation
on it.
-added a dial function and tls configuration, which check if we're using
SSL, and if we're in "trustedCerts" mode.
pkg/client/client.go
pkg/client/config.go
-moved android specific hacks from camput to the client layer, so that
the dial and tls config could reuse/access them. Also allows future
reuse for other commands, such as camget.
pkg/client/android.go
-adapted camput to the above changes:
cmd/camput/android.go
cmd/camput/camput.go
cmd/camput/files.go
-server prints a hint when it generates the self-signed:
pkg/misc/misc.go
server/camlistored/camlistored.go
-camliactivity:
clients/android/res/xml/preferences.xml
clients/android/src/org/camlistore/Preferences.java
clients/android/src/org/camlistore/SettingsActivity.java
clients/android/src/org/camlistore/UploadService.java
clients/android/src/org/camlistore/UploadThread.java
http://camlistore.org/issue/131
Change-Id: I6be20161549a69aafc8eb7b9e96e9351dc1c5b09