Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible incorrect int to pointer conversion or incorrect libwebsock_context definition #36

Open
kmmertes opened this issue Jan 18, 2017 · 0 comments

Comments

@kmmertes
Copy link

libwebsock_context is defined as:
typedef struct _libwebsock_context { int running; int ssl_init; int flags; int owns_base; ev_uintptr_t *socketfd; struct event_base *base; int (*onmessage)(libwebsock_client_state *, libwebsock_message *); int (*control_callback)(libwebsock_client_state *, libwebsock_frame *); int (*onopen)(libwebsock_client_state *); int (*onclose)(libwebsock_client_state *); int (*onpong)(libwebsock_client_state *); int (*onframetoolarge)(libwebsock_client_state *, libwebsock_frame *); libwebsock_client_state *clients_HEAD; void *user_data; unsigned int max_frame_payload_size; } libwebsock_context;

However, on line 202 in api.c we have :
ctx->socketfd = sockfd; // Set the socketfd on the context so user can thread the context

which generates a compiler warning:
api.c:202:19: warning: assignment makes pointer from integer without a cast [enabled by default]

Shouldn't ctx->socketfd be defined as evutil_socket_t socketfd
rather than ev_uintptr_t *socketfd?

This is the only place where ctx-socketfd is use AFAIK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant