summaryrefslogtreecommitdiff
path: root/source/net_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/net_common.c')
-rw-r--r--source/net_common.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/net_common.c b/source/net_common.c
index 3fbd1ec..c522d10 100644
--- a/source/net_common.c
+++ b/source/net_common.c
@@ -410,6 +410,7 @@ NET_GetPacket
Fills msg_read_buffer with packet contents,
net_from variable receives source address.
+Returns NET_ERROR only in case of ICMP error.
=============
*/
neterr_t NET_GetPacket( netsrc_t sock ) {
@@ -500,15 +501,21 @@ neterr_t NET_GetPacket( netsrc_t sock ) {
/*
=============
NET_SendPacket
+
+Returns NET_ERROR only in case of ICMP error.
=============
*/
neterr_t NET_SendPacket( netsrc_t sock, const netadr_t *to, size_t length, const void *data ) {
struct sockaddr_in addr;
int ret;
- if( length < 1 || length > MAX_PACKETLEN ) {
- Com_WPrintf( "%s: bad length: %"PRIz" bytes\n", __func__, length );
- return NET_ERROR;
+ if( !length ) {
+ return NET_AGAIN;
+ }
+
+ if( length > MAX_PACKETLEN ) {
+ Com_WPrintf( "%s: oversize length: %"PRIz" bytes\n", __func__, length );
+ return NET_AGAIN;
}
switch( to->type ) {