Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for closeWithError (0.82 sec)

  1. 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
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed Jun 05 07:51:13 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  2. internal/ringbuffer/ring_buffer.go

    	r.mu.Lock()
    	defer r.mu.Unlock()
    
    	return !r.isFull && r.w == r.r
    }
    
    // CloseWithError closes the writer; reads will return
    // no bytes and the error err, or EOF if err is nil.
    //
    // CloseWithError never overwrites the previous error if it exists
    // and always returns nil.
    func (r *RingBuffer) CloseWithError(err error) {
    	if err == nil {
    		err = io.EOF
    	}
    	r.setErr(err, false)
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 15 00:11:04 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. internal/ringbuffer/ring_buffer_test.go

    	}
    	if err := rb.Flush(); err != (testError1{}) {
    		t.Errorf("Write error: got %T, want testError1", err)
    	}
    
    	rb.CloseWithError(testError2{})
    	if _, err := rb.Write(nil); err != (testError1{}) {
    		t.Errorf("Write error: got %T, want testError1", err)
    	}
    
    	rb.Reset()
    	rb.CloseWithError(testError1{})
    	if _, err := rb.Read(nil); err != (testError1{}) {
    		t.Errorf("Read error: got %T, want testError1", err)
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 15 00:11:04 UTC 2024
    - 26.8K bytes
    - Viewed (0)
  4. src/net/http/fcgi/child.go

    		return nil
    	case typeAbortRequest:
    		delete(c.requests, rec.h.Id)
    		c.conn.writeEndRequest(rec.h.Id, 0, statusRequestComplete)
    		if req.pw != nil {
    			req.pw.CloseWithError(ErrRequestAborted)
    		}
    		if !req.keepConn {
    			// connection will close upon return
    			return errCloseConn
    		}
    		return nil
    	default:
    		b := make([]byte, 8)
    		b[0] = byte(rec.h.Type)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 10.3K 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
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 10 15:51:27 UTC 2024
    - 44.8K bytes
    - Viewed (0)
  6. 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)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Jun 07 22:18:44 UTC 2024
    - 30.4K bytes
    - Viewed (0)
  7. 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.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Jun 11 03:13:30 UTC 2024
    - 36.3K bytes
    - Viewed (0)
  8. cmd/storage-rest-client.go

    	pr, pw := io.Pipe()
    	go func() {
    		pw.CloseWithError(waitForHTTPStream(respBody, ioutil.NewDeadlineWriter(pw, globalDriveConfig.GetMaxTimeout())))
    	}()
    	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 {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 10 15:51:27 UTC 2024
    - 27.4K bytes
    - Viewed (0)
  9. src/net/http/fs.go

    				part, err := mw.CreatePart(ra.mimeHeader(ctype, size))
    				if err != nil {
    					pw.CloseWithError(err)
    					return
    				}
    				if _, err := content.Seek(ra.start, io.SeekStart); err != nil {
    					pw.CloseWithError(err)
    					return
    				}
    				if _, err := io.CopyN(part, content, ra.length); err != nil {
    					pw.CloseWithError(err)
    					return
    				}
    			}
    			mw.Close()
    			pw.Close()
    		}()
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 09 17:06:47 UTC 2024
    - 31.1K bytes
    - Viewed (0)
Back to top