Commit Graph

4129 Commits

Author SHA1 Message Date
Juan Batiz-Benet
b84fa2b493 net/p2p + secio: parallelize crypto handshake
We had a very nasty problem: handshakes were serial so incoming
dials would wait for each other to finish handshaking. this was
particularly problematic when handshakes hung-- nodes would not
recover quickly. This led to gateways not bootstrapping peers
fast enough.

The approach taken here is to do what crypto/tls does:
defer the handshake until Read/Write[1]. There are a number of
reasons why this is _the right thing to do_:
- it delays handshaking until it is known to be necessary (doing io)
- it "accepts" before the handshake, getting the handshake out of the
  critical path entirely.
- it defers to the user's parallelization of conn handling. users
  must implement this in some way already so use that, instead of
  picking constants surely to be wrong (how many handshakes to run
  in parallel?)

[0] http://golang.org/src/crypto/tls/conn.go#L886
2015-05-12 05:54:09 -04:00
Juan Batiz-Benet
08ea56ce72 Merge pull request #1191 from ipfs/refactor/httpGateway
Refactor/http gateway
2015-05-11 14:43:46 -04:00
Henry
4537311f59 http gw: disable PUT and writable tests - again... :( 2015-05-10 15:30:12 +02:00
Juan Batiz-Benet
e67c2a7b14 version bump to 0.3.4
(I'll add the changelog later today)
2015-05-10 09:23:47 -04:00
Juan Batiz-Benet
73e3e90cd9 simple ipns-republish script stopgap 2015-05-10 09:23:12 -04:00
Juan Batiz-Benet
fc8d225806 Merge pull request #1219 from ipfs/refactor/httpGateway-quickfix
Refactor/http gateway quickfix (1191)
2015-05-10 08:55:22 -04:00
Henry
87ce7abe47 unixfs/io: added NewEmptyDirectory()
some golinting along the way
2015-05-10 07:36:28 -04:00
Henry
31b83abfe4 http gw: remove newDagEmptyDir helper 2015-05-09 12:19:57 +02:00
Henry
96846358cc http gw: some golinting and unexport unused symbols
- NewDagReader() used the wrong context
- Ip?sPathPrefix isn't used anywhere
- a little bit of error handling cleanup
2015-05-09 12:19:57 +02:00
Henry
1502f6bc71 http gw: removed ResolvePath() in favour of core.Resolve() 2015-05-09 12:19:57 +02:00
Henry
e633250c38 http gw: remove unused interface 2015-05-09 12:19:57 +02:00
Juan Batiz-Benet
d6fc414b64 Merge pull request #1212 from wking/fix-recursive-path-resolution
path/resolver: Fix recursive path resolution
2015-05-09 01:10:36 -04:00
W. Trevor King
19823c6704 path/resolver_test: Test recursive Link resolution
Setup a three-level graph:

  a -(child)-> b -(grandchild)-> c

and then try and resolve:

  /ipfs/<hash-of-a>/child/grandchild

Before 10669e8b (path/resolver: Fix recursive path resolution,
2015-05-08) this failed with:

  resolver_test.go:71: no link named "grandchild" under QmSomeRandomHash

The boilerplate for this test is from pin/pin_test.go, and I make no
claims that it's the best way to setup the test graph ;).
2015-05-08 21:43:43 -07:00
W. Trevor King
10669e8b8c path/resolver: Fix recursive path resolution
I'm not entirely clear on Go's scoping (there's some text I can't
quite parse here [1]), but it seems like the := version (because this
is the first time we use 'err') was masking the function-level 'nd'
just for this if block.  That means that after we get out of the if
block and return to the start of the for-loop for the next pass,
nd.Links would still be pointing at the original object's links.

This commit drops the :=, which fixes the earlier:

  $ ipfs ls QmXX7YRpU7nNBKfw75VG7Y1c3GwpSAGHRev67XVPgZFv9R/static/css
  Error: no link named "css" under QmXX7YRpU7nNBKfw75VG7Y1c3GwpSAGHRev67XVPgZFv9R

so we get the intended:

  $ ipfs ls QmXX7YRpU7nNBKfw75VG7Y1c3GwpSAGHRev67XVPgZFv9R/static/css
  Qme4r3eA4h1revFBgCEv1HF1U7sLL4vvAyzRLWJhCFhwg2 7051 style.css

It also means we're probably missing (or are unreliably using) a
multi-level-path-resolving test.

[1]: https://golang.org/ref/spec#Declarations_and_scope
2015-05-08 16:25:39 -07:00
Juan Batiz-Benet
cd37b6741d Merge pull request #1189 from ipfs/refactor/coreResolve
core: add context.Context param to core.Resolve()
2015-05-08 01:33:52 -04:00
Juan Batiz-Benet
d529ccbc45 Merge pull request #1202 from ipfs/godeps/metrics
godeps: update metrics (freebsd build fix)
2015-05-08 01:29:05 -04:00
Juan Batiz-Benet
74a7a26c8b Merge pull request #1206 from insanity54/docs/1088
add link to community contributing #1088
2015-05-08 01:27:48 -04:00
Juan Batiz-Benet
887f6bbbf0 Merge pull request #1209 from ipfs/fixImportRewrite
godeps: rewrite import path
2015-05-08 01:26:55 -04:00
Henry
f640ba0089 core: add context.Context param to core.Resolve()
commands/object: remove objectData() and objectLinks() helpers
resolver: added context parameters
sharness: $HASH carried the \r from the http protocol with
sharness: write curl output to individual files
http gw: break PUT handler until PR#1191
2015-05-08 03:14:32 +02:00
Henry
bcd5673a79 godeps: rewrite import path 2015-05-08 01:10:20 +02:00
Chris Grimmett
10eecf06e0 add link to community contributing #1088 2015-05-07 14:33:55 +00:00
Juan Batiz-Benet
bf5b8032a8 Merge pull request #1205 from wking/retreive-typo
ipnsfs/system: Fix 'retreive' -> 'retrieve' typo
2015-05-07 01:37:40 -04:00
W. Trevor King
ed07c05887 ipnsfs/system: Fix 'retreive' -> 'retrieve' typo
From 93b06f34 (Add timeout to ipns resolution at startup, 2015-04-24,
#1133).
2015-05-06 22:29:23 -07:00
Henry
2ca2a042b9 godeps: update metrics (freebsd build fix) 2015-05-06 14:14:40 +02:00
Juan Batiz-Benet
0d521ff288 Merge pull request #1199 from ipfs/feat/bsrefactor
mild refactor of bitswap
2015-05-06 05:31:33 -04:00
Jeromy
9049dae674 address comments from CR 2015-05-06 01:35:59 -07:00
Jeromy Johnson
0324b4b283 mild refactor of bitswap 2015-05-06 01:35:57 -07:00
Juan Batiz-Benet
2d47c7f64e Merge pull request #1200 from ipfs/fix/blocksize-calc
correct the blocksize calculation for link blocks
2015-05-06 04:34:47 -04:00
Jeromy Johnson
95f01537a3 correct the blocksize calculation for link blocks
update hash for bigfile
2015-05-06 01:04:15 -07:00
Juan Batiz-Benet
54633317a1 Merge pull request #1198 from dominictarr/master
make comments match the code in secure channel implementation
2015-05-06 03:18:41 -04:00
Dominic Tarr
e89e83f49e make comments describe what code actually does. 2015-05-06 15:33:26 +12:00
Juan Batiz-Benet
b71b7271c8 Merge pull request #1181 from ipfs/fix/mega-read
quick fix for OOM panic that has been plaguing us
2015-05-05 00:58:15 -04:00
Juan Batiz-Benet
99596435a7 Merge pull request #1166 from ipfs/fix/bitswap-multisend
try harder to not send duplicate blocks
2015-05-05 00:07:53 -04:00
Juan Batiz-Benet
9a5bb52fcd Merge pull request #1194 from ipfs/fix/iptb-fails
increase iptb test stability
2015-05-04 22:55:54 -04:00
Juan Batiz-Benet
688275b08f Merge pull request #1164 from ipfs/fix/ipns-append
fix append bug and overwrite/truncate bug
2015-05-04 22:55:13 -04:00
Jeromy
9cf8c5cbc9 update iptb dependency and use different ports for each iptb cluster
update iptb dependency again, and pick different ports for each iptb cluster

try and fix godeps crap
2015-05-04 19:45:44 -07:00
Juan Batiz-Benet
9b12e02b69 Merge pull request #1193 from ipfs/improve_parse_test
Improve parse_test.go
2015-05-04 15:15:55 -07:00
Jeromy
6f04302a48 remove logging of dup blocks, move to counters for bitswap stat 2015-05-04 03:12:17 -07:00
Jeromy Johnson
45b54c787f Merge pull request #1183 from wking/remove-core-commands-internal-slice_util
core/commands/internal/slice_util: Remove this unused package
2015-05-03 23:17:32 -07:00
Juan Batiz-Benet
29fae23d0d Merge pull request #1190 from ipfs/godep/msgio
godep: update go-msgio
2015-05-03 13:19:46 -07:00
Christian Couder
93f253e00b parse_test: add testFail() to simplify tests
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-03 20:18:40 +02:00
Christian Couder
47a88f8429 parse_test: improve existing tests
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-03 20:10:28 +02:00
Christian Couder
c6dcfaaf5d parse_test: use fileToSimulateStdin()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-03 12:09:13 +02:00
Henry
d368cb7a43 godep: update go-msgio 2015-05-03 04:29:13 +02:00
Christian Couder
58126c1c6c parse_test: improve tests with stdin enabled arg
Now also check that we get the right arguments from
the parsing.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-02 23:35:24 +02:00
Christian Couder
d0752a714d parse_test: add tests for stdin enabled arg
Let's document how stdin enabled arguments currently
work by adding some tests.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-02 23:02:57 +02:00
Christian Couder
3e4a06945f parse_test: fix and test sameWords()
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-02 23:02:57 +02:00
Christian Couder
2a5b2f2f4a parse_test: move helper functions
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2015-05-02 23:02:57 +02:00
Juan Batiz-Benet
fab5e91a93 Merge pull request #1163 from ipfs/ds-metrics
Record Datastore metrics for flatfs and leveldb
2015-05-02 13:16:04 -07:00
Juan Batiz-Benet
fc87f01a85 Merge pull request #1185 from wking/go-doc
Add package comments to packages that are missing them
2015-05-02 12:22:17 -07:00