Commit graph

32 commits

Author SHA1 Message Date
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
Renamed from tcp.c (Browse further)