Opened 8 months ago

Last modified 8 months ago

#9142 new defect

LIBSRT uses wrong write-readiness epoll on a listener socket

Reported by: Mikołaj Małecki Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: libsrt
Cc: Marton Balint Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

The epoll subscription for a listener socket uses the same method as for other modes, by waiting for write readiness. This works only due to a bug in LIBSRT, which will be fixed at some point. The event that should be checked ready on a listener socket should be the read-readiness, SRT_EPOLL_IN.

This is where the epoll is being created:

`
ret = write_eid = libsrt_epoll_create(h, fd, 1);
`

Then it is used in both branches for a listener socket and connected socket. For connecting (and rendezvous) socket it's ok, write-readiness defines connection-ready. For a listener socket it should use read-readiness, so creation of eid for the listener branch should be likely done separately, with "0" last parameter.

Attachments (1)

srt-epoll.patch (2.0 KB ) - added by Marton Balint 8 months ago.

Download all attachments as: .zip

Change History (3)

by Marton Balint, 8 months ago

Attachment: srt-epoll.patch added

comment:1 by Marton Balint, 8 months ago

Cc: Marton Balint added

I have added a patch to the ticket which fixes this, compile tested only, can you check if it works for various modes?

comment:2 by Carl Eugen Hoyos, 8 months ago

Component: undeterminedavformat
Keywords: libsrt added
Version: unspecifiedgit-master
Note: See TracTickets for help on using tickets.