Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@ GLOBAL OPTIONS:
Implies --share
```

## Upload results without an answer

An upload counts only requests that the server answered with success. A server that refuses every request fails the upload, the same way a server that is down does.

A slow uplink, or `--no-pre-allocate` where the body never ends, can end a run with no answer at all while data was still crossing the link. Bytes count then, as long as some request had been sending for at least 250 ms. A connection dropped at once does not count.

One case cannot be told apart from a slow uplink: a server that reads the whole payload and then never answers. The client cannot see whether the payload sits in the buffers on the way or in the server. Such a run reports the bytes it sent instead of failing.

## Use a custom backend server list
The `librespeed-cli` supports loading custom backend server list from a JSON file (remotely via `--server-json` or
locally via `--local-json`). The format is as below:
Expand Down
5 changes: 5 additions & 0 deletions defs/bytes_counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ func (c *BytesCounter) Write(p []byte) (int, error) {
return n, nil
}

// Discount takes back n bytes that were counted for a request that failed.
func (c *BytesCounter) Discount(n uint64) {
c.total.Add(^(n - 1))
}

// SetBase sets the base for dividing bytes into megabyte or mebibyte
func (c *BytesCounter) SetMebi(mebi bool) {
c.mebi = mebi
Expand Down
Loading