avformat/tls_gnutls: fix build error on linux #21435
No reviewers
Labels
No labels
avcodec
avdevice
avfilter
avformat
avutil
CLI
doc
swresample
swscale
vulkan
API
API major
bug
duplicate
enhancement
fix/bug
fix/regression
help wanted
important
invalid
LGTM
meta
needs backport
needs docs
needs fate test
needs sample
needs testing
new
question
regression
security
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
FFmpeg/FFmpeg!21435
Loadingâ¦
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "JackLau/FFmpeg:fix_gnutls"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The fd_set need <sys/select.h> on linux, but it's
not included in os_support.h, it's included in os_support.c
So this patch use poll() to replace select() to avoid
this issue and simplify the code.
Signed-off-by: Jack Lau [email protected]
@ -175,3 +175,2 @@fd_set rfds;struct timeval tv;int sockfd = ffurl_get_file_handle(s->udp);struct pollfd pfd = { .fd = sockfd, .events = POLLIN, .revents = 0};Small nit, missing space before the final }
Fixed
af9f2b5aa0d888a156cfI'm not set up at all to test gnutls.
Code looks good by eye, but someone who actuall can build and runtime test it should have a closer look.
fd_setshould never be used since it can trigger buffer overflows (or then you need to checkfd < FD_SETSIZE).(Point being that it should be removed elsewhere if applicable. No objections to this patch, obviously.)
I can confirm that this patch fixes the previous build error on Linux. How could I runtime test it?
@Courmisch wrote in #21435 (comment):
Thanks for the detailed guidance!
@luiscastro193 wrote in #21435 (comment):
you could test tls refer to https://ffmpeg.org/ffmpeg-protocols.html#toc-tls to make sure tls wasn't effect by these patches.
If you want to test dtls, you should add this patch (enable gnutls dtls and avoid build error because there're some function don't implement yet):
Then you could test dtls refer to https://ffmpeg.org/ffmpeg-protocols.html#toc-dtls
Maybe you should use command as below (there're more patches waiting to merged to support full dtls support):
Okey so, after applying both patches, for tls I did:
And it worked fine. For dtls I tried your commands and
test.tswas produced fine as well.For what it's worth, this PR seems to fix #21444.