mbed align with pt changes
authorAndy Green <andy.green@linaro.org>
Wed, 20 Jan 2016 09:35:18 +0000 (17:35 +0800)
committerAndy Green <andy.green@linaro.org>
Wed, 20 Jan 2016 09:35:18 +0000 (17:35 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/libwebsockets.c
lib/libwebsockets.h
lib/lws-plat-mbed3.c
lib/lws-plat-mbed3.cpp
lib/service.c

index 2e1ac8a..fad9ab3 100644 (file)
@@ -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
index 2ac5f9e..3598260 100644 (file)
@@ -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
index c8607be..90ea3dd 100644 (file)
@@ -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);
index 0162fdc..8581695 100644 (file)
@@ -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
index e17a525..098170b 100644 (file)
@@ -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 */