mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
trac 29 echo remoe mention of syslog constants for win32
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
70d6717afb
commit
86aa80509f
1 changed files with 8 additions and 4 deletions
|
@ -72,7 +72,7 @@ callback_echo(struct libwebsocket_context *context,
|
|||
lwsl_err("ERROR %d writing to socket, hanging up\n", n);
|
||||
return 1;
|
||||
}
|
||||
if (n < pss->len) {
|
||||
if (n < (int)pss->len) {
|
||||
lwsl_err("Partial write\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ callback_echo(struct libwebsocket_context *context,
|
|||
return 1;
|
||||
}
|
||||
memcpy(&pss->buf[LWS_SEND_BUFFER_PRE_PADDING], in, len);
|
||||
pss->len = len;
|
||||
pss->len = (unsigned int)len;
|
||||
libwebsocket_callback_on_writable(context, wsi);
|
||||
break;
|
||||
#endif
|
||||
|
@ -110,7 +110,7 @@ callback_echo(struct libwebsocket_context *context,
|
|||
lwsl_err("ERROR %d writing to socket, hanging up\n", n);
|
||||
return -1;
|
||||
}
|
||||
if (n < pss->len) {
|
||||
if (n < (int)pss->len) {
|
||||
lwsl_err("Partial write\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -168,7 +168,9 @@ int main(int argc, char **argv)
|
|||
int opts = 0;
|
||||
char interface_name[128] = "";
|
||||
const char *interface = NULL;
|
||||
#ifndef WIN32
|
||||
int syslog_options = LOG_PID | LOG_PERROR;
|
||||
#endif
|
||||
int client = 0;
|
||||
int listen_port;
|
||||
struct lws_context_creation_info info;
|
||||
|
@ -205,7 +207,9 @@ int main(int argc, char **argv)
|
|||
#ifndef LWS_NO_DAEMONIZE
|
||||
case 'D':
|
||||
daemonize = 1;
|
||||
#ifndef WIN32
|
||||
syslog_options &= ~LOG_PERROR;
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
#ifndef LWS_NO_CLIENT
|
||||
|
@ -331,7 +335,7 @@ int main(int argc, char **argv)
|
|||
if (client) {
|
||||
gettimeofday(&tv, NULL);
|
||||
|
||||
if (((unsigned int)tv.tv_usec - oldus) > rate_us) {
|
||||
if (((unsigned int)tv.tv_usec - oldus) > (unsigned int)rate_us) {
|
||||
libwebsocket_callback_on_writable_all_protocol(&protocols[0]);
|
||||
oldus = tv.tv_usec;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue