diff options
Diffstat (limited to 'linden/indra/newview/lluserauth.cpp')
-rw-r--r-- | linden/indra/newview/lluserauth.cpp | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/linden/indra/newview/lluserauth.cpp b/linden/indra/newview/lluserauth.cpp index 6c8801a..a9b00e1 100644 --- a/linden/indra/newview/lluserauth.cpp +++ b/linden/indra/newview/lluserauth.cpp | |||
@@ -89,12 +89,12 @@ void LLUserAuth::reset() | |||
89 | 89 | ||
90 | 90 | ||
91 | void LLUserAuth::authenticate( | 91 | void LLUserAuth::authenticate( |
92 | const char* auth_uri, | 92 | const std::string& auth_uri, |
93 | const char* method, | 93 | const std::string& method, |
94 | const char* firstname, | 94 | const std::string& firstname, |
95 | const char* lastname, | 95 | const std::string& lastname, |
96 | LLUUID web_login_key, | 96 | LLUUID web_login_key, |
97 | const char* start, | 97 | const std::string& start, |
98 | BOOL skip_optional, | 98 | BOOL skip_optional, |
99 | BOOL accept_tos, | 99 | BOOL accept_tos, |
100 | BOOL accept_critical_message, | 100 | BOOL accept_critical_message, |
@@ -111,22 +111,22 @@ void LLUserAuth::authenticate( | |||
111 | std::copy(requested_options.begin(), requested_options.end(), appender); | 111 | std::copy(requested_options.begin(), requested_options.end(), appender); |
112 | option_str << "END"; | 112 | option_str << "END"; |
113 | 113 | ||
114 | LL_INFOS2("AppInit", "Authentication") << option_str.str().c_str() << LL_ENDL; | 114 | LL_INFOS2("AppInit", "Authentication") << option_str.str() << LL_ENDL; |
115 | 115 | ||
116 | mAuthResponse = E_NO_RESPONSE_YET; | 116 | mAuthResponse = E_NO_RESPONSE_YET; |
117 | //mDownloadTimer.reset(); | 117 | //mDownloadTimer.reset(); |
118 | 118 | ||
119 | // create the request | 119 | // create the request |
120 | XMLRPC_REQUEST request = XMLRPC_RequestNew(); | 120 | XMLRPC_REQUEST request = XMLRPC_RequestNew(); |
121 | XMLRPC_RequestSetMethodName(request, method); | 121 | XMLRPC_RequestSetMethodName(request, method.c_str()); |
122 | XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); | 122 | XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); |
123 | 123 | ||
124 | // stuff the parameters | 124 | // stuff the parameters |
125 | XMLRPC_VALUE params = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); | 125 | XMLRPC_VALUE params = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); |
126 | XMLRPC_VectorAppendString(params, "first", firstname, 0); | 126 | XMLRPC_VectorAppendString(params, "first", firstname.c_str(), 0); |
127 | XMLRPC_VectorAppendString(params, "last", lastname, 0); | 127 | XMLRPC_VectorAppendString(params, "last", lastname.c_str(), 0); |
128 | XMLRPC_VectorAppendString(params, "web_login_key", web_login_key.getString().c_str(), 0); | 128 | XMLRPC_VectorAppendString(params, "web_login_key", web_login_key.getString().c_str(), 0); |
129 | XMLRPC_VectorAppendString(params, "start", start, 0); | 129 | XMLRPC_VectorAppendString(params, "start", start.c_str(), 0); |
130 | XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name | 130 | XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name |
131 | XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); | 131 | XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); |
132 | XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); | 132 | XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); |
@@ -173,12 +173,12 @@ void LLUserAuth::authenticate( | |||
173 | 173 | ||
174 | // passwd is already MD5 hashed by the time we get to it. | 174 | // passwd is already MD5 hashed by the time we get to it. |
175 | void LLUserAuth::authenticate( | 175 | void LLUserAuth::authenticate( |
176 | const char* auth_uri, | 176 | const std::string& auth_uri, |
177 | const char* method, | 177 | const std::string& method, |
178 | const char* firstname, | 178 | const std::string& firstname, |
179 | const char* lastname, | 179 | const std::string& lastname, |
180 | const char* passwd, | 180 | const std::string& passwd, |
181 | const char* start, | 181 | const std::string& start, |
182 | BOOL skip_optional, | 182 | BOOL skip_optional, |
183 | BOOL accept_tos, | 183 | BOOL accept_tos, |
184 | BOOL accept_critical_message, | 184 | BOOL accept_critical_message, |
@@ -204,15 +204,15 @@ void LLUserAuth::authenticate( | |||
204 | 204 | ||
205 | // create the request | 205 | // create the request |
206 | XMLRPC_REQUEST request = XMLRPC_RequestNew(); | 206 | XMLRPC_REQUEST request = XMLRPC_RequestNew(); |
207 | XMLRPC_RequestSetMethodName(request, method); | 207 | XMLRPC_RequestSetMethodName(request, method.c_str()); |
208 | XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); | 208 | XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); |
209 | 209 | ||
210 | // stuff the parameters | 210 | // stuff the parameters |
211 | XMLRPC_VALUE params = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); | 211 | XMLRPC_VALUE params = XMLRPC_CreateVector(NULL, xmlrpc_vector_struct); |
212 | XMLRPC_VectorAppendString(params, "first", firstname, 0); | 212 | XMLRPC_VectorAppendString(params, "first", firstname.c_str(), 0); |
213 | XMLRPC_VectorAppendString(params, "last", lastname, 0); | 213 | XMLRPC_VectorAppendString(params, "last", lastname.c_str(), 0); |
214 | XMLRPC_VectorAppendString(params, "passwd", dpasswd.c_str(), 0); | 214 | XMLRPC_VectorAppendString(params, "passwd", dpasswd.c_str(), 0); |
215 | XMLRPC_VectorAppendString(params, "start", start, 0); | 215 | XMLRPC_VectorAppendString(params, "start", start.c_str(), 0); |
216 | XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name | 216 | XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name |
217 | XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); | 217 | XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); |
218 | XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); | 218 | XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); |
@@ -379,9 +379,7 @@ LLUserAuth::UserAuthcode LLUserAuth::parseResponse() | |||
379 | } | 379 | } |
380 | else if(xmlrpc_type_int == type) | 380 | else if(xmlrpc_type_int == type) |
381 | { | 381 | { |
382 | char buf[MAX_STRING]; /* Flawfinder: ignore */ | 382 | val = llformat( "%d", XMLRPC_GetValueInt(current)); |
383 | snprintf(buf, MAX_STRING, "%d", XMLRPC_GetValueInt(current)); /* Flawfinder: ignore */ | ||
384 | val.assign(buf); | ||
385 | lldebugs << "val: " << val << llendl; | 383 | lldebugs << "val: " << val << llendl; |
386 | mResponses.insert(response_t::value_type(key, val)); | 384 | mResponses.insert(response_t::value_type(key, val)); |
387 | } | 385 | } |
@@ -407,22 +405,18 @@ LLUserAuth::UserAuthcode LLUserAuth::parseResponse() | |||
407 | return rv; | 405 | return rv; |
408 | } | 406 | } |
409 | 407 | ||
410 | const char* LLUserAuth::getResponse(const char* name) const | 408 | const std::string& LLUserAuth::getResponse(const std::string& key) const |
411 | { | 409 | { |
412 | if(!name) return NULL; | ||
413 | std::string key(name); | ||
414 | response_t::const_iterator it = mResponses.find(key); | 410 | response_t::const_iterator it = mResponses.find(key); |
415 | if(it != mResponses.end()) | 411 | if(it != mResponses.end()) |
416 | { | 412 | { |
417 | return((*it).second.c_str()); | 413 | return((*it).second); |
418 | } | 414 | } |
419 | return NULL; | 415 | return LLStringUtil::null; |
420 | } | 416 | } |
421 | 417 | ||
422 | BOOL LLUserAuth::getOptions(const char* name, options_t& options) const | 418 | BOOL LLUserAuth::getOptions(const std::string& key, options_t& options) const |
423 | { | 419 | { |
424 | if(!name) return FALSE; | ||
425 | std::string key(name); | ||
426 | all_options_t::const_iterator it = mOptions.find(key); | 420 | all_options_t::const_iterator it = mOptions.find(key); |
427 | if(it != mOptions.end()) | 421 | if(it != mOptions.end()) |
428 | { | 422 | { |