added an event entity to lang.dtd
update auth code to return the auth failed event when necessary
updated srfsh to handle the auth event
added a oils_constants file for listing events the C code will use
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@598
9efc2488-bf62-4759-914b-
345cdb29e865
# --- 5 tries to connect to the jabber server
my $socket;
for(1..5) {
- $logger->transport( "$jid: Attempting to connect to server...$host:$port (Try # $_)", WARN );
$socket = $sock_type->new( PeerHost => $host,
PeerPort => $port,
Peer => $port,
Proto => 'tcp' );
- $logger->transport( "$jid: $_ connect attempt to $host:$port", WARN );
+ $logger->debug( "$jid: $_ connect attempt to $host:$port");
last if ( $socket and $socket->connected );
+ $logger->warn( "$jid: Failed to connect to server...$host:$port (Try # $_)");
sleep 3;
}
parse_request( buf2 );
- char* x = jsonObjectGetString(last_result->_result_content);
- if(x) login_session = strdup(x);
+ jsonObject* x = last_result->_result_content;
+ if(x) {
+ char* authtoken = jsonObjectGetString(jsonObjectGetKey(x, "authtoken"));
+ if(authtoken) login_session = strdup(authtoken);
+ else login_session = NULL;
+ }
else login_session = NULL;
printf("Login Session: %s\n", login_session );