aboutsummaryrefslogtreecommitdiff
path: root/src/listen.c
Commit message (Collapse)AuthorAge
* listen: return GError on "unix path too long"Max Kellermann2009-03-01
| | | | | When the unix domain socket path is too long, don't abort with g_error().
* listen: removed unused macro BINDERROR()Max Kellermann2009-03-01
|
* listen: fix windows specific codeMax Kellermann2009-03-01
| | | | | 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-28
| | | | | | 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-28
| | | | | 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-24
| | | | Work around gcc warnings by casting the parameters to void.
* listen: removed is_ipv6_enabled()Max Kellermann2009-02-24
| | | | | 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-24
| | | | Some more code simplification.
* listen: don't call listen_add_config_param(NULL)Max Kellermann2009-02-24
| | | | | 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-24
| | | | | Split code from the rather large function listen_add_config_param(), part 3.
* listen: moved code to listen_add_path()Max Kellermann2009-02-24
| | | | | Split code from the rather large function listen_add_config_param(), part 2.
* listen: moved code to listen_add_port()Max Kellermann2009-02-24
| | | | Split code from the rather large function listen_add_config_param().
* listen: listen_add_address() returns bool/GErrorMax Kellermann2009-02-24
| | | | | 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-24
|
* listen: no CamelCaseMax Kellermann2009-02-24
| | | | Renamed functions.
* Set boundPort to the current portnumber, so zeroconf announces the right ↵Qball Cow2009-02-11
| | | | port number
* conf: const pointers in block get functionsMax Kellermann2009-01-25
| | | | | All config_get_block_*() functions should accept constant config_param pointers.
* use config_get_positive() instead of manual parsingMax Kellermann2009-01-21
| | | | | Simplify some code by using config_get_positive(), instead of doing manual parsing and validation each time.
* conf: no CamelCase, part IMax Kellermann2009-01-17
| | | | Renamed functions, types, variables.
* listen: explicitly include sys/socket.hMax Kellermann2009-01-16
|
* listen: don't compile ipv6Supported() if !HAVE_IPV6Max Kellermann2009-01-15
| | | | | 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-10
| | | | Free memory before exiting.
* listen: added struct listen_socketMax Kellermann2009-01-10
| | | | | 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-03
|
* client: use GLib instead of utils.hMax Kellermann2009-01-03
|
* listen: use gethostbyname() on WIN32Max Kellermann2009-01-03
| | | | WIN32 has no getaddrinfo(). Fall back to gethostbyname().
* main: use the GLib main loopMax Kellermann2008-12-30
| | | | | | | 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-30
| | | | | 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-30
| | | | | 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-30
| | | | | 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-30
| | | | | Merged freeAllListenSockets() into closeAllListenSockets(), because this is its only caller.
* listen: use GLib loggingMax Kellermann2008-12-29
|
* removed os_compat.hMax Kellermann2008-12-29
| | | | | 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-24
| | | | Add a G_GNUC_UNUSED attribute.
* listen: check if AI_ADDRCONFIG is definedMax Kellermann2008-12-02
| | | | | 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-02
| | | | | The getaddrinfo() flag AI_PASSIVE should be used when resolving addresses for the bind() system call.
* listen: fix namespace collision on OpenSolarisTom Servo2008-11-07
| | | | | | | | | 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-30
| | | | | | 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-18
| | | | The macro name is HAVE_STRUCT_UCRED, not HAVE_UCRED.
* listen: fixed unused variable warning without HAVE_UCREDMax Kellermann2008-10-17
| | | | The local variable "passcred" was only used by ucred code.
* configure.ac: check if "struct ucred" is availableMax Kellermann2008-10-16
| | | | | | | | | | | By default, glibc 2.8 hides struct ucred behind the _GNU_SOURCE macro. I don't want to enable that globally, because it may encourage the use of non-portable functions. Test if "struct ucred" is available, and enable _GNU_SOURCE if required. For details about that issue, see glib's bug database: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6545
* listen, client: enable SO_PASSCRED, get client's uidMax Kellermann2008-10-15
| | | | | Enable authentication over unix sockets. Store the client's uid in the client struct.
* listen: pass protocol family to establishListen()Max Kellermann2008-10-15
| | | | | | The caller already knows the protocol family, and we can eliminate the complicated switch statement in establishListen() if we just pass this information. This seems more robust.
* listen: use getaddrinfo() instead of gethostbyname()Max Kellermann2008-10-15
| | | | | getaddrinfo() is more robust and has proper IPv6 support. The new code tries to bind to all IP addresses returned by getaddrinfo().
* client: renamed all public functionsMax Kellermann2008-08-28
| | | | | | Functions which operate on the whole client list are prefixed with "client_manager_", and functions which handle just one client just get "client_".
* renamed interface.c to client.cMax Kellermann2008-08-28
| | | | | | | I don't believe "interface" is a good name for something like "connection by a client to MPD", let's call it "client". This is the first patch in the series which changes the name, beginning with the file name.
* unlink the socket before bind()Max Kellermann2008-04-12
| | | | | | If a unix domain socket already exists, bind() fails. Unlink the socket file. git-svn-id: https://svn.musicpd.org/mpd/trunk@7335 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* clean up CPP includesMax Kellermann2008-04-12
| | | | | | | | | Try to only include headers which are really needed. We should particularly check all "headers including other headers". The long-term goal is to have a manageable, small API for plugins (decoders, output) without so many mpd internals cluttering the namespace. git-svn-id: https://svn.musicpd.org/mpd/trunk@7319 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* proper bind error message for unix socketMax Kellermann2008-04-12
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7238 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* provide switches for TCP and unix socketsMax Kellermann2008-04-12
| | | | | | | autoconf flags for enabling and disabling TCP and unix domain socket support. Embedded machines without a TCP stack may be better off without TCP support. git-svn-id: https://svn.musicpd.org/mpd/trunk@7236 09075e82-0dd4-0310-85a5-a0d7c8717e4f