本文整理汇总了C++中AuthRequest::send方法的典型用法代码示例。如果您正苦于以下问题:C++ AuthRequest::send方法的具体用法?C++ AuthRequest::send怎么用?C++ AuthRequest::send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthRequest
的用法示例。
在下文中一共展示了AuthRequest::send方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: auth_plain
void JabberClient::auth_plain()
{
AuthRequest *req = new AuthRequest(this);
req->start_element("query");
req->add_attribute("xmlns", "jabber:iq:auth");
QString username = data.owner.getId();
username = getToken(username, '@');
req->text_tag("username", username);
req->text_tag("password", getPassword());
req->text_tag("resource", data.owner.getResource());
req->send();
m_requests.push_back(req);
}
示例2: auth_digest
void JabberClient::auth_digest()
{
AuthRequest *req = new AuthRequest(this);
req->start_element("query");
req->add_attribute("xmlns", "jabber:iq:auth");
QString username = data.owner.getId();
username = getToken(username, '@');
req->text_tag("username", username);
QString digest = m_id;
digest += getPassword();
QByteArray md = QCryptographicHash::hash(digest.toUtf8(), QCryptographicHash::Sha1);
digest = QString::null;
for (int i = 0; i < md.size(); i++){
char b[3];
sprintf(b, "%02x", md[i] & 0xFF);
digest += b;
}
req->text_tag("digest", digest);
req->text_tag("resource", data.owner.getResource());
req->send();
m_requests.push_back(req);
}