code: func (c *Client) UpdateShareChain(b blob.Ref, r io.Reader) error {
  	c.viaMu.Lock()
  	defer c.viaMu.Unlock()
  	if c.via == nil {
  		// Not in sharing mode, so return immediately.
  		return ErrNotSharing
  	}
  	// Slurp 1 MB to find references to other blobrefs for the via path.
  	var buf bytes.Buffer
  	const maxSlurp = 1 << 20
  	if _, err := io.Copy(&buf, io.LimitReader(r, maxSlurp)); err != nil {
  		return err
  	}
  	// If it looks like a JSON schema blob (starts with '{')
  	if schema.LikelySchemaBlob(buf.Bytes()) {
  		for _, blobstr := range blobsRx.FindAllString(buf.String(), -1) {
  			br, ok := blob.Parse(blobstr)
  			if !ok {
  				c.printf("Invalid blob ref %q noticed in schema of %v", blobstr, b)
  				continue
  			}
  			c.via[br] = b
  		}
  	}
  	return nil
  }
docs: // UpdateShareChain reads the schema of b from r, and instructs the client that
  // all blob refs found in this schema should use b as a preceding chain link, in
  // all subsequent shared blobs fetches. If the client was not created with
  // NewFromShareRoot, ErrNotSharing is returned.