summaryrefslogtreecommitdiff
path: root/libavformat/tcp.c
Commit message (Collapse)AuthorAge
* 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>
* 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>
* network: Use SOCK_CLOEXEC when availableLuca Barbato2013-08-05
|
* 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.
* network: factor out connect-listening codeLuca Barbato2013-06-01
| | | | | Introduce ff_listen_connect, to be shared with the other non-tcp network protocols.
* network: factor out bind-listening codeLuca Barbato2013-06-01
| | | | | Introduce ff_listen_bind, to be shared with the other non-tcp network protocols.
* 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>
* tcp: add initial timeout limit for incoming connectionsJordi Ortiz2012-07-09
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* 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>
* 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>
* 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>
* tcp: Check the listen callJordi Ortiz2012-06-17
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* tcp: Try enabling SO_REUSEADDR when listeningMartin Storsjö2012-06-01
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* tcp: Check the return values from bind and acceptMartin Storsjö2012-06-01
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* tcp: Allow signalling end of reading/writingSamuel Pitoiset2012-05-22
| | | | | | | tcp_shutdown() isn't needed at the moment, but is added for consistency to explain how the function is supposed to be used. Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace memset(0) by zero initializations.Diego Biurrun2012-03-28
| | | | Also remove one pointless zero initialization in rangecoder.c.
* avio: Add an URLProtocol flag for indicating that a protocol uses networkMartin Storsjö2012-01-05
| | | | | | | This definition is in two files, since the definitions will move to the private header at the next bump. Signed-off-by: Martin Storsjö <martin@martin.st>
* proto: Use .priv_data_size to allocate the private contextMartin Storsjö2011-12-01
| | | | | | | | This simplifies the open functions by avoiding one function call that needs error checking, reducing the amount of extra bulk code. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat: Use ff_check_interruptMartin Storsjö2011-11-13
|
* tcp: make connect() timeout properlyLuca Barbato2011-05-27
| | | | | The connect() timeout can take minutes, gets misreported as EIO and isn't interruptible.
* libavformat: Make protocols pass URLContext as log context where availableMartin Storsjö2011-04-20
| | | | | | | Since the libavformat major bump, URLContext contains an AVClass, making it a usable log context. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: use designated initializers for all protocolsAnton Khirnov2011-04-08
| | | | | This is more readable and makes it easier to reorder URLProtocol members.
* avio: move extern url_interrupt_cb declaration from avio.h to url.hAnton Khirnov2011-04-07
|
* avio: AVIO_ prefixes for URL_ open flags.Anton Khirnov2011-04-07
|
* proto: introduce listen option in tcpLuca Barbato2011-04-07
| | | | | | This way is possible to have simple micro-server act like ffmpeg -i file.nut -vcodec copy -acodec copy -f nut tcp://foo:1234?listen
* proto: factor ff_network_wait_fd and use it on udpLuca Barbato2011-04-07
| | | | | | | | Support the URL_FLAG_NONBLOCK semantic and uniform the protocol. The quick retry loop is already part of retry_transfer_wrapper. The polling routine is common to the network protocols: udp, tcp and, once merged, sctp.
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Use AVERROR_EXIT with url_interrupt_cb.Nicolas George2011-03-15
| | | | | | | | | | | | | Functions interrupted by url_interrupt_cb should not be restarted. Therefore using AVERROR(EINTR) was wrong, as it did not allow to distinguish when the underlying system call was interrupted and actually needed to be restarted. This fixes roundup issues 2657 and 2659 (ffplay not exiting for streamed content). Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* libavformat: Remove FF_NETERRNO()Martin Storsjö2011-02-23
| | | | | | | | | | | | | | Map EAGAIN and EINTR from ff_neterrno to the normal AVERROR() error codes. Provide fallback definitions of other errno.h network errors, mapping them to the corresponding winsock errors. This eases catching these error codes in common code, without having to distinguish between FF_NETERRNO(EAGAIN) and AVERROR(EAGAIN). This fixes roundup issue 2614, unbreaking blocking network IO on windows. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Non-blocking protocol: TCPNicolas George2011-02-05
| | | | | Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* TCP: factor the poll() callNicolas George2011-02-03
| | | | | Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* os: replace select with pollLuca Barbato2011-01-28
| | | | | Select has limitations on the fd values it could accept and silently breaks when it is reached.
* Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.Diego Elio Pettenò2011-01-26
| | | | | This also lists the objects from those two libraries as internal (by adding the ff_ prefix) so that they can then be hidden via linker scripts.
* tcp: Check url_interrupt_cb if connect was interrupted by a signalThomas Guillem2010-12-14
| | | | | | | | This makes it possible to abort a blocking connect call. Patch by Thomas Guillem, thomas dot guillem at gmail Originally committed as revision 26014 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove two instances of AVERROR(ff_neterrno()), because ff_neterrno() itselfRonald S. Bultje2010-11-04
| | | | | | already does AVERROR(). Originally committed as revision 25671 to svn://svn.ffmpeg.org/ffmpeg/trunk
* tcp: Check both wfds and efds when waiting for the result from connectMartin Storsjö2010-09-21
| | | | | | | | On windows, a connection failure doesn't trigger wfds as it does on unix. This fixes issue 2237, based on code by yeyingxian. Originally committed as revision 25154 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Print error messages in case of connection failure or name resolution failureRonald S. Bultje2010-08-14
| | | | | | in tcp.c. Originally committed as revision 24796 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make ff_url_split() publicMåns Rullgård2010-06-27
| | | | | | | ff_url_split() is retained as an alias, as it was used by ffserver, to avoid breaking ABI compatibility with it. Originally committed as revision 23822 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Declare the url_write buffer parameter as constMartin Storsjö2010-06-01
| | | | Originally committed as revision 23401 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Don't report EINTR from select as an error, retry select insteadMartin Storsjö2010-03-26
| | | | Originally committed as revision 22694 to svn://svn.ffmpeg.org/ffmpeg/trunk
* move ff_url_split() and ff_url_join() declarations to internal.hAurelien Jacobs2010-03-14
| | | | | | those functions are not part of the public API Originally committed as revision 22534 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Rename url_split to ff_url_splitMartin Storsjö2010-03-08
| | | | | | Since this function isn't in the public API, it should have an ff_ prefix. Originally committed as revision 22321 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Don't explicitly initialize networking in the tcp and udp protocolsMartin Storsjö2010-03-05
| | | | | | Networking is always initialized when opening protocols. Originally committed as revision 22227 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix BSD compile (PF_UNSPEC is not a standard define, AF_UNSPEC is).Ronald S. Bultje2010-01-27
| | | | Originally committed as revision 21490 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use getaddrinfo() instead of resolve_host(). Patch by Martin StorsjöMartin Storsjö2010-01-11
| | | | | | <$firstname()$firstname,st>. Originally committed as revision 21147 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use ff_neterrno instead of errno in tcp.c.Martin Storsjö2009-07-15
| | | | | | | | | | If ff_neterrno() is checked instead of errno, that's probably what should be used in the return value. As a sideeffect, this gives better compatibility with Windows (CE), where network errors aren't visible in errno.) patch by Martin Storsjö, martin martin st Originally committed as revision 19433 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add url_get_file_handle(), which is used to get the file descriptorRonald S. Bultje2009-03-03
| | | | | | | | | | | associated with the I/O handle (e.g. the fd returned by open()). See "[RFC] rtsp.c EOF support" thread. There were previously some URI-specific implementations of the same idea, e.g. rtp_get_file_handles() and udp_get_file_handle(). All of these are deprecated by this patch and will be removed at the next major API bump. Originally committed as revision 17779 to svn://svn.ffmpeg.org/ffmpeg/trunk