本文整理汇总了C++中HttpHeader::getEtag方法的典型用法代码示例。如果您正苦于以下问题:C++ HttpHeader::getEtag方法的具体用法?C++ HttpHeader::getEtag怎么用?C++ HttpHeader::getEtag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpHeader
的用法示例。
在下文中一共展示了HttpHeader::getEtag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check
bool ETagUrlChecker::check(HttpHeader& header, Url&url) {
if (header.getEtag() == "")
return false;
if (header.getEtag() == url.getEtag())
return false;
return true;
}
示例2: CheckUrl_wholePage
void wmtor::CheckUrl_wholePage(Url &url, HttpClient&cli, ofstream &ofile) {
HttpHeader header;
HttpContent content;
cli.requestWebPage(url, header, content);
ofile << "url:" << url.getUrlStr() << endl;
ofile << "header:" << header.getHeaderStr() << endl;
cout << "url:" << url.getUrlStr() << endl;
cout << "urlEtag:" << header.getEtag() << endl;
string contentMD5 = content.getMD5Str();
if ( !contentMD5.empty() && contentMD5 != url.getPageMD5Str()) {
url.setEtag(header.getEtag());
url.setAge(0);
url.setPageMD5Str(contentMD5);
saveNewPage(url,content, header);
reportNewWebPage(url);
}
}
示例3: CheckUrl
void wmtor::CheckUrl(Url &url, HttpClient&cli, ofstream &ofile) {
HttpHeader header;
cli.requestHeader(url, header);
ofile << "url:" << url.getUrlStr() << endl;
ofile << "header:" << header.getHeaderStr() << endl;
cout << "url:" << url.getUrlStr() << endl;
cout << "urlEtag:" << header.getEtag() << endl;
if (header.getEtag() != "") {
if (header.getEtag() != url.getEtag()) {
HttpContent content;
cli.requestContent(url, content, header.getContentLength());
string contentMD5 = content.getMD5Str();
url.setEtag(header.getEtag());
url.setAge(header.getAge());
url.setPageMD5Str(contentMD5);
savePage(content, header);
reportNewWebPage(url);
}
} else {
}
}