Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1584253
 поиск   регистрация   авторизация 
 
Группа :: Система/Серверы
Пакет: ejabberd-jit

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: jabber-jit-1.1.6-g++3.3.patch


--- jit-1.1.6/jit/jit/wp_client.cpp.orig-g++	2003-12-31 12:14:45 +0300
+++ jit-1.1.6/jit/jit/wp_client.cpp	2003-12-31 12:19:57 +0300
@@ -145,24 +145,30 @@
   it_session_confirmed(sesja);    
 }
 
+static void fill_terror(terror& e, int code, const char* reason) {
+  e.code = code;
+  strncpy(e.msg, reason, sizeof(e.msg) / sizeof(char));
+}
+
 void WPclient::SignalDisconnected(DisconnectedEvent *ev) {
-  terror e = (terror){0,""};
-  
+  terror e;
+  fill_terror(e,0,"");
+
   switch(ev->getReason()){
   case DisconnectedEvent::FAILED_BADUSERNAME:
-    e = (terror){400,"Bad username"};
+    fill_terror(e,400,"Bad username");
     break;
 
   case DisconnectedEvent::FAILED_TURBOING:
-    e = (terror){503,"Turboing, connect later"};
+    fill_terror(e,503,"Turboing, connect later");
     break;
 
   case DisconnectedEvent::FAILED_BADPASSWORD:
-    e = (terror){400,"Bad (non mismatched) registration password"};
+    fill_terror(e,400,"Bad (non mismatched) registration password");
     break;
 
   case DisconnectedEvent::FAILED_MISMATCH_PASSWD:
-    e = (terror){401,"Password does not match"};
+    fill_terror(e,401,"Password does not match");
     break;
 
   case DisconnectedEvent::FAILED_DUALLOGIN: {
@@ -177,16 +183,16 @@
     xmlnode_put_attrib(msg,"from",jid_full(sesja->from));
     it_deliver(sesja->ti,msg);
 
-    e = (terror){409,"Dual login"};
+    fill_terror(e,409,"Dual login");
     break;
   }
 
   case DisconnectedEvent::FAILED_LOWLEVEL:
-    e = (terror){502,"Low level network error"};
+    fill_terror(e,502,"Low level network error");
     break;
 
   case DisconnectedEvent::FAILED_UNKNOWN:
-    e = (terror){502,"Disconnected by unknown reason"};
+    fill_terror(e,502,"Disconnected by unknown reason");
     break;
 
   case DisconnectedEvent::REQUESTED:
 
design & coding: Vladimir Lettiev aka crux © 2004-2005