From 192381aa8941890318dc507d4c38c47abf4855a7 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Fri, 20 May 2011 12:31:31 +0000
Subject: [PATCH] - Made listen backlog number a define
---
include/polarssl/net.h | 2 ++
library/net.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/polarssl/net.h b/include/polarssl/net.h
index ee231803e..725babef6 100644
--- a/include/polarssl/net.h
+++ b/include/polarssl/net.h
@@ -41,6 +41,8 @@
#define POLARSSL_ERR_NET_WANT_READ -0x0052 /**< Connection requires a read call. */
#define POLARSSL_ERR_NET_WANT_WRITE -0x0054 /**< Connection requires a write call. */
+#define POLARSSL_NET_LISTEN_BACKLOG 10 /**< The backlog that listen() should use. */
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/library/net.c b/library/net.c
index ad2b2787b..e1d91e4c7 100644
--- a/library/net.c
+++ b/library/net.c
@@ -189,7 +189,7 @@ int net_bind( int *fd, const char *bind_ip, int port )
return( POLARSSL_ERR_NET_BIND_FAILED );
}
- if( listen( *fd, 10 ) != 0 )
+ if( listen( *fd, POLARSSL_NET_LISTEN_BACKLOG ) != 0 )
{
close( *fd );
return( POLARSSL_ERR_NET_LISTEN_FAILED );