Overview
Features
Download
Documentation
Community
Add-Ons & Services

HTTPResponse bad status

Please post support and help requests here.

HTTPResponse bad status

Postby Urrg » 01 Aug 2013, 10:19

Hi, All!

I am trying to unzip file from network stream, but decompessing fails with "Illengal state" exception. HTTPResponse state and reason is "302 Moved Temporarily". At the same time i can download and unzip the link with browser. What should i do with HTTPClientSession when HTTPResponse is in such state?

Code: Select all
  ...
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 ();
  ...
Urrg
 
Posts: 1
Joined: 01 Aug 2013, 09:31

Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron