Jaroslav Kysela
d4611d147c
tcp: coverity don't close(-1)
2014-10-03 15:44:43 +02:00
Jaroslav Kysela
60aa4e2658
tcp: connect - fix another memory leak (coverity)
2014-10-03 14:51:24 +02:00
Jaroslav Kysela
a7e6993c13
tcp: fix memory leak in error path in tcp_server_create() (coverity)
2014-10-03 14:40:00 +02:00
Jaroslav Kysela
710119a707
tcp: don't crash when tcp server cannot be registered, fixes #2315
2014-09-20 21:07:49 +02:00
Jaroslav Kysela
1eddf45a8a
capmt: do properly the reconnection, fix another mutex bug - fixes #2227
2014-08-14 15:48:26 +02:00
Jaroslav Kysela
0addaf1389
tcp: bind http and htsp ports before setting uid / gid - fixes#2190
2014-08-13 15:09:38 +02:00
Jaroslav Kysela
46b261f687
tcp: break the tcp_read_timeout() loop at shutdown
2014-08-08 18:55:47 +02:00
Jaroslav Kysela
37d7156f6c
tvhthread_create() - remove detach argument
2014-07-07 17:18:37 +02:00
Jaroslav Kysela
0b4bcfaa98
add ERRNO_AGAIN() macro to check the interrupted / no data states correctly
2014-07-07 16:40:46 +02:00
Jaroslav Kysela
db59cf12a5
capmt: recode - use polling and write queue
2014-06-10 14:02:35 +02:00
Jaroslav Kysela
a4300bee58
tcp: break the timeout loop early when tvheadend is in the shutdown phase
2014-06-02 08:13:12 +02:00
Jaroslav Kysela
d9d9531d86
tcp: rewrite connection timeout using tvhpoll wrapper
2014-06-01 22:33:56 +02:00
Adam Sutton
236ebc93cc
tcp: don't free on error (it won't be assigned)
2014-05-22 22:52:35 +01:00
Jaroslav Kysela
de306a0827
SAT>IP: allow to specify the local bind IP address
2014-05-22 16:02:53 +02:00
Damjan Marion
02642ce851
tcp: use getaddrinfo() for hostname resolution
...
gethostbyname_r() is GNU extension not supported on some platforms.
This commit replaces it with POSIX standard getaddrinfo() call.
2014-05-22 13:02:45 +02:00
Jaroslav Kysela
a3ad55f64c
Add build-in http client
...
- supports SSL
- supports location redirections
- supports chunked data transfers
- supports HTTP/1.0 HTTP/1.1 and RTSP/1.0
2014-05-05 22:00:35 +02:00
Jaroslav Kysela
76461dd5c1
Prevent SIGSEGV when bind to the TCP socket fails
2014-05-05 22:00:35 +02:00
Adam Sutton
5fbe7a7eb7
tcp: minor correction to avoid GCC warnings about type aliasing
2014-04-30 22:32:35 +01:00
Jaroslav Kysela
34cf1530ad
Wait also for the active TCP threads on shutdown
2014-03-24 14:39:54 +01:00
Jaroslav Kysela
da387b48fe
Fix the missing thread join calls for tcp servers
...
This is a "hidden" memory leak, because the allocated stack pages are
not freed.
2014-03-23 12:10:52 +01:00
Jaroslav Kysela
9e092a91bc
Fixes for graceful exit patch
...
Mostly avahi related and cosmetic fixes for the graceful exit patch.
2014-03-05 15:03:50 +01:00
Jaroslav Kysela
c07824a410
Graceful exit
...
It's necessary to do serious checks for the memory leaks using
tools like valgrind. This patch tries to implement a graceful
exit for all tvheadend components and free allocated memory.
Also, some memory leaks were fixed.
2014-02-17 13:13:14 +01:00
Adam Sutton
c0c2a39fd6
tcp: correct typo in debug message
2014-01-11 00:27:00 +00:00
Adam Sutton
f75037aee7
http htsp: fix status handling. Race condition caused NULL ptr exception. Fixes #1898 .
2013-12-30 09:19:14 +00:00
Adam Sutton
6137958b79
http: make line processing dynamic
...
This overcomes issues caused by long lines, as experienced when enabling
cookies for extjs grid state.
2013-11-25 09:42:50 +00:00
Adam Sutton
05efbc402f
status: remove HTTP status info for now
...
This breaks if, like me, you're using a proxy (or browser) which doesn't
support persitent connections, since you just get a constant reloading
of the UI! Will have to re-think, since ultimately what I really want is
to know user auth's within the UI, so possibly that will be easier when
we do away with HTTP Basic Auth, but also probably require restructuring
of this code.
2013-11-11 17:41:05 +00:00
Adam Sutton
73c6bc9f48
status: some additional status information about connections
...
also re-jigged UI layout (I'm sure people will moan) and some code
re-layout too.
2013-11-11 17:11:41 +00:00
Adam Sutton
1b22e08ab9
status: collect (and post) status of all TCP connections
...
This will indiscrimately include all HTSP and HTTP connections, first pass
I was going to just dump the lot on a UI status tab. However it could be
some filtering might be useful.
2013-11-11 09:52:29 +00:00
Adam Sutton
8901334cc0
misc: Remove memory leaks and other anomalies
...
Many of these are somewhat redundant now, as I've suppressed many of the
warnings as they're false positives. However the changes, such as added
a detach flag to tvhthread_create(), have been kept anyway.
2013-10-11 13:41:46 +01:00
Adam Sutton
2b909fe580
debug: add wrapper for pthread_create to add a meaningful name
...
This is very useful for debugging. Though tbh I need to do this code
properly.
2013-09-05 22:19:25 +01:00
Benny Morgan
6fc536e014
- Fix - exchange char* portBuf = malloc(6) to char* port_buf[6] - no need for malloc here
2013-06-30 21:50:58 +02:00
Bernhard Froehlich
0afd2ae15f
Add missing includes for FreeBSD.
...
src/tcp.c:38: error: 'AF_INET' undeclared here (not in a function)
src/tcp.c:99: error: 'SOCK_STREAM' undeclared (first use in this function)
src/tcp.c:121: error: 'AF_INET6' undeclared (first use in this function)
src/tcp.c:159: error: 'SOL_SOCKET' undeclared (first use in this function)
src/tcp.c:159: error: 'SO_ERROR' undeclared (first use in this function)
2013-06-02 12:03:26 +02:00
Bernhard Froehlich
17b16d7a76
tvhpoll: update all code to use new tvhpoll wrapper rather than epoll
2013-05-31 14:22:29 +01:00
Adam Sutton
290dcb8643
Merge remote-tracking branch 'origin/pr/247'
...
Conflicts:
man/tvheadend.1
2013-02-21 15:52:06 +00:00
Archie L. Cobbs
a3fdc6f120
Allow binding address to be specified via --bindaddr flag.
2013-02-16 16:01:34 -06:00
BtbN
3b758e5ce7
Add commandline option to switch on IPv6 support
2013-01-15 16:33:21 +01:00
BtbN
b08a3c40d7
Make http server IPv6 ready
2013-01-15 03:05:21 +01:00
BtbN
abd5487cc7
Make tcp code use sockaddr_storage instead of sockaddr_in
2013-01-15 02:41:16 +01:00
BtbN
294b8d92c2
Make tcp_server_create IPv6 aware
2013-01-15 02:18:13 +01:00
Kristofer Karlsson
bb4ac298dd
Reduce code duplication
2012-12-31 21:40:32 +01:00
Adam Sutton
051e404da5
[PR-194] - tidy up code, create a generic write wrapper to simplify code.
...
Fix #1177
2012-12-30 12:17:34 +00:00
Joakim Plate
f980a3abe3
tcp: socket writes get interrupted so must be retried
2012-12-29 20:37:30 +01:00
Adam Sutton
b2b15cb60a
Add write timeout of 30s to all TCP server operations, this is further reduced to 5s for streaming output. Fixes #1054 .
2012-08-30 16:45:43 +01:00
Andreas Öman
2f47066f6e
Correctly deal with return value from write()
2011-04-01 15:32:07 +02:00
Andreas Öman
42adea653d
Rename tvhead.h -> tvheadend.h
2010-11-29 19:25:24 +00:00
Andreas Öman
197b460079
Get rid of SOL_TCP
2010-02-16 19:51:44 +00:00
Andreas Öman
6846e3a21d
Don't really need O_CLOEXEC, instead rely on mutexes and fcntl() instead
...
Also add wrapper call for setting FD_CLOEXEC on sockets
2009-12-03 19:44:26 +00:00
Andreas Öman
ab3ce01643
tcp server: keep track of the local (ie. our) IP + port
2009-11-18 22:24:06 +00:00
Andreas Öman
c9d0527711
Make sure various functions return something. Silences warnings on gcc 4.4
...
Patch by lukas at double dot net
2009-05-30 18:49:40 +00:00
Andreas Öman
42c8947724
Making tvheadend more standalone, #2
2009-03-25 17:46:54 +00:00