Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/liudf0716/xkcp_client
Browse files Browse the repository at this point in the history
  • Loading branch information
Dengfeng Liu committed Apr 25, 2017
2 parents 6035ba0 + e7eb22d commit 285ac03
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 236 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="logo.png" alt="xkcptun" height="54px" />
# <img src="logo-big.png" alt="xkcptun" height="300px" />

[![Build Status][1]][2] [![Powered][3]][4]

Expand Down Expand Up @@ -32,6 +32,9 @@ make

生成xkcp_client和xkcp_server

### OpenWrt
编译及安装请参考 [openwrt-xkcptun](https://github.com/gigibox/openwrt-xkcptun)

### QuickStart

为方便理解和使用,我们将使用场景放在同一台pc上,pc使用ubuntu系统,我们通过xkcptun来访问本机的http server
Expand Down
55 changes: 0 additions & 55 deletions build/openwrt/Makefile

This file was deleted.

57 changes: 0 additions & 57 deletions build/openwrt/files/xkcptun.config

This file was deleted.

123 changes: 0 additions & 123 deletions build/openwrt/files/xkcptun_client.init

This file was deleted.

1 change: 1 addition & 0 deletions contributors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Thank you to all contributors:
------------------------------
[liudengfeng](https://github.com/liudf0716)
[zhangzengfei](https://github.com/gigibox)


Binary file added logo-big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions xkcp_mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct user_spy_cmd client_cmd[] = {

struct user_spy_cmd server_cmd[] = {
{"status", get_server_status},
{"client", get_client_info},
{NULL, NULL}
};

Expand All @@ -72,11 +73,28 @@ static void get_client_status(struct bufferevent *bev, void *ctx)
dump_task_list(ctx, bev);
}

static void get_client_info(struct bufferevent *bev, void *ctx)
{
debug(LOG_DEBUG, "get_client_info ");
jwHashTable *xkcp_hash = ctx;
struct evbuffer *output = bufferevent_get_output(bev);
evbuffer_add_printf(output, "client list:\n");
for(int i = 0; i < xkcp_hash->buckets; i++) {
jwHashEntry *entry = xkcp_hash->bucket[i];
while (entry) {
evbuffer_add_printf(output, "hash_id [%d] connected client [%s] connection [%d] \n",
i, entry->key.strValue, get_task_list_size(entry->key.ptrValue));
entry = entry->next;
}
}
}

static void get_server_status(struct bufferevent *bev, void *ctx)
{
debug(LOG_DEBUG, "get_server_status ");
jwHashTable *xkcp_hash = ctx;
struct evbuffer *output = bufferevent_get_output(bev);
evbuffer_add_printf(output, "client detail list:\n");
for(int i = 0; i < xkcp_hash->buckets; i++) {
jwHashEntry *entry = xkcp_hash->bucket[i];
while (entry) {
Expand Down

0 comments on commit 285ac03

Please sign in to comment.