Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 73357500aca2
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 54b1c596435b
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jun 1, 2018

  1. download.cc: fix readCallback return type (int -> size_t)

    I'm not sure if curl ever asks for enough data at once
    for truncation to occur but better safe than sorry.
    dtzWill committed Jun 1, 2018
    Copy the full SHA
    54b1c59 View commit details
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/libstore/download.cc
4 changes: 2 additions & 2 deletions src/libstore/download.cc
Original file line number Diff line number Diff line change
@@ -213,7 +213,7 @@ struct CurlDownloader : public Downloader
}

size_t readOffset = 0;
int readCallback(char *buffer, size_t size, size_t nitems)
size_t readCallback(char *buffer, size_t size, size_t nitems)
{
if (readOffset == request.data->length())
return 0;
@@ -224,7 +224,7 @@ struct CurlDownloader : public Downloader
return count;
}

static int readCallbackWrapper(char *buffer, size_t size, size_t nitems, void * userp)
static size_t readCallbackWrapper(char *buffer, size_t size, size_t nitems, void * userp)
{
return ((DownloadItem *) userp)->readCallback(buffer, size, nitems);
}