Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcp: fix tcp_socket_dead() for FreeBSD #1112

Closed
wants to merge 1 commit into from
Closed

tcp: fix tcp_socket_dead() for FreeBSD #1112

wants to merge 1 commit into from

Conversation

nomatter2k
Copy link
Contributor

The FreeBSD port of tvheadend couldn't stream Live TV, and debug
log shows webui judged the peer socket closed immediately after
starting streaming:

2018-04-15 06:30:04.996 [ DEBUG]:webui: Start streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974
2018-04-15 06:30:04.996 [ DEBUG]:webui: Stop streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974, client hung up

It looks because tcp_socket_dead() misunderstood the zero-return
from recv(). For the FreeBSD, recv() might return zero for alive
sockets which have nothing to read.

Patch tested with the latest FreeBSD port of tvheadend-4.2.6.

The FreeBSD port of tvheadend couldn't stream Live TV, and debug
log shows webui judged the peer socket closed immediately after
starting streaming:

2018-04-15 06:30:04.996 [  DEBUG]:webui: Start streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974
2018-04-15 06:30:04.996 [  DEBUG]:webui: Stop streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974, client hung up

It looks because tcp_socket_dead() misunderstood the zero-return
from recv(). For the FreeBSD, recv() might return zero for alive
sockets which have nothing to read.

Patch tested with the latest FreeBSD port of tvheadend-4.2.6.
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Apr 18, 2018
The FreeBSD port of tvheadend couldn't stream Live TV, and debug
log shows webui judged the peer socket closed immediately after
starting streaming:

2018-04-15 06:30:04.996 [  DEBUG]:webui: Start streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974
2018-04-15 06:30:04.996 [  DEBUG]:webui: Stop streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974, client hung up

It looks tcp_socket_dead() misunderstood the zero-return from recv().
For the FreeBSD, recv() might return zero for alive sockets which
have nothing to read.

Submitted by:	Jongsung Kim <jongsung.kim@gmail.com>
Obtained from:	tvheadend/tvheadend#1112


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@467705 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Apr 18, 2018
The FreeBSD port of tvheadend couldn't stream Live TV, and debug
log shows webui judged the peer socket closed immediately after
starting streaming:

2018-04-15 06:30:04.996 [  DEBUG]:webui: Start streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974
2018-04-15 06:30:04.996 [  DEBUG]:webui: Stop streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974, client hung up

It looks tcp_socket_dead() misunderstood the zero-return from recv().
For the FreeBSD, recv() might return zero for alive sockets which
have nothing to read.

Submitted by:	Jongsung Kim <jongsung.kim@gmail.com>
Obtained from:	tvheadend/tvheadend#1112
swills pushed a commit to swills/freebsd-ports that referenced this pull request Apr 18, 2018
The FreeBSD port of tvheadend couldn't stream Live TV, and debug
log shows webui judged the peer socket closed immediately after
starting streaming:

2018-04-15 06:30:04.996 [  DEBUG]:webui: Start streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974
2018-04-15 06:30:04.996 [  DEBUG]:webui: Stop streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974, client hung up

It looks tcp_socket_dead() misunderstood the zero-return from recv().
For the FreeBSD, recv() might return zero for alive sockets which
have nothing to read.

Submitted by:	Jongsung Kim <jongsung.kim@gmail.com>
Obtained from:	tvheadend/tvheadend#1112


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@467705 35697150-7ecd-e111-bb59-0022644237b5
Jehops pushed a commit to Jehops/freebsd-ports-legacy that referenced this pull request Apr 18, 2018
The FreeBSD port of tvheadend couldn't stream Live TV, and debug
log shows webui judged the peer socket closed immediately after
starting streaming:

2018-04-15 06:30:04.996 [  DEBUG]:webui: Start streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974
2018-04-15 06:30:04.996 [  DEBUG]:webui: Stop streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974, client hung up

It looks tcp_socket_dead() misunderstood the zero-return from recv().
For the FreeBSD, recv() might return zero for alive sockets which
have nothing to read.

Submitted by:	Jongsung Kim <jongsung.kim@gmail.com>
Obtained from:	tvheadend/tvheadend#1112


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@467705 35697150-7ecd-e111-bb59-0022644237b5
@perexg
Copy link
Contributor

perexg commented Apr 20, 2018

Merged. Thanks.

@perexg perexg closed this Apr 20, 2018
svmhdvn pushed a commit to svmhdvn/freebsd-ports that referenced this pull request Jan 10, 2024
The FreeBSD port of tvheadend couldn't stream Live TV, and debug
log shows webui judged the peer socket closed immediately after
starting streaming:

2018-04-15 06:30:04.996 [  DEBUG]:webui: Start streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974
2018-04-15 06:30:04.996 [  DEBUG]:webui: Stop streaming /stream/mux/c4bc67bdaa13457e33740ca883cc4d75?ticket=7D1B56AD0E434C5F7EBFA4677A7FBE4C94097974, client hung up

It looks tcp_socket_dead() misunderstood the zero-return from recv().
For the FreeBSD, recv() might return zero for alive sockets which
have nothing to read.

Submitted by:	Jongsung Kim <jongsung.kim@gmail.com>
Obtained from:	tvheadend/tvheadend#1112
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants