1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

clean more whitespace

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2015-12-05 21:51:47 +08:00
parent f012c4423c
commit e53f2ed5e6
2 changed files with 18 additions and 14 deletions

View file

@ -726,8 +726,8 @@ int lws_server_socket_service(struct lws_context *context,
if (pollfd->revents & LWS_POLLIN) {
len = lws_ssl_capable_read(context, wsi,
context->service_buffer,
sizeof(context->service_buffer));
context->service_buffer,
sizeof(context->service_buffer));
lwsl_debug("%s: read %d\r\n", __func__, len);
switch (len) {
case 0:
@ -750,7 +750,7 @@ int lws_server_socket_service(struct lws_context *context,
/* hm this may want to send (via HTTP callback for example) */
n = lws_read(context, wsi,
context->service_buffer, len);
context->service_buffer, len);
if (n < 0)
/* we closed wsi */
return 0;
@ -858,9 +858,9 @@ try_pollout:
* set properties of the newly created wsi. There's no protocol
* selected yet so we issue this to protocols[0]
*/
(context->protocols[0].callback)(context, new_wsi,
LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED, NULL, NULL, 0);
LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED,
NULL, NULL, 0);
lws_libev_accept(context, new_wsi, accept_fd);
@ -878,15 +878,15 @@ try_pollout:
break;
}
if (lws_server_socket_service_ssl(context, &wsi, new_wsi,
accept_fd, pollfd))
if (lws_server_socket_service_ssl(context, &wsi, new_wsi, accept_fd,
pollfd))
goto fail;
return 0;
fail:
lws_close_and_free_session(context, wsi,
LWS_CLOSE_STATUS_NOSTATUS);
lws_close_and_free_session(context, wsi, LWS_CLOSE_STATUS_NOSTATUS);
return 1;
}

View file

@ -540,8 +540,9 @@ lws_service_fd(struct lws_context *context, struct lws_pollfd *pollfd)
read:
eff_buf.token_len = lws_ssl_capable_read(context, wsi,
context->service_buffer,
pending?pending:sizeof(context->service_buffer));
context->service_buffer,
pending ? pending :
sizeof(context->service_buffer));
switch (eff_buf.token_len) {
case 0:
lwsl_info("service_fd: closing due to 0 length read\n");
@ -633,9 +634,12 @@ handle_pending:
close_and_handled:
lwsl_debug("Close and handled\n");
lws_close_and_free_session(context, wsi,
LWS_CLOSE_STATUS_NOSTATUS);
// pollfd points to something else after the close
lws_close_and_free_session(context, wsi, LWS_CLOSE_STATUS_NOSTATUS);
/*
* pollfd may point to something else after the close
* due to pollfd swapping scheme on delete on some platforms
* we can't clear revents now because it'd be the wrong guy's revents
*/
return 1;
handled: