aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2010-09-14 23:41:37 -0700
committerRob Pike <r@golang.org>2010-09-14 23:41:37 -0700
commit8d831de6854f744fb6d653ecbce13a8129329e63 (patch)
treeb412eaddecba756e1bbe2dfad6c8ee31f4705e70
parent7f0ddd682aaf2b4d36b5f35eef13860c85f8f4fe (diff)
downloadgo-8d831de6854f744fb6d653ecbce13a8129329e63.tar.gz
go-8d831de6854f744fb6d653ecbce13a8129329e63.zip
netchan: make -1 unlimited, as advertised.
R=adg CC=golang-dev https://golang.org/cl/2198042
-rw-r--r--src/pkg/netchan/common.go2
-rw-r--r--src/pkg/netchan/import.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/netchan/common.go b/src/pkg/netchan/common.go
index c5fd5698cf..010b957acd 100644
--- a/src/pkg/netchan/common.go
+++ b/src/pkg/netchan/common.go
@@ -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
diff --git a/src/pkg/netchan/import.go b/src/pkg/netchan/import.go
index 6a065543b5..77ec24d77b 100644
--- a/src/pkg/netchan/import.go
+++ b/src/pkg/netchan/import.go
@@ -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