remove uncessary memcpy

This commit is contained in:
Max Lv
2013-04-17 15:14:49 +08:00
parent 9a2fda8005
commit ab58addc58
8 changed files with 124 additions and 100 deletions
+23 -21
View File
@@ -9,48 +9,50 @@
#include "asyncns.h"
struct listen_ctx {
ev_io io;
int fd;
ev_io io;
int fd;
int timeout;
asyncns_t *asyncns;
struct sockaddr sock;
struct sockaddr sock;
};
struct server_ctx {
ev_io io;
ev_io io;
ev_timer watcher;
int connected;
struct server *server;
int connected;
struct server *server;
};
struct server {
int fd;
char buf[BUF_SIZE]; // server send from, remote recv into
int fd;
char buf[BUF_SIZE]; // server send from, remote recv into
char stage;
int buf_len;
int buf_len;
int buf_idx;
struct rc4_state *e_ctx;
struct rc4_state *d_ctx;
struct server_ctx *recv_ctx;
struct server_ctx *send_ctx;
struct server_ctx *recv_ctx;
struct server_ctx *send_ctx;
struct listen_ctx *listen_ctx;
asyncns_query_t *query;
struct remote *remote;
struct remote *remote;
};
struct remote_ctx {
ev_io io;
ev_io io;
ev_timer watcher;
int connected;
struct remote *remote;
int connected;
struct remote *remote;
};
struct remote {
int fd;
char buf[BUF_SIZE]; // remote send from, server recv into
int buf_len;
struct remote_ctx *recv_ctx;
struct remote_ctx *send_ctx;
struct server *server;
int fd;
char buf[BUF_SIZE]; // remote send from, server recv into
int buf_len;
int buf_idx;
struct remote_ctx *recv_ctx;
struct remote_ctx *send_ctx;
struct server *server;
};