summaryrefslogtreecommitdiff
path: root/lib/server.c
diff options
context:
space:
mode:
authorAndy Green <andy.green@linaro.org>2016-01-29 21:18:54 +0800
committerAndy Green <andy.green@linaro.org>2016-01-29 23:17:43 +0800
commit1b2c9a23e13dd250b193e4302a8d48c5be97d16b (patch)
tree49001ab10e71f2bac21895e3a8694cd633664452 /lib/server.c
parentada3531aff5b44db015b91ab9aa5f642bccc2195 (diff)
downloadlibwebsockets-1b2c9a23e13dd250b193e4302a8d48c5be97d16b.tar.gz
libwebsockets-1b2c9a23e13dd250b193e4302a8d48c5be97d16b.tar.bz2
libwebsockets-1b2c9a23e13dd250b193e4302a8d48c5be97d16b.zip
clean pre 1.7
Signed-off-by: Andy Green <andy.green@linaro.org>
Diffstat (limited to 'lib/server.c')
-rw-r--r--lib/server.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/server.c b/lib/server.c
index ef56cb02..689d477f 100644
--- a/lib/server.c
+++ b/lib/server.c
@@ -31,13 +31,13 @@ int lws_context_init_server(struct lws_context_creation_info *info,
#if LWS_POSIX
struct sockaddr_in serv_addr4;
socklen_t len = sizeof(struct sockaddr);
+ int n, opt = 1, limit = 1;
struct sockaddr_in sin;
struct sockaddr *v;
- int n, opt = 1, limit = 1;
#endif
- int m = 0;
lws_sockfd_type sockfd;
struct lws *wsi;
+ int m = 0;
/* set up our external listening socket we serve on */
@@ -722,6 +722,7 @@ LWS_VISIBLE struct lws *
lws_adopt_socket(struct lws_context *context, lws_sockfd_type accept_fd)
{
struct lws *new_wsi = lws_create_new_server_wsi(context);
+
if (!new_wsi) {
compatible_close(accept_fd);
return NULL;
@@ -773,8 +774,8 @@ LWS_VISIBLE int
lws_server_socket_service(struct lws_context *context, struct lws *wsi,
struct lws_pollfd *pollfd)
{
- lws_sockfd_type accept_fd = LWS_SOCK_INVALID;
struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
+ lws_sockfd_type accept_fd = LWS_SOCK_INVALID;
#if LWS_POSIX
struct sockaddr_in cli_addr;
socklen_t clilen;
@@ -861,8 +862,7 @@ try_pollout:
lws_libev_io(wsi, LWS_EV_STOP | LWS_EV_WRITE);
if (wsi->state != LWSS_HTTP_ISSUING_FILE) {
- n = user_callback_handle_rxflow(
- wsi->protocol->callback,
+ n = user_callback_handle_rxflow(wsi->protocol->callback,
wsi, LWS_CALLBACK_HTTP_WRITEABLE,
wsi->user_space, NULL, 0);
if (n < 0) {
@@ -1082,7 +1082,7 @@ lws_server_get_canonical_hostname(struct lws_context *context,
#if LWS_POSIX
/* find canonical hostname */
gethostname((char *)context->canonical_hostname,
- sizeof(context->canonical_hostname) - 1);
+ sizeof(context->canonical_hostname) - 1);
lwsl_notice(" canonical_hostname = %s\n", context->canonical_hostname);
#else