From: Andy Green Date: Wed, 20 Jan 2016 09:35:18 +0000 (+0800) Subject: mbed align with pt changes X-Git-Tag: upstream/1.7.3~100 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5086597878900ffcb09adcbc1087feb97168e992;p=platform%2Fupstream%2Flibwebsockets.git mbed align with pt changes Signed-off-by: Andy Green --- diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 2e1ac8a..fad9ab3 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1223,6 +1223,14 @@ lws_extension_callback_pm_deflate(struct lws_context *context, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len) { + (void)context; + (void)ext; + (void)wsi; + (void)reason; + (void)user; + (void)in; + (void)len; + return 0; } #endif diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 2ac5f9e..3598260 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -35,8 +35,9 @@ namespace { } using namespace mbed::Sockets::v0; + +struct sockaddr_in; struct lws; -struct lws_context; class lws_conn { public: @@ -95,6 +96,7 @@ extern "C" { #endif #ifdef MBED_OPERATORS +struct sockaddr_in; #define LWS_POSIX 0 #else #define LWS_POSIX 1 diff --git a/lib/lws-plat-mbed3.c b/lib/lws-plat-mbed3.c index c8607be..90ea3dd 100644 --- a/lib/lws-plat-mbed3.c +++ b/lib/lws-plat-mbed3.c @@ -87,6 +87,12 @@ lws_cancel_service(struct lws_context *context) (void)context; } +LWS_VISIBLE void +lws_cancel_service_pt(struct lws *wsi) +{ + (void)wsi; +} + LWS_VISIBLE void lwsl_emit_syslog(int level, const char *line) { printf("%d: %s", level, line); diff --git a/lib/lws-plat-mbed3.cpp b/lib/lws-plat-mbed3.cpp index 0162fdc..8581695 100644 --- a/lib/lws-plat-mbed3.cpp +++ b/lib/lws-plat-mbed3.cpp @@ -230,7 +230,7 @@ lws_plat_insert_socket_into_fds(struct lws_context *context, { (void)wsi; lws_libev_io(wsi, LWS_EV_START | LWS_EV_READ); - context->fds[context->fds_count++].revents = 0; + context->pt[0].fds[context->pt[0].fds_count++].revents = 0; } extern "C" LWS_VISIBLE void diff --git a/lib/service.c b/lib/service.c index e17a525..098170b 100644 --- a/lib/service.c +++ b/lib/service.c @@ -376,7 +376,7 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t int idx = 0; #endif struct lws_context_per_thread *pt = &context->pt[tsi]; - lws_sockfd_type our_fd = 0; + lws_sockfd_type our_fd = 0, tmp_fd; struct lws_tokens eff_buf; unsigned int pending = 0; struct lws *wsi, *wsi1; @@ -413,10 +413,10 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t while (wsi) { /* we have to take copies, because he may be deleted */ wsi1 = wsi->timeout_list; - m = wsi->sock; + tmp_fd = wsi->sock; if (lws_service_timeout_check(wsi, (unsigned int)now)) { /* he did time out... */ - if (m == our_fd) + if (tmp_fd == our_fd) /* it was the guy we came to service! */ timed_out = 1; /* he's gone, no need to mark as handled */