summaryrefslogtreecommitdiff
path: root/libavformat/tcp.c
Commit message (Collapse)AuthorAge
* Merge commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d'Derek Buitenhuis2016-02-29
|\ | | | | | | | | | | | | | | | | | | | | This commit also disables the async fate test, because it used internal APIs in a non-kosher way, which no longer exists. * commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d': lavf: reorganize URLProtocols Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: reorganize URLProtocolsAnton Khirnov2016-02-22
| | | | | | | | | | | | | | | | | | | | Instead of a linked list constructed at av_register_all(), store them in a constant array of pointers. Since no registration is necessary now, this removes some global state from lavf. This will also allow the urlprotocol layer caller to limit the available protocols in a simple and flexible way in the following commits.
* | libavformat/tcp.c : add send_buffer_size and recv_buffer_size optionsPerette Barella2016-01-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adds two new options that may be set via the dictionary: - send_buffer_size - recv_buffer_size When present, setsockopt() is used with SO_SNDBUF and SO_RCVBUF to set socket buffer sizes. I chose to make send and receive independent because buffering requirements are often asymmetric. Errors in setting the buffer size mean the socket will use its default, so they are ignored. There is no sanity checking on values, as the kernel/socket layers already impose reasonable limits if asked for something crazy. Rationale for enlarging receive buffers is to reduce susceptibility to intermittent network delays/congestion. I added setting the send buffer for symmetry. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/tcp: TCP Protocol: fix descriptor leak on listen and interruptAlexander S. Drozdov2015-09-11
| | | | | | | | | | | | | | | | | | | | | | If we try to listen on TCP port and ff_listen() fails on interrupt callback socket (bind) descriptor overwrites and does not closed at all. As a result, we can't rebind to the same port. Reviewed-by: Stephan Holljes <klaxa1337@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/tcp: increase range for listen and call the underlying socket ↵Stephan Holljes2015-08-01
| | | | | | | | | | | | operations accordingly Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
* | lavf/tcp: add tcp_acceptStephan Holljes2015-08-01
| | | | | | | | Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
* | Merge commit '27852f2f1dec3749ea79883b70484c841169f747'Michael Niedermayer2015-04-09
|\| | | | | | | | | | | | | * commit '27852f2f1dec3749ea79883b70484c841169f747': libavformat: Handle error return from ff_listen_bind Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: Handle error return from ff_listen_bindAnders Nystrom2015-04-09
| | | | | | | | | | | | | | Handle error return from ff_listen_bind without leaking file descriptors. Signed-off-by: Anders Nystrom <anders.nystrom@southpole.se> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'e14f98c62fdf8744b07419314095d1b3248cce75'Michael Niedermayer2015-02-28
|\| | | | | | | | | | | | | | | | | | | * commit 'e14f98c62fdf8744b07419314095d1b3248cce75': tcp: Clarify the units for the timeout avoptions Conflicts: libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * tcp: Clarify the units for the timeout avoptionsMartin Storsjö2015-02-28
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavf/tcp: Clarify that the -timeout option takes microseconds.Carl Eugen Hoyos2014-11-12
| |
* | Merge commit '1d4579e38ecad578c86516fad2837a273d11b320'Michael Niedermayer2014-10-11
|\| | | | | | | | | | | | | | | | | | | | | * commit '1d4579e38ecad578c86516fad2837a273d11b320': tcp: Add AVOption support Conflicts: libavformat/tcp.c See: 2e009c6042bde419599ebed9165e597bbef23b2f Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * tcp: Add AVOption supportLuca Barbato2014-10-10
| |
* | Merge commit '6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f'Michael Niedermayer2014-08-25
|\| | | | | | | | | | | | | * commit '6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f': libavformat: use MSG_NOSIGNAL when applicable Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: use MSG_NOSIGNAL when applicableRémi Denis-Courmont2014-08-25
| | | | | | | | | | | | | | If the remote end of a connection oriented socket hangs up, generating an EPIPE error is preferable over an unhandled SIGPIPE signal. Signed-off-by: Martin Storsjö <martin@martin.st>
| * tcp: Explicitly convert a pointer to a boolean integerMartin Storsjö2013-09-09
| | | | | | | | | | | | | | | | | | This fixes warnings about making integers from pointers without a cast, and avoids the theoretical case where the lower 32 bits of the pointer would all be zero where the implicit cast wouldn't give the right result. Signed-off-by: Martin Storsjö <martin@martin.st>
* | doc/protocols/tcp,lavf/tcp: apply minor fixes to TCP protocol documentationStefano Sabatini2013-12-25
| |
* | lavf/tcp: honor listen option value in a tagStefano Sabatini2013-12-25
| | | | | | | | | | Consistent with what is done in udp.c, allow to explicitly disable listen with listen=0.
* | avformat/tcp: fix pointer to int warningMichael Niedermayer2013-08-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'abe5268c3328bf0e8fcfb7dc6e231b8920177c3a'Michael Niedermayer2013-08-06
|\| | | | | | | | | | | | | | | | | | | * commit 'abe5268c3328bf0e8fcfb7dc6e231b8920177c3a': tcp: Use a different log message and level if there's more addresses to try Conflicts: libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * tcp: Use a different log message and level if there's more addresses to tryMartin Storsjö2013-08-06
| | | | | | | | | | | | | | | | | | This lowers the level of warnings printed if trying to connect to a host name that provides both v6 and v4 addresses but the service only is available on the v4 address (often occurring for 'localhost', with servers that aren't v6-aware). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'bb9378251a167ef0116f263912e57f715c1e02ac'Michael Niedermayer2013-08-06
|\| | | | | | | | | | | | | * commit 'bb9378251a167ef0116f263912e57f715c1e02ac': network: Use SOCK_CLOEXEC when available Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * network: Use SOCK_CLOEXEC when availableLuca Barbato2013-08-05
| |
* | tcp: Use a default timeout of 5 sec for opening a connection but not for ↵Michael Niedermayer2013-07-06
| | | | | | | | | | | | | | | | | | receiving packets This should be closer to how tcp behaved longer ago and should fix the issue with idle connections timing out. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | tcp: Fix the default timeoutMichael Niedermayer2013-07-06
| | | | | | | | | | | | Fixes Ticket2694 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '9835abb6d63fb07613994ae90e72fef758149408'Michael Niedermayer2013-06-05
|\| | | | | | | | | | | | | | | | | | | | | * commit '9835abb6d63fb07613994ae90e72fef758149408': network: uniform ff_listen_bind and ff_listen_connect Conflicts: libavformat/network.c libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * network: uniform ff_listen_bind and ff_listen_connectLuca Barbato2013-06-04
| | | | | | | | | | Document the functions and have both use a millisecond timeout and check for interrupt.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-06-02
|\| | | | | | | | | | | | | | | | | | | | | * qatar/master: network: factor out connect-listening code Conflicts: libavformat/network.h libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * network: factor out connect-listening codeLuca Barbato2013-06-01
| | | | | | | | | | Introduce ff_listen_connect, to be shared with the other non-tcp network protocols.
* | Merge commit '28306e6d620c109ddd672f7243adfbc2bbb3b18f'Michael Niedermayer2013-06-02
|\| | | | | | | | | | | | | | | | | | | | | * commit '28306e6d620c109ddd672f7243adfbc2bbb3b18f': network: factor out bind-listening code use my full first name instead of short one in copyrights Conflicts: libavformat/tcp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * network: factor out bind-listening codeLuca Barbato2013-06-01
| | | | | | | | | | Introduce ff_listen_bind, to be shared with the other non-tcp network protocols.
* | avformat/avdevice: add missing time.h includesMichael Niedermayer2013-03-12
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | tcp: accept params through avio_open2() optionsAndrey Utkin2012-10-09
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | tcp: use timeout option consistentlyAndrey Utkin2012-10-09
| | | | | | | | | | | | Default _connection_ timeout value 5 seconds is left as i/o timeout also Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-07-25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rtmp: Add a new option 'rtmp_pageurl' doc: Update the description of the rtmp_tcurl option rtmp: Make the description of the rtmp_tcurl option more generic libfdk-aacenc: add LATM/LOAS encapsulation support sctp: add port missing error message tcp: add port missing error message avfilter: Fix printf format string conversion specifier Conflicts: libavcodec/version.h libavfilter/avfilter.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * tcp: add port missing error messageJordi Ortiz2012-07-25
| | | | | | | | | | | | | | Without this patch a user a bit absent-minded may not notice that the connection doesn't work because the port is missing. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-07-09
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mss3: use standard zigzag table mss3: split DSP functions that are used in MTS2(MSS4) into separate file motion-test: do not use getopt() tcp: add initial timeout limit for incoming connections configure: Change the rdtsc check to a linker check avconv: propagate fatal errors from lavfi. lavfi: add error handling to filter_samples(). fate-run: make avconv() properly deal with multiple inputs. asplit: don't leak the input buffer. af_resample: fix request_frame() behavior. af_asyncts: fix request_frame() behavior. libx264: support aspect ratio switching matroskadec: honor error_recognition when encountering unknown elements. lavr: resampling: add support for s32p, fltp, and dblp internal sample formats lavr: resampling: add filter type and Kaiser window beta to AVOptions lavr: Use AV_SAMPLE_FMT_NONE to auto-select the internal sample format lavr: mix: validate internal sample format in ff_audio_mix_init() Conflicts: ffmpeg.c ffplay.c libavcodec/libx264.c libavfilter/audio.c libavfilter/split.c libavformat/tcp.c tests/fate-run.sh Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * tcp: add initial timeout limit for incoming connectionsJordi Ortiz2012-07-09
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mss1: validate number of changeable palette entries mss1: report palette changed when some additional colours were decoded x86: fft: replace call to memcpy by a loop udp: Support IGMPv3 source specific multicast and source blocking dxva2: include dxva.h if found libm: Provide fallback definitions for isnan() and isinf() tcp: Pass NULL as hostname to getaddrinfo if the string is empty tcp: Set AI_PASSIVE when the socket will be used for listening Conflicts: configure libavcodec/mss1.c libavformat/udp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * tcp: Pass NULL as hostname to getaddrinfo if the string is emptyJordi Ortiz2012-06-27
| | | | | | | | | | | | | | This gives you the proper v4 or v6 version of the "any address", allowing receiving connections on any address on the machine. Signed-off-by: Martin Storsjö <martin@martin.st>
| * tcp: Set AI_PASSIVE when the socket will be used for listeningJordi Ortiz2012-06-27
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: avconv: add an assert to silence an uninitialized variable warning. avconv: shut up an uninitialized variable warning. avfiltergraph: shut up uninitialized variable warning. af_join: initialize a variable to shut up gcc warning. amix: fix format specifier for AVFilterLink.sample_rate. lavfi: make filters less verbose. mpc8: read APE tags. lavr: x86: fix ff_conv_fltp_to_flt_6ch function prototypes libm: provide fallback definition for cbrtf() using powf() network: Don't redefine error codes if they already exist in errno.h configure: Check for sys/time.h network: Include unistd.h from network.h avconv: don't include vsrc_buffer.h, which doesn't exist anymore lavfi: reorder AVFilterLink fields. lavfi: reorder AVFilterContext fields. lavfi: reorder AVFilter fields. lavfi: reorder AVFilterBufferRef fields. lavfi: reorder AVFilterBuffer fields. Conflicts: configure libavcodec/v210dec.h libavfilter/asrc_anullsrc.c libavfilter/avfilter.h libavfilter/buffersrc.c libavfilter/src_movie.c libavfilter/vf_aspect.c libavfilter/vf_crop.c libavfilter/vf_drawbox.c libavfilter/vf_fade.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vsrc_color.c libavformat/network.h libavutil/libm.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * network: Include unistd.h from network.hMartin Storsjö2012-06-26
| | | | | | | | | | | | | | | | | | | | | | This heaader is required for close() for sockets in network code. For winsock, the equivalent function is defined in the winsock2.h header. This avoids having the HAVE_UNISTD_H in all files dealing with raw sockets. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: MS Screen 1 decoder aacdec: Fix popping channel layouts. av_gettime: support Win32 without gettimeofday() Use av_gettime() in various places Move av_gettime() to libavutil dct-test: use emms_c() from libavutil instead of duplicating it mov: fix operator precedence bug mathematics.h: remove a couple of math defines Remove unnecessary inclusions of [sys/]time.h lavf: remove unnecessary inclusions of unistd.h bfin: libswscale: add const where appropriate to fix warnings bfin: libswscale: remove unnecessary #includes udp: Properly check for invalid sockets tcp: Check the return value from getsockopt network: Use av_strerror for getting error messages udp: Properly print error from getnameinfo mmst: Use AVUNERROR() to convert error codes to the right range for strerror network: Pass pointers of the right type to get/setsockopt/ioctlsocket on windows rtmp: Reduce the number of idle posts sent by sleeping 50ms Conflicts: Changelog configure libavcodec/aacdec.c libavcodec/allcodecs.c libavcodec/avcodec.h libavcodec/dct-test.c libavcodec/version.h libavformat/riff.c libavformat/udp.c libavutil/Makefile libswscale/bfin/yuv2rgb_bfin.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove unnecessary inclusions of [sys/]time.hMans Rullgard2012-06-20
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * tcp: Check the return value from getsockoptMartin Storsjö2012-06-19
| | | | | | | | | | | | | | Make sure we actually have an error code in ret, in case getsockopt failed. Signed-off-by: Martin Storsjö <martin@martin.st>
| * network: Use av_strerror for getting error messagesMartin Storsjö2012-06-19
| | | | | | | | | | | | | | Also use ff_neterrno() instead of errno directly (which doesn't work on windows), for getting the error code. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: amr: Cosmetic cleanup mov_chan: Fix operator precedence by adding parentheses doc: Add missing protocols to list of supported protocols. tcp: Check the listen call Conflicts: libavformat/amr.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * tcp: Check the listen callJordi Ortiz2012-06-17
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-01
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: http: Add the url_shutdown function for https, too http: Simplify code by removing a local variable http: Clear the old URLContext pointer when closed tcp: Try enabling SO_REUSEADDR when listening tcp: Check the return values from bind and accept avisynth: Make sure the filename passed to avisynth is in the right code page Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>