X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fclient.c;h=9f7576eff20051feb3d96ca36fa53ae8c19799c2;hb=ad3bc56f96b024ac31e8927f21d1f5e7b8f61b56;hp=bdee0c89ac1ff74d6b902b1f162f7274a18da275;hpb=4c431fe65269e9b1d452855b9df8cfe80683b691;p=umurmur.git diff --git a/src/client.c b/src/client.c index bdee0c8..9f7576e 100644 --- a/src/client.c +++ b/src/client.c @@ -91,9 +91,9 @@ int Client_getfds(struct pollfd *pollfds) void Client_janitor() { - struct dlist *itr; + struct dlist *itr, *save; int bwTop = maxBandwidth + maxBandwidth / 4; - list_iterate(itr, &clients) { + list_iterate_safe(itr, save, &clients) { client_t *c; c = list_get_entry(itr, client_t, node); Log_debug("Client %s BW available %d", c->username, c->availableBandwidth); @@ -486,7 +486,10 @@ int Client_read(client_t *client) } else { if (SSLi_get_error(client->ssl, rc) == SSLI_ERROR_SYSCALL) { - Log_info_client(client, "Connection closed by peer"); + Log_info_client(client,"Error: %s - Closing connection", strerror(errno)); + } + else if (SSLi_get_error(client->ssl, rc) == SSLI_ERROR_CONNRESET) { + Log_info_client(client, "Connection reset by peer"); } else { Log_info_client(client, "SSL error: %d - Closing connection", SSLi_get_error(client->ssl, rc)); @@ -541,10 +544,15 @@ int Client_write(client_t *client) return 0; } else { - if (SSLi_get_error(client->ssl, rc) == SSLI_ERROR_SYSCALL) - Log_warn("Client_write: Error: %s - Closing connection", strerror(errno)); - else - Log_warn("Client_write: SSL error: %d - Closing connection.", SSLi_get_error(client->ssl, rc)); + if (SSLi_get_error(client->ssl, rc) == SSLI_ERROR_SYSCALL) { + Log_info_client(client, "Error: %s - Closing connection", strerror(errno)); + } + else if (SSLi_get_error(client->ssl, rc) == SSLI_ERROR_CONNRESET) { + Log_info_client(client, "Connection reset by peer"); + } + else { + Log_info_client(client, "SSL error: %d - Closing connection.", SSLi_get_error(client->ssl, rc)); + } Client_free(client); return -1; } @@ -775,7 +783,7 @@ out: static inline void Client_send_voice(client_t *src, client_t *dst, uint8_t *data, int len, int poslen) { - if (IS_AUTH(dst) && dst != src && !dst->deaf) { + if (IS_AUTH(dst) && dst != src && !dst->deaf && !dst->self_deaf) { if (poslen > 0 && /* Has positional data */ src->context != NULL && dst->context != NULL && /* ...both source and destination has context */ strcmp(src->context, dst->context) == 0) /* ...and the contexts match */ @@ -800,7 +808,7 @@ int Client_voiceMsg(client_t *client, uint8_t *data, int len) channel_t *ch = (channel_t *)client->channel; struct dlist *itr; - if (!client->authenticated || client->mute) + if (!client->authenticated || client->mute || client->self_mute) goto out; packetsize = 20 + 8 + 4 + len;