#include <time.h>
static int osrfChatXMLErrorOcurred = 0;
-static int osrfChatClientSentDisconnect = 0;
+
+/* This is used by code in osrfChatPushData, but that code is
+ currently commented out. Uncomment the next line if needed. */
+//static int osrfChatClientSentDisconnect = 0;
/* shorter version of strcmp */
static int eq(const char* a, const char* b) { return (a && b && !strcmp(a,b)); }
if(eq(name,"message")) {
/* drop the old message and start with a new one */
- xmlNodePtr root = xmlNewNode(NULL, name);
+ xmlNodePtr root = xmlNewNode(NULL, BAD_CAST name);
xmlAddAttrs(root, atts);
xmlNodePtr oldRoot = xmlDocSetRootElement(node->msgDoc, root);
free(node->to);
} else {
/* all non "message" nodes are simply added to the message */
- xmlNodePtr nodep = xmlNewNode(NULL, name);
+ xmlNodePtr nodep = xmlNewNode(NULL, BAD_CAST name);
xmlAddAttrs(nodep, atts);
xmlAddChild(xmlDocGetRootElement(node->msgDoc), nodep);
}
if( ! ses ) { return; }
- if( strcmp( name, "message" ) == 0 ) {
+ if( strcmp( (char*) name, "message" ) == 0 ) {
ses->state_machine->in_message = 1;
buffer_add( ses->from_buffer, get_xml_attr( atts, "from" ) );
buffer_add( ses->recipient_buffer, get_xml_attr( atts, "to" ) );
if( ses->state_machine->in_message ) {
- if( strcmp( name, "body" ) == 0 ) {
+ if( strcmp( (char*) name, "body" ) == 0 ) {
ses->state_machine->in_message_body = 1;
return;
}
- if( strcmp( name, "subject" ) == 0 ) {
+ if( strcmp( (char*) name, "subject" ) == 0 ) {
ses->state_machine->in_subject = 1;
return;
}
- if( strcmp( name, "thread" ) == 0 ) {
+ if( strcmp( (char*) name, "thread" ) == 0 ) {
ses->state_machine->in_thread = 1;
return;
}
}
- if( strcmp( name, "presence" ) == 0 ) {
+ if( strcmp( (char*) name, "presence" ) == 0 ) {
ses->state_machine->in_presence = 1;
buffer_add( ses->from_buffer, get_xml_attr( atts, "from" ) );
buffer_add( ses->recipient_buffer, get_xml_attr( atts, "to" ) );
return;
}
- if( strcmp( name, "status" ) == 0 ) {
+ if( strcmp( (char*) name, "status" ) == 0 ) {
ses->state_machine->in_status = 1;
return;
}
- if( strcmp( name, "stream:error" ) == 0 ) {
+ if( strcmp( (char*) name, "stream:error" ) == 0 ) {
ses->state_machine->in_error = 1;
ses->state_machine->connected = 0;
osrfLogWarning( OSRF_LOG_MARK, "Received <stream:error> message from Jabber server" );
/* first server response from a connect attempt */
- if( strcmp( name, "stream:stream" ) == 0 ) {
+ if( strcmp( (char*) name, "stream:stream" ) == 0 ) {
if( ses->state_machine->connecting == CONNECTING_1 ) {
ses->state_machine->connecting = CONNECTING_2;
buffer_add( ses->session_id, get_xml_attr(atts, "id") );
}
}
- if( strcmp( name, "handshake" ) == 0 ) {
+ if( strcmp( (char*) name, "handshake" ) == 0 ) {
ses->state_machine->connected = 1;
ses->state_machine->connecting = 0;
return;
}
- if( strcmp( name, "error" ) == 0 ) {
+ if( strcmp( (char*) name, "error" ) == 0 ) {
ses->state_machine->in_message_error = 1;
buffer_add( ses->message_error_type, get_xml_attr( atts, "type" ) );
ses->message_error_code = atoi( get_xml_attr( atts, "code" ) );
return;
}
- if( strcmp( name, "iq" ) == 0 ) {
+ if( strcmp( (char*) name, "iq" ) == 0 ) {
ses->state_machine->in_iq = 1;
if( strcmp( get_xml_attr(atts, "type"), "result") == 0
int i;
if (atts != NULL) {
for(i = 0;(atts[i] != NULL);i++) {
- if( strcmp( atts[i++], attr_name ) == 0 ) {
+ if( strcmp( (char*) atts[i++], attr_name ) == 0 ) {
if( atts[i] != NULL ) {
return (char*) atts[i];
}
transport_session* ses = (transport_session*) session;
if( ! ses ) { return; }
- if( strcmp( name, "message" ) == 0 ) {
+ if( strcmp( (char*) name, "message" ) == 0 ) {
/* pass off the message info the callback */
return;
}
- if( strcmp( name, "body" ) == 0 ) {
+ if( strcmp( (char*) name, "body" ) == 0 ) {
ses->state_machine->in_message_body = 0;
return;
}
- if( strcmp( name, "subject" ) == 0 ) {
+ if( strcmp( (char*) name, "subject" ) == 0 ) {
ses->state_machine->in_subject = 0;
return;
}
- if( strcmp( name, "thread" ) == 0 ) {
+ if( strcmp( (char*) name, "thread" ) == 0 ) {
ses->state_machine->in_thread = 0;
return;
}
- if( strcmp( name, "iq" ) == 0 ) {
+ if( strcmp( (char*) name, "iq" ) == 0 ) {
ses->state_machine->in_iq = 0;
if( ses->message_error_code > 0 ) {
osrfLogWarning( OSRF_LOG_MARK, "Error in IQ packet: code %d", ses->message_error_code );
return;
}
- if( strcmp( name, "presence" ) == 0 ) {
+ if( strcmp( (char*) name, "presence" ) == 0 ) {
ses->state_machine->in_presence = 0;
/*
if( ses->presence_callback ) {
return;
}
- if( strcmp( name, "status" ) == 0 ) {
+ if( strcmp( (char*) name, "status" ) == 0 ) {
ses->state_machine->in_status = 0;
return;
}
- if( strcmp( name, "error" ) == 0 ) {
+ if( strcmp( (char*) name, "error" ) == 0 ) {
ses->state_machine->in_message_error = 0;
return;
}
- if( strcmp( name, "error:error" ) == 0 ) {
+ if( strcmp( (char*) name, "error:error" ) == 0 ) {
ses->state_machine->in_error = 0;
return;
}