| 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 | { |
no test coverage detected