Browse Source

Replace some magic 64*1024 with APT_BUFFER_SIZE

tags/debian/2.1.7
Julian Andres Klode 3 months ago
parent
commit
b5faca7a90
2 changed files with 3 additions and 4 deletions
  1. +2
    -3
      cmdline/apt-dump-solver.cc
  2. +1
    -1
      methods/http.cc

+ 2
- 3
cmdline/apt-dump-solver.cc View File

@@ -134,11 +134,10 @@ int main(int argc,const char *argv[]) /*{{{*/
return WriteError("ERR_READ_ERROR", out, stdoutfd, Solver);
}

constexpr size_t BufSize = 64 * 1024;
std::unique_ptr<char[]> Buf(new char[BufSize]);
std::unique_ptr<char[]> Buf(new char[APT_BUFFER_SIZE]);
unsigned long long ToRead = 0;
do {
if (input.Read(Buf.get(),BufSize, &ToRead) == false)
if (input.Read(Buf.get(), APT_BUFFER_SIZE, &ToRead) == false)
{
std::ostringstream out;
out << "Writing EDSP solver input to file '" << filename << "' failed as reading from stdin failed!\n";


+ 1
- 1
methods/http.cc View File

@@ -407,7 +407,7 @@ static ResultState UnwrapHTTPConnect(std::string Host, int Port, URI Proxy, std:
/*}}}*/

// HttpServerState::HttpServerState - Constructor /*{{{*/
HttpServerState::HttpServerState(URI Srv,HttpMethod *Owner) : ServerState(Srv, Owner), In(Owner, 64*1024), Out(Owner, 4*1024)
HttpServerState::HttpServerState(URI Srv, HttpMethod *Owner) : ServerState(Srv, Owner), In(Owner, APT_BUFFER_SIZE), Out(Owner, 4 * 1024)
{
TimeOut = Owner->ConfigFindI("Timeout", TimeOut);
ServerFd = MethodFd::FromFd(-1);


Loading…
Cancel
Save