MCPcopy Create free account
hub / github.com/aferrero2707/PhotoFlow / getFileLength

Method getFileLength

src/external/exiv2/src/basicio.cpp:1980–1996  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1978#endif
1979
1980 long HttpIo::HttpImpl::getFileLength()
1981 {
1982 Exiv2::Dictionary response;
1983 Exiv2::Dictionary request;
1984 std::string errors;
1985 request["server"] = hostInfo_.Host;
1986 request["page" ] = hostInfo_.Path;
1987 if (hostInfo_.Port != "") request["port"] = hostInfo_.Port;
1988 request["verb"] = "HEAD";
1989 long serverCode = (long)http(request, response, errors);
1990 if (serverCode < 0 || serverCode >= 400 || errors.compare("") != 0) {
1991 throw Error(55, "Server", serverCode);
1992 }
1993
1994 Exiv2::Dictionary_i lengthIter = response.find("Content-Length");
1995 return (lengthIter == response.end()) ? -1 : atol((lengthIter->second).c_str());
1996 }
1997
1998 void HttpIo::HttpImpl::getDataByRange(long lowBlock, long highBlock, std::string& response)
1999 {

Callers 1

openMethod · 0.80

Calls 3

compareMethod · 0.80
runCommandMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected