X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fclient.c;h=2ad53ba983273dbee7256d925a9b210829cb7826;hb=ddc0e8af6bbcb1f7635ea78297c5158611821aec;hp=367f18dee165e383f892b9c4ae3f2e979a8a4759;hpb=877434b8b0295725e2a4f8fffd139ee0985da8a3;p=umurmur.git diff --git a/src/client.c b/src/client.c index 367f18d..2ad53ba 100644 --- a/src/client.c +++ b/src/client.c @@ -1,5 +1,5 @@ -/* Copyright (C) 2009-2010, Martin Johansson - Copyright (C) 2005-2010, Thorvald Natvig +/* Copyright (C) 2009-2011, Martin Johansson + Copyright (C) 2005-2011, Thorvald Natvig All rights reserved. @@ -211,8 +211,8 @@ void recheckCodecVersions() iCodecBeta = version; sendmsg = Msg_create(CodecVersion); - sendmsg->payload.codecVersion->alpha = version; - sendmsg->payload.codecVersion->beta = version; + sendmsg->payload.codecVersion->alpha = iCodecAlpha; + sendmsg->payload.codecVersion->beta = iCodecBeta; sendmsg->payload.codecVersion->prefer_alpha = bPreferAlpha; Client_send_message_except(NULL, sendmsg); @@ -354,10 +354,10 @@ int Client_read_fd(int fd) break; } } - if (client == NULL) - Log_fatal("No client found for fd %d", fd); - - return Client_read(client); + if (client != NULL) + return Client_read(client); + else + return -1; } int Client_read(client_t *client) @@ -457,10 +457,10 @@ int Client_write_fd(int fd) break; } } - if (client == NULL) - Log_fatal("No client found for fd %d", fd); - Client_write(client); - return 0; + if (client != NULL) + return Client_write(client); + else + return -1; } int Client_write(client_t *client) @@ -690,7 +690,6 @@ int Client_read_udp() memcpy(&itr->remote_udp, &from, sizeof(struct sockaddr_in)); break; } - else Log_warn("Bad cryptstate from peer"); } } /* while */ }