OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/jingle_messages.h" | 5 #include "remoting/protocol/jingle_messages.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
10 #include "remoting/protocol/content_description.h" | 10 #include "remoting/protocol/content_description.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 child != NULL; child = child->NextElement()) { | 344 child != NULL; child = child->NextElement()) { |
345 iq->AddElement(new buzz::XmlElement(*child)); | 345 iq->AddElement(new buzz::XmlElement(*child)); |
346 } | 346 } |
347 | 347 |
348 buzz::XmlElement* error = | 348 buzz::XmlElement* error = |
349 new buzz::XmlElement(QName(kJabberNamespace, "error")); | 349 new buzz::XmlElement(QName(kJabberNamespace, "error")); |
350 iq->AddElement(error); | 350 iq->AddElement(error); |
351 | 351 |
352 std::string type; | 352 std::string type; |
353 std::string error_text; | 353 std::string error_text; |
354 QName name; | 354 QName name(""); |
355 switch (error_type) { | 355 switch (error_type) { |
356 case BAD_REQUEST: | 356 case BAD_REQUEST: |
357 type = "modify"; | 357 type = "modify"; |
358 name = QName(kJabberNamespace, "bad-request"); | 358 name = QName(kJabberNamespace, "bad-request"); |
359 break; | 359 break; |
360 case NOT_IMPLEMENTED: | 360 case NOT_IMPLEMENTED: |
361 type = "cancel"; | 361 type = "cancel"; |
362 name = QName(kJabberNamespace, "feature-bad-request"); | 362 name = QName(kJabberNamespace, "feature-bad-request"); |
363 break; | 363 break; |
364 case INVALID_SID: | 364 case INVALID_SID: |
(...skipping 30 matching lines...) Expand all Loading... |
395 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); | 395 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); |
396 text_elem->SetBodyText(error_text); | 396 text_elem->SetBodyText(error_text); |
397 error->AddElement(text_elem); | 397 error->AddElement(text_elem); |
398 } | 398 } |
399 | 399 |
400 return iq; | 400 return iq; |
401 } | 401 } |
402 | 402 |
403 } // namespace protocol | 403 } // namespace protocol |
404 } // namespace remoting | 404 } // namespace remoting |
OLD | NEW |