aboutsummaryrefslogtreecommitdiffstats
path: root/src/listen.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* include config.h in all sourcesMax Kellermann2009-11-121-1/+1
| | | | | | After we've been hit by Large File Support problems several times in the past week (which only occur on 32 bit platforms, which I don't have), this is yet another attempt to fix the issue.
* configure.ac: require GLib 2.12Max Kellermann2009-11-101-0/+1
| | | | | | Drop the required GLib version from 2.16 to 2.12, because many current systems still don't have GLib 2.16. This requires several new compatibility functions in glib_compat.h.
* fd_util: added O_NONBLOCK functionsMax Kellermann2009-11-081-4/+2
| | | | | Changed the wrappers for pipe(), socket(), accept(). On WIN32, this does not work for pipe().
* set the close-on-exec flag on all file descriptorsMax Kellermann2009-11-071-2/+3
| | | | | | | | | | | Added the "fd_util" library, which attempts to use the new thread-safe Linux system calls pipe2(), accept4() and the options O_CLOEXEC, SOCK_CLOEXEC. Without these, it falls back to FD_CLOEXEC, which is not thread safe. This is particularly important for the "pipe" output plugin (and others, such as JACK/PulseAudio), because we were heavily leaking file descriptors to child processes.
* listen: handle fatal errors with GErrorMax Kellermann2009-09-241-8/+15
| | | | Don't call g_error(), which will abort the process and dump core.
* listen: bind() failure on secondary address is non-fatalMax Kellermann2009-06-101-3/+25
| | | | | | | | | Several users had problems with binding MPD to "localhost". The cause was duplicate /etc/hosts entries: the resolver library returns 127.0.0.1 twice, and of course, MPD attempts to bind to "both" of them. This patch makes failures non-fatal, given that at least one address was bound successfully. This is a workaround; users should rather fix their /etc/hosts file.
* listen: renamed "error" to "error_r" in listen_add_host()Max Kellermann2009-06-101-4/+4
|
* listen: print debug message before bind()Max Kellermann2009-06-101-0/+7
| | | | Dump each socket address before binding to it.
* Uniform getaddrinfo() on WIN32 or POSIX, because MinGW now supports itSean McNamara2009-03-271-23/+0
|
* socket_util: added socket_bind_listen()Max Kellermann2009-03-141-41/+4
| | | | Moved code from listen_add_address() (listen.c) to socket_util.c.
* all: Update copyright header.Avuton Olrich2009-03-131-6/+7
| | | | | | | | This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
* listen: return GError on "unix path too long"Max Kellermann2009-03-011-2/+5
| | | | | When the unix domain socket path is too long, don't abort with g_error().
* listen: removed unused macro BINDERROR()Max Kellermann2009-03-011-6/+0
|
* listen: fix windows specific codeMax Kellermann2009-03-011-5/+8
| | | | | During the listen_add_host() API transition, the windows code wasn't tested, and several removed arguments are still in use there.
* listen: allocate sockaddr_storage struct for accept()Max Kellermann2009-02-281-4/+5
| | | | | | The generic sockaddr struct is too small for some addresses. For accept(), we have to allocate a sockaddr_storage struct on the stack, which is large enough for all addresses.
* client: use sockaddr_to_string()Max Kellermann2009-02-281-1/+1
| | | | | Removed the sockaddr_to_tmp_string() hack, use the new function sockaddr_to_string() instead.
* listen: fix unused parameter warnings when TCP is disabledMax Kellermann2009-02-241-0/+3
| | | | Work around gcc warnings by casting the parameters to void.
* listen: removed is_ipv6_enabled()Max Kellermann2009-02-241-19/+14
| | | | | Don't explicitly check is_ipv6_enabled(), just try calling listen_add_port_ipv6(), but check its error code.
* listen: splitted listen_add_port() into IPv4 and IPv6Max Kellermann2009-02-241-20/+52
| | | | Some more code simplification.
* listen: don't call listen_add_config_param(NULL)Max Kellermann2009-02-241-10/+25
| | | | | For default bind_to_address settings, don't call listen_add_config_param(NULL), use listen_add_port() directly.
* listen: moved code to listen_add_host()Max Kellermann2009-02-241-58/+78
| | | | | Split code from the rather large function listen_add_config_param(), part 3.
* listen: moved code to listen_add_path()Max Kellermann2009-02-241-25/+38
| | | | | Split code from the rather large function listen_add_config_param(), part 2.
* listen: moved code to listen_add_port()Max Kellermann2009-02-241-33/+50
| | | | Split code from the rather large function listen_add_config_param().
* listen: listen_add_address() returns bool/GErrorMax Kellermann2009-02-241-38/+93
| | | | | Don't return -1 on failure, and abort on fatal error - do proper error reporting with GError, and return false on failure.
* listen: removed unused macro "MAXHOSTNAME"Max Kellermann2009-02-241-2/+0
|
* listen: no CamelCaseMax Kellermann2009-02-241-23/+24
| | | | Renamed functions.
* Set boundPort to the current portnumber, so zeroconf announces the right ↵Qball Cow2009-02-111-0/+1
| | | | port number
* conf: const pointers in block get functionsMax Kellermann2009-01-251-2/+2
| | | | | All config_get_block_*() functions should accept constant config_param pointers.
* use config_get_positive() instead of manual parsingMax Kellermann2009-01-211-15/+1
| | | | | Simplify some code by using config_get_positive(), instead of doing manual parsing and validation each time.
* conf: no CamelCase, part IMax Kellermann2009-01-171-4/+6
| | | | Renamed functions, types, variables.
* listen: explicitly include sys/socket.hMax Kellermann2009-01-161-0/+1
|
* listen: don't compile ipv6Supported() if !HAVE_IPV6Max Kellermann2009-01-151-4/+2
| | | | | The function ipv6Supported() is not used at all when IPv6 support was disabled at compile time.
* listen: remove the socket source from the main contextMax Kellermann2009-01-101-2/+5
| | | | Free memory before exiting.
* listen: added struct listen_socketMax Kellermann2009-01-101-16/+19
| | | | | Make the listen socket an object, allowing us to add more fields later. Convert listenSockets into a simple linked list.
* listen: use GLib instead of utils.hMax Kellermann2009-01-031-4/+21
|
* client: use GLib instead of utils.hMax Kellermann2009-01-031-0/+2
|
* listen: use gethostbyname() on WIN32Max Kellermann2009-01-031-0/+18
| | | | WIN32 has no getaddrinfo(). Fall back to gethostbyname().
* main: use the GLib main loopMax Kellermann2008-12-301-23/+21
| | | | | | | This is a rather huge patch, which unfortunately cannot be splitted. Instead of using our custom ioops.h library, convert everything to use the GLib main loop.
* listen: don't make the server socket non-blockingMax Kellermann2008-12-301-7/+1
| | | | | There is no point in making the server socket non-blocking. We call accept() only after select() has notified us about a new connection.
* listen: include winsock headers on WIN32Max Kellermann2008-12-301-0/+6
| | | | | On Windows, socket declarations reside in winsock.h and ws2tcpip.h. The POSIX headers are not available.
* listen: moved redirect_stdin() to daemon.cMax Kellermann2008-12-301-29/+0
| | | | | redirect_stdin() is a daemonization function, and disconnecting from the standard input is always a good idea for MPD.
* listen: eliminated freeAllListenSockets()Max Kellermann2008-12-301-4/+0
| | | | | Merged freeAllListenSockets() into closeAllListenSockets(), because this is its only caller.
* listen: use GLib loggingMax Kellermann2008-12-291-29/+32
|
* removed os_compat.hMax Kellermann2008-12-291-3/+9
| | | | | Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
* listen: "port" argument is unused when TCP support is disabledMax Kellermann2008-12-241-1/+2
| | | | Add a G_GNUC_UNUSED attribute.
* listen: check if AI_ADDRCONFIG is definedMax Kellermann2008-12-021-1/+4
| | | | | AI_ADDRCONFIG is not available on all operating systems. Check if it is defined in the current build environment.
* listen: enable AI_PASSIVEMax Kellermann2008-12-021-1/+1
| | | | | The getaddrinfo() flag AI_PASSIVE should be used when resolving addresses for the bind() system call.
* listen: fix namespace collision on OpenSolarisTom Servo2008-11-071-6/+6
| | | | | | | | | The listen.c module breaks the build because the variable name used ("sun") for the Unix domain socket part collides with something else on an OpenSolaris system, likely Sun specific. Renaming it to _sun (or something else of choice) fixes the build. [mk: renamed to "s_un"]
* listen: set file mode 666 on the unix socketMax Kellermann2008-10-301-0/+4
| | | | | | Depending on MPD's umask, the file permissions of the unix socket were too restrictive, and many clients were not able to connect. Do a chmod(0666) on the socket, to allow everybody to connect.
* listen: fix "struct ucred" checkAndrzej Rybczak2008-10-181-3/+3
| | | | The macro name is HAVE_STRUCT_UCRED, not HAVE_UCRED.