comparison mcabber/libjabber/jconn.c @ 176:99a99a160113

[/trunk] Changeset 188 by mikael * Add logging when select() fails. * Remove a useless variable in original code.
author mikael
date Thu, 05 May 2005 08:52:40 +0000
parents dabf8c3b475c
children bd5638c21834
comparison
equal deleted inserted replaced
175:7b7dd6d69f58 176:99a99a160113
17 * Copyright (C) 1998-1999 The Jabber Team http://jabber.org/ 17 * Copyright (C) 1998-1999 The Jabber Team http://jabber.org/
18 */ 18 */
19 19
20 #include "jabber.h" 20 #include "jabber.h"
21 #include "connwrap.h" 21 #include "connwrap.h"
22
23 #include "../src/utils.h"
22 24
23 /* local macros for launching event handlers */ 25 /* local macros for launching event handlers */
24 #define STATE_EVT(arg) if(j->on_state) { (j->on_state)(j, (arg) ); } 26 #define STATE_EVT(arg) if(j->on_state) { (j->on_state)(j, (arg) ); }
25 27
26 /* prototypes of the local functions */ 28 /* prototypes of the local functions */
366 368
367 } else if(r) { 369 } else if(r) {
368 /* Don't disconnect for interrupted system call */ 370 /* Don't disconnect for interrupted system call */
369 if(errno == EINTR) return; 371 if(errno == EINTR) return;
370 372
373 ut_WriteLog("jab_poll: select returned errno=%d\n", errno);
371 STATE_EVT(JCONN_STATE_OFF); 374 STATE_EVT(JCONN_STATE_OFF);
372 jab_stop(j); 375 jab_stop(j);
373 376
374 } 377 }
375 } 378 }
436 * id of the iq packet 439 * id of the iq packet
437 */ 440 */
438 char *jab_reg(jconn j) 441 char *jab_reg(jconn j)
439 { 442 {
440 xmlnode x,y,z; 443 xmlnode x,y,z;
441 char *hash, *user, *id; 444 char *user, *id;
442 445
443 if (!j) return(NULL); 446 if (!j) return(NULL);
444 447
445 x = jutil_iqnew(JPACKET__SET, NS_REGISTER); 448 x = jutil_iqnew(JPACKET__SET, NS_REGISTER);
446 id = jab_getid(j); 449 id = jab_getid(j);