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

mbed align with pt changes

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2016-01-20 17:35:18 +08:00
parent e99a83cb96
commit 5086597878
5 changed files with 21 additions and 5 deletions

View 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

View 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

View 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);

View 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

View 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 */