]> Cypherpunks repositories - gostls13.git/commitdiff
netchan: make -1 unlimited, as advertised.
authorRob Pike <r@golang.org>
Wed, 15 Sep 2010 06:41:37 +0000 (23:41 -0700)
committerRob Pike <r@golang.org>
Wed, 15 Sep 2010 06:41:37 +0000 (23:41 -0700)
R=adg
CC=golang-dev
https://golang.org/cl/2198042

src/pkg/netchan/common.go
src/pkg/netchan/import.go

index c5fd5698cf9043f32428e2f3fa4ebd75d5546a4a..010b957acdf374aea04e8baa91a6cd42b8752379 100644 (file)
@@ -39,7 +39,7 @@ type header struct {
 
 // Sent with a header once per channel from importer to exporter to report
 // that it wants to bind to a channel with the specified direction for count
-// messages.  If count is zero, it means unlimited.
+// messages.  If count is -1, it means unlimited.
 type request struct {
        count int64
        dir   Dir
index 6a065543b5e0619ae1bffb9bd53ecdfd30358cba..77ec24d77ba6f4816a26974e5e078ed18f3c8b44 100644 (file)
@@ -114,7 +114,7 @@ func (imp *Importer) run() {
 // Import imports a channel of the given type and specified direction.
 // It is equivalent to ImportNValues with a count of -1, meaning unbounded.
 func (imp *Importer) Import(name string, chT interface{}, dir Dir) os.Error {
-       return imp.ImportNValues(name, chT, dir, 0)
+       return imp.ImportNValues(name, chT, dir, -1)
 }
 
 // ImportNValues imports a channel of the given type and specified direction