Skip to content

Commit

Permalink
Merge adfc646 into 0f2a978
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanjuan committed Aug 17, 2018
2 parents 0f2a978 + adfc646 commit 2519eb8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions api/rest/restapi.go
Expand Up @@ -531,11 +531,16 @@ func (api *API) addHandler(w http.ResponseWriter, r *http.Request) {
wg.Add(1)
go func() {
defer wg.Done()

flusher, canFlush := w.(http.Flusher)
for v := range output {
err := enc.Encode(v)
if err != nil {
logger.Error(err)
}
if canFlush {
flusher.Flush()
}
}
}()

Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -69,9 +69,9 @@
},
{
"author": "hsanjuan",
"hash": "QmSMWoH8wKuViGUe2ZDr3kDijbzkk81nY71zV1ApibFLxF",
"hash": "QmeyKL7WDSPhnhozCB3oC51j5pDs7DnCGWPyVaxgwpncA6",
"name": "go-libp2p-http",
"version": "1.0.8"
"version": "1.1.0"
},
{
"author": "ipfs",
Expand Down
2 changes: 1 addition & 1 deletion peer_manager_test.go
Expand Up @@ -535,7 +535,7 @@ func TestClustersPeerRejoin(t *testing.T) {

// add all clusters
for i := 1; i < len(clusters); i++ {
_, err := clusters[0].PeerAdd(clusters[i].id)
err := clusters[i].Join(clusterAddr(clusters[0]))
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 2519eb8

Please sign in to comment.