Skip to content

Commit

Permalink
Bump version, minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ruti committed Jul 18, 2024
1 parent 4d965eb commit c023a8d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
8 changes: 6 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define close(fd) closesocket(fd)
#endif

#define VERSION "11"
#define VERSION "11.1"

char oob_char[1] = "a";
char ip_option[1] = "\0";
Expand Down Expand Up @@ -243,7 +243,7 @@ struct mphdr *parse_hosts(char *buffer, size_t size)
char *e = buffer, *s = buffer;

for (; e <= end; e++) {
if (*e != ' ' && *e != '\n' && *e != '\r' && e != end) {
if (e != end && *e != ' ' && *e != '\n' && *e != '\r') {
continue;
}
if (s == e) {
Expand Down Expand Up @@ -373,6 +373,10 @@ void clear_params(void)
free(s.file_ptr);
s.file_ptr = 0;
}
if (s.hosts != 0) {
mem_destroy(s.hosts);
s.hosts = 0;
}
}
free(params.dp);
params.dp = 0;
Expand Down
15 changes: 8 additions & 7 deletions proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,12 @@ int create_conn(struct poolhd *pool,
pair->in6 = dst->in6;
pair->flag = FLAG_CONN;
val->type = EV_IGNORE;

if (params.debug) {
INIT_ADDR_STR((*dst));
LOG(LOG_S, "new conn: fd=%d, addr=%s:%d\n",
val->pair->fd, ADDR_STR, ntohs(dst->in.sin_port));
}
return 0;
}

Expand Down Expand Up @@ -505,7 +511,7 @@ static inline int on_accept(struct poolhd *pool, struct eval *val)
uniperror("accept");
return -1;
}
LOG(LOG_L, "accept: fd=%d\n", c);
LOG(LOG_S, "accept: fd=%d\n", c);
#ifndef __linux__
#ifdef _WIN32
unsigned long mode = 1;
Expand Down Expand Up @@ -757,11 +763,6 @@ static inline int on_request(struct poolhd *pool, struct eval *val,
LOG(LOG_S, "ss error: %d\n", en);
return -1;
}
if (params.debug) {
INIT_ADDR_STR(dst);
LOG(LOG_L, "new conn: fd=%d, addr=%s:%d\n",
val->pair->fd, ADDR_STR, ntohs(dst.in.sin_port));
}
return 0;
}

Expand Down Expand Up @@ -796,7 +797,7 @@ static inline int on_connect(struct poolhd *pool, struct eval *val, int e)

void close_conn(struct poolhd *pool, struct eval *val)
{
LOG(LOG_L, "close: fds=%d,%d\n", val->fd, val->pair ? val->pair->fd : -1);
LOG(LOG_S, "close: fds=%d,%d\n", val->fd, val->pair ? val->pair->fd : -1);
del_event(pool, val);
}

Expand Down

0 comments on commit c023a8d

Please sign in to comment.