Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
fix: username_encrypt error & logout username encrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
zengxs committed Dec 21, 2018
1 parent e8b886a commit 731bebe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion EasyHautX/encrypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const char *username_encrypt(const char *username) {
for (int i = 0; i < strlen(username); ++i)
oss << (char)(username[i] + 4);

snprintf(username_buffer, sizeof(username_buffer), "{SRUN}\r\n%s", oss.str().c_str());
snprintf(username_buffer, sizeof(username_buffer), "{SRUN3}\r\n%s", oss.str().c_str());
return username_buffer;
}

Expand Down
2 changes: 1 addition & 1 deletion EasyHautX/httpclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ size_t srun3k_logout(const char *url, Payload payload, char **response) {
if (curl && payload) {
curl_easy_setopt(curl, CURLOPT_URL, url);
ParamList params{
make_pair("action", "logout"), make_pair("username", payload->username),
make_pair("action", "logout"), make_pair("username", username_encrypt(payload->username)),
make_pair("type", payload->type), make_pair("ac_id", payload->ac_id),
make_pair("mac", payload->mac),
};
Expand Down

0 comments on commit 731bebe

Please sign in to comment.