Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for CloseWithError (0.42 sec)

  1. internal/ioutil/wait_pipe.go

    	once sync.Once
    	done func()
    }
    
    // CloseWithError close with supplied error the writer end.
    func (w *PipeWriter) CloseWithError(err error) error {
    	err = w.PipeWriter.CloseWithError(err)
    	w.once.Do(func() {
    		w.done()
    	})
    	return err
    }
    
    // PipeReader is similar to io.PipeReader with wait group
    type PipeReader struct {
    	*io.PipeReader
    	wait func()
    }
    
    // CloseWithError close with supplied error the reader end
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 27 14:55:36 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  2. cmd/sftp-server-driver.go

    func (w *writerAt) TransferError(err error) {
    	_ = w.w.CloseWithError(err)
    	_ = w.r.CloseWithError(err)
    	w.err = err
    }
    
    func (w *writerAt) Close() (err error) {
    	switch {
    	case len(w.buffer) > 0:
    		err = errors.New("some file segments were not flushed from the queue")
    		_ = w.w.CloseWithError(err)
    	case w.err != nil:
    		// No need to close here since both pipes were
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 12:23:42 GMT 2024
    - 12.9K bytes
    - Viewed (0)
  3. cmd/bitrot-streaming.go

    	return &streamingBitrotWriter{iow: ioutil.NopCloser(w), h: algo.New(), shardSize: shardSize, canClose: nil, closeWithErr: func(err error) error {
    		// Similar to CloseWithError on pipes we always return nil.
    		return nil
    	}}
    }
    
    // Returns streaming bitrot writer implementation.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed Jan 31 02:11:45 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  4. cmd/metacache-set.go

    			go func() {
    				werr := er.getObjectWithFileInfo(ctx, minioMetaBucket, o.objectPath(partN), 0,
    					fi.Size, pw, fi, metaArr, onlineDisks)
    				pw.CloseWithError(werr)
    			}()
    
    			tmp := newMetacacheReader(pr)
    			e, err := tmp.filter(o)
    			pr.CloseWithError(err)
    			tmp.Close()
    			entries.o = append(entries.o, e.o...)
    			if o.Limit > 0 && entries.len() > o.Limit {
    				entries.truncate(o.Limit)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 18 04:42:11 GMT 2024
    - 30.4K bytes
    - Viewed (0)
  5. cmd/storage-rest-server.go

    	tmp := make([]byte, len(b))
    	copy(tmp, b)
    	h.block <- tmp
    	return len(b), h.err
    }
    
    // CloseWithError will close the stream and return the specified error.
    // This can be done several times, but only the first error will be sent.
    // After calling this the stream should not be written to.
    func (h *httpStreamResponse) CloseWithError(err error) {
    	if h.done == nil {
    		return
    	}
    	h.done <- err
    	h.err = err
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 11 17:45:28 GMT 2024
    - 44.3K bytes
    - Viewed (0)
  6. cmd/object-api-utils.go

    		defer xioutil.SafeClose(indexCh)
    		cn, err := io.Copy(comp, r)
    		if err != nil {
    			comp.Close()
    			pw.CloseWithError(err)
    			return
    		}
    		if on > 0 && on != cn {
    			// if client didn't sent all data
    			// from the client verify here.
    			comp.Close()
    			pw.CloseWithError(IncompleteBody{})
    			return
    		}
    		// Close the stream.
    		// If more than compMinIndexSize was written, generate index.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Mar 11 11:55:34 GMT 2024
    - 35.6K bytes
    - Viewed (1)
  7. cmd/storage-rest-client.go

    	defer xhttp.DrainBody(respBody)
    
    	pr, pw := io.Pipe()
    	go func() {
    		pw.CloseWithError(waitForHTTPStream(respBody, pw))
    	}()
    	mr := msgp.NewReader(pr)
    	defer readMsgpReaderPoolPut(mr)
    	for {
    		var file ReadMultipleResp
    		if err := file.DecodeMsg(mr); err != nil {
    			if errors.Is(err, io.EOF) {
    				err = nil
    			}
    			pr.CloseWithError(err)
    			return toStorageErr(err)
    		}
    		select {
    		case <-ctx.Done():
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 26K bytes
    - Viewed (0)
  8. cmd/erasure-object.go

    		unlockOnDefer = fi.InlineData()
    	}
    
    	pr, pw := xioutil.WaitPipe()
    	go func() {
    		pw.CloseWithError(er.getObjectWithFileInfo(ctx, bucket, object, off, length, pw, fi, metaArr, onlineDisks))
    	}()
    
    	// Cleanup function to cause the go routine above to exit, in
    	// case of incomplete read.
    	pipeCloser := func() {
    		pr.CloseWithError(nil)
    	}
    
    	if !unlockOnDefer {
    		return fn(pr, h, pipeCloser, nsUnlocker)
    	}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 16:44:59 GMT 2024
    - 76.3K bytes
    - Viewed (2)
  9. cmd/bucket-replication.go

    			mw := msgp.NewWriter(w)
    			n, err := mw.Write(data[:])
    			if err != nil {
    				w.CloseWithError(err)
    				return
    			}
    			if n != len(data) {
    				w.CloseWithError(io.ErrShortWrite)
    				return
    			}
    			err = v.EncodeMsg(mw)
    			mw.Flush()
    			w.CloseWithError(err)
    		}()
    		return r
    	}
    
    	globalLocalDrivesMu.RLock()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Apr 20 09:05:54 GMT 2024
    - 112K bytes
    - Viewed (1)
  10. api/go1.txt

    pkg io, method (*LimitedReader) Read([]uint8) (int, error)
    pkg io, method (*PipeReader) Close() error
    pkg io, method (*PipeReader) CloseWithError(error) error
    pkg io, method (*PipeReader) Read([]uint8) (int, error)
    pkg io, method (*PipeWriter) Close() error
    pkg io, method (*PipeWriter) CloseWithError(error) error
    pkg io, method (*PipeWriter) Write([]uint8) (int, error)
    pkg io, method (*SectionReader) Read([]uint8) (int, error)
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
Back to top