Compare commits

..

No commits in common. "d8ed9785664748f1fda67d0d39ef9d7d5b37e4b8" and "814a92ea799c5a2cef6a56eedc9bd8fac2955c3e" have entirely different histories.

13 changed files with 7 additions and 24 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -226,8 +226,8 @@ systems. In this case run `dvtws` as `/opt/zapret/nfq/dvtws`. Or just copy
present. It's possible to renew lists. present. It's possible to renew lists.
If you dont like poverty of default repos its possible to enable FreeBSD repo. If you dont like poverty of default repos its possible to enable FreeBSD repo.
Change `no` to `yes` in `/usr/local/etc/pkg/repos/FreeBSD.conf` and `/usr/local/etc/pkg/repos/pfSense.conf`. Change `no` to `yes` in `/usr/local/etc/pkg/repos/FreeBSD.conf`. Then it
Then it becomes possible to install all the required software including git to download becomes possible to install all the required software including git to download
zapret from github directly. zapret from github directly.

View File

@ -260,15 +260,11 @@ static bool conn_has_unsent_pair(tproxy_conn_t *conn)
return conn_has_unsent(conn) || (conn_partner_alive(conn) && conn_has_unsent(conn->partner)); return conn_has_unsent(conn) || (conn_partner_alive(conn) && conn_has_unsent(conn->partner));
} }
static bool conn_shutdown(tproxy_conn_t *conn) static void conn_shutdown(tproxy_conn_t *conn)
{ {
conn->bShutdown = true;
if (shutdown(conn->fd,SHUT_WR)<0) if (shutdown(conn->fd,SHUT_WR)<0)
{
DLOG_PERROR("shutdown"); DLOG_PERROR("shutdown");
return false; conn->bShutdown = true;
}
return true;
} }
static ssize_t send_or_buffer(send_buffer_t *sb, int fd, const void *buf, size_t len, int flags, int ttl) static ssize_t send_or_buffer(send_buffer_t *sb, int fd, const void *buf, size_t len, int flags, int ttl)
@ -765,11 +761,7 @@ static bool handle_unsent(tproxy_conn_t *conn)
if (!conn->bShutdown) if (!conn->bShutdown)
{ {
DBGPRINT("fd=%d no more has unsent. partner in RDHUP state. executing delayed shutdown.\n", conn->fd); DBGPRINT("fd=%d no more has unsent. partner in RDHUP state. executing delayed shutdown.\n", conn->fd);
if (!conn_shutdown(conn)) conn_shutdown(conn);
{
DBGPRINT("emergency connection close due to failed shutdown\n");
return false;
}
} }
if (conn->state==CONN_RDHUP && !conn_has_unsent(conn->partner)) if (conn->state==CONN_RDHUP && !conn_has_unsent(conn->partner))
{ {
@ -1614,11 +1606,7 @@ int event_loop(const int *listen_fd, size_t listen_fd_ct)
else else
{ {
DBGPRINT("partner has no unsent. shutting down partner.\n"); DBGPRINT("partner has no unsent. shutting down partner.\n");
if (!conn_shutdown(conn->partner)) conn_shutdown(conn->partner);
{
DBGPRINT("emergency connection close due to failed shutdown\n");
conn_close_with_partner_check(&conn_list,&close_list,conn);
}
if (conn->partner->state==CONN_RDHUP) if (conn->partner->state==CONN_RDHUP)
{ {
DBGPRINT("both partners are in RDHUP state and have no unsent. closing.\n"); DBGPRINT("both partners are in RDHUP state and have no unsent. closing.\n");
@ -1656,12 +1644,7 @@ int event_loop(const int *listen_fd, size_t listen_fd_ct)
if ((conn->state == CONN_RDHUP) && conn_partner_alive(conn) && !conn->partner->bShutdown && !conn_has_unsent(conn)) if ((conn->state == CONN_RDHUP) && conn_partner_alive(conn) && !conn->partner->bShutdown && !conn_has_unsent(conn))
{ {
DBGPRINT("conn fd=%d has no unsent. shutting down partner.\n", conn->fd); DBGPRINT("conn fd=%d has no unsent. shutting down partner.\n", conn->fd);
if (!conn_shutdown(conn->partner)) conn_shutdown(conn->partner);
{
DBGPRINT("emergency connection close due to failed shutdown\n");
conn_close_with_partner_check(&conn_list,&close_list,conn);
continue;
}
} }
} }