The most common form of XMPP error messages are "bounced" messages, i.e.
those where the recipient is not available. Instead of passing these
useless and confusing messages down to a drone for processing, log the
error in the listener and drop the message.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
continue;
}
+ if (cur_msg->error_type) {
+ osrfLogInfo(OSRF_LOG_MARK,
+ "Listener received an XMPP error message. "
+ "Likely a bounced message. sender=%s", cur_msg->sender);
+ if(child_dead)
+ reap_children(forker);
+ continue;
+ }
+
message_prepare_xml( cur_msg );
const char* msg_data = cur_msg->msg_xml;
if( ! msg_data || ! *msg_data ) {
if($msg) {
- if(my $child = pop(@{$self->{idle_list}})) {
+ if ($msg->type and $msg->type eq 'error') {
+ $logger->info("server: Listener received an XMPP error ".
+ "message. Likely a bounced message. sender=".$msg->from);
+
+ } elsif(my $child = pop(@{$self->{idle_list}})) {
# we have an idle child to handle the request
$chatty and $logger->internal("server: passing request to idle child $child");