summaryrefslogtreecommitdiff
path: root/test-server
diff options
context:
space:
mode:
authorAndy Green <andy.green@linaro.org>2012-04-09 15:09:01 +0800
committerAndy Green <andy.green@linaro.org>2012-04-09 15:24:22 +0800
commit6ee372fcd815c7f452ec1ac53e404520a5af4920 (patch)
tree3fec2c3fe22b16fc4154188cd549caf1285ebaf2 /test-server
parent7b5af9af15c496a32921974c538c4f0ca90ffda4 (diff)
style cleaning
Signed-off-by: Andy Green <andy.green@linaro.org>
Diffstat (limited to 'test-server')
-rw-r--r--test-server/test-client.c18
-rw-r--r--test-server/test-fraggle.c10
-rw-r--r--test-server/test-server.c18
3 files changed, 26 insertions, 20 deletions
diff --git a/test-server/test-client.c b/test-server/test-client.c
index 3fecd47..9d1d9ef 100644
--- a/test-server/test-client.c
+++ b/test-server/test-client.c
@@ -59,7 +59,7 @@ enum demo_protocols {
/* dumb_increment protocol */
static int
-callback_dumb_increment(struct libwebsocket_context * this,
+callback_dumb_increment(struct libwebsocket_context *this,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason,
void *user, void *in, size_t len)
@@ -102,7 +102,7 @@ callback_dumb_increment(struct libwebsocket_context * this,
static int
-callback_lws_mirror(struct libwebsocket_context * this,
+callback_lws_mirror(struct libwebsocket_context *this,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason,
void *user, void *in, size_t len)
@@ -291,18 +291,22 @@ int main(int argc, char **argv)
/* create a client websocket using mirror protocol */
- wsi_mirror = libwebsocket_client_connect(context, address, port,
- use_ssl, "/", argv[optind], argv[optind],
- protocols[PROTOCOL_LWS_MIRROR].name, ietf_version);
+ wsi_mirror = libwebsocket_client_connect(context,
+ address, port, use_ssl, "/",
+ argv[optind], argv[optind],
+ protocols[PROTOCOL_LWS_MIRROR].name,
+ ietf_version);
if (wsi_mirror == NULL) {
- fprintf(stderr, "libwebsocket dumb connect failed\n");
+ fprintf(stderr, "libwebsocket "
+ "dumb connect failed\n");
return -1;
}
mirror_lifetime = 10 + (random() & 1023);
- fprintf(stderr, "opened mirror connection with %d lifetime\n", mirror_lifetime);
+ fprintf(stderr, "opened mirror connection with "
+ "%d lifetime\n", mirror_lifetime);
} else {
diff --git a/test-server/test-fraggle.c b/test-server/test-fraggle.c
index cdb4f56..873bee3 100644
--- a/test-server/test-fraggle.c
+++ b/test-server/test-fraggle.c
@@ -56,7 +56,7 @@ struct per_session_data__fraggle {
};
static int
-callback_fraggle(struct libwebsocket_context * context,
+callback_fraggle(struct libwebsocket_context *context,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason,
void *user, void *in, size_t len)
@@ -179,7 +179,7 @@ callback_fraggle(struct libwebsocket_context * context,
bp[1] = psf->sum >> 16;
bp[2] = psf->sum >> 8;
bp[3] = psf->sum;
-
+
n = libwebsocket_write(wsi, (unsigned char *)bp,
4, LWS_WRITE_BINARY);
@@ -231,8 +231,8 @@ static struct option options[] = {
{ "port", required_argument, NULL, 'p' },
{ "ssl", no_argument, NULL, 's' },
{ "killmask", no_argument, NULL, 'k' },
- { "interface", required_argument, NULL, 'i' },
- { "client", no_argument, NULL, 'c' },
+ { "interface", required_argument, NULL, 'i' },
+ { "client", no_argument, NULL, 'c' },
{ NULL, 0, 0, 0 }
};
@@ -248,7 +248,7 @@ int main(int argc, char **argv)
struct libwebsocket_context *context;
int opts = 0;
char interface_name[128] = "";
- const char * interface = NULL;
+ const char *interface = NULL;
struct libwebsocket *wsi;
const char *address;
int server_port = port;
diff --git a/test-server/test-server.c b/test-server/test-server.c
index c1cfab8..f054b16 100644
--- a/test-server/test-server.c
+++ b/test-server/test-server.c
@@ -61,7 +61,7 @@ enum demo_protocols {
/* this protocol server (always the first one) just knows how to do HTTP */
-static int callback_http(struct libwebsocket_context * context,
+static int callback_http(struct libwebsocket_context *context,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason, void *user,
void *in, size_t len)
@@ -150,7 +150,7 @@ dump_handshake_info(struct lws_tokens *lwst)
/*[WSI_TOKEN_HTTP] =*/ "Http",
/*[WSI_TOKEN_MUXURL] =*/ "MuxURL",
};
-
+
for (n = 0; n < WSI_TOKEN_COUNT; n++) {
if (lwst[n].token == NULL)
continue;
@@ -174,7 +174,7 @@ struct per_session_data__dumb_increment {
};
static int
-callback_dumb_increment(struct libwebsocket_context * context,
+callback_dumb_increment(struct libwebsocket_context *context,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason,
void *user, void *in, size_t len)
@@ -188,7 +188,8 @@ callback_dumb_increment(struct libwebsocket_context * context,
switch (reason) {
case LWS_CALLBACK_ESTABLISHED:
- fprintf(stderr, "callback_dumb_increment: LWS_CALLBACK_ESTABLISHED\n");
+ fprintf(stderr, "callback_dumb_increment: "
+ "LWS_CALLBACK_ESTABLISHED\n");
pss->number = 0;
break;
@@ -257,7 +258,7 @@ static int ringbuffer_head;
static int
-callback_lws_mirror(struct libwebsocket_context * context,
+callback_lws_mirror(struct libwebsocket_context *context,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason,
void *user, void *in, size_t len)
@@ -268,7 +269,8 @@ callback_lws_mirror(struct libwebsocket_context * context,
switch (reason) {
case LWS_CALLBACK_ESTABLISHED:
- fprintf(stderr, "callback_lws_mirror: LWS_CALLBACK_ESTABLISHED\n");
+ fprintf(stderr, "callback_lws_mirror: "
+ "LWS_CALLBACK_ESTABLISHED\n");
pss->ringbuffer_tail = ringbuffer_head;
pss->wsi = wsi;
break;
@@ -380,7 +382,7 @@ static struct option options[] = {
{ "port", required_argument, NULL, 'p' },
{ "ssl", no_argument, NULL, 's' },
{ "killmask", no_argument, NULL, 'k' },
- { "interface", required_argument, NULL, 'i' },
+ { "interface", required_argument, NULL, 'i' },
{ "closetest", no_argument, NULL, 'c' },
{ NULL, 0, 0, 0 }
};
@@ -399,7 +401,7 @@ int main(int argc, char **argv)
struct libwebsocket_context *context;
int opts = 0;
char interface_name[128] = "";
- const char * interface = NULL;
+ const char *interface = NULL;
#ifdef LWS_NO_FORK
unsigned int oldus = 0;
#endif