Ubuntu Linux에서 POCO C++ 라이브러리를 사용하여 네트워크 스트림에서 파일의 압축을 풀려고하지만 "잘못된 상태"예외로 압축 풀기가 실패합니다. HTTPResponse
상태 및 이유는 302 임시 이동입니다. 동시에 나는 브라우저로 링크를 다운로드하고 압축을 풀 수있다. HTTPResponse
과 같은 상태 일 때 HTTPClientSession
으로 무엇을해야합니까?POCO C++ 라이브러리, HTTP 응답 상태 불량
...
HTTPResponse res;
std::istream& rs = h_ses.receiveResponse (res);
if (res.getStatus() != HTTPResponse::HTTP_OK) {
poco_error (logger, "http response status: " + std::to_string (res.getStatus()) + " " + res.getReason());
}
if (!rs) {
poco_error (logger, "responese stream is in bad state: " + std::to_string (rs.rdstate()));
}
Decompress dec (rs, target_dir_.native());
poco_debug (logger, "Unzipping: " + dl + " ...");
dec.EError += Poco::Delegate<Addon_Loader, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &Addon_Loader::on_decompress_error);
dec.decompressAllFiles();
...