Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2004 Pekka Riikonen
+ Copyright (C) 1997 - 2005 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
ret = silc_packet_send(sock, FALSE);
if (ret != -2) {
if (ret == -1) {
+ SILC_SET_CONNECTION_FOR_INPUT(server->schedule, sock->sock);
+ SILC_UNSET_OUTBUF_PENDING(sock);
+ silc_buffer_clear(sock->outbuf);
+
SILC_LOG_ERROR(("Error sending packet to connection "
"%s:%d [%s]", sock->hostname, sock->port,
(sock->type == SILC_SOCKET_TYPE_UNKNOWN ? "Unknown" :
if (sock->outbuf && sock->outbuf->len > 0) {
/* Couldn't send all data, put the queue back up, we'll send
rest later. */
+ SILC_LOG_DEBUG(("Could not purge immediately, sending rest later"));
SILC_SET_CONNECTION_FOR_OUTPUT(server->schedule, sock->sock);
SILC_SET_OUTBUF_PENDING(sock);
return;
}
+ } else if (ret == -1) {
+ SILC_LOG_ERROR(("Error purging packet queue, packets dropped"));
}
/* Purged all data */
- SILC_UNSET_OUTBUF_PENDING(sock);
SILC_SET_CONNECTION_FOR_INPUT(server->schedule, sock->sock);
+ SILC_UNSET_OUTBUF_PENDING(sock);
silc_buffer_clear(sock->outbuf);
}
}
void *id; /* ID */
SilcIdType id_type; /* ID type */
unsigned int index : 15; /* Index to IDs */
- unsigned int type : 2; /* 0 = take from query->ids, 0 = take
+ unsigned int type : 2; /* 0 = take from query->ids, 1 = take
from args, 2 = no args in error. */
unsigned int error : 7; /* The actual error (SilcStatus) */
} *SilcServerQueryError;
}
}
- if (!sent_reply)
+ if (!sent_reply) {
SILC_LOG_ERROR(("BUG: Query did not send anything"));
+ SILC_LOG_ERROR(("BUG: Sending %d clients", clients_count));
+ SILC_LOG_ERROR(("BUG: Sending %d servers", servers_count));
+ SILC_LOG_ERROR(("BUG: Sending %d channels", channels_count));
+ SILC_LOG_ERROR(("BUG: Sending %d errors", query->errors_count));
+ }
/* Cleanup */
silc_server_query_free(query);
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2003 Pekka Riikonen
+ Copyright (C) 1997 - 2005 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
ret = silc_socket_write(sock);
if (ret == -1) {
- SILC_LOG_ERROR(("Error sending packet, dropped: %s",
- strerror(errno)));
+ SILC_LOG_ERROR(("Error sending packet to %s:%d [%s], dropped: %s",
+ sock->hostname ? sock->hostname : "", sock->port,
+ (sock->type == SILC_SOCKET_TYPE_UNKNOWN ? "Unknown" :
+ sock->type == SILC_SOCKET_TYPE_CLIENT ? "Client" :
+ sock->type == SILC_SOCKET_TYPE_SERVER ? "Server" :
+ "Router"), strerror(errno)));
}
if (ret != -2)
return ret;
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2003 Pekka Riikonen
+ Copyright (C) 1997 - 2005 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
SilcBuffer src = sock->outbuf;
if (!src)
- return -2;
+ return -1;
if (SILC_IS_DISABLED(sock))
return -1;