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);
}
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));
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;
}