aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/Resolver.cxx (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-07-22net/Resolver: move sockaddr_to_string() to ToString.cxxMax Kellermann1-97/+4
2015-02-10net/Resolver: relax size check in LocalAddressToString()Max Kellermann1-2/+20
Handles abstract sockets on Linux.
2015-02-10net/Resolver: move code to LocalAddressToString()Max Kellermann1-8/+16
2015-02-10net/SocketAddress: light wrapper for struct sockaddrMax Kellermann1-9/+12
2015-02-10system/{Resolver,Socket{Error,Util}}: move to new library libnet.aMax Kellermann1-0/+0
2015-01-01Copyright year 2015Max Kellermann1-1/+1
2014-07-30system/Resolver: use nullptr instead of NULLMax Kellermann1-5/+5
2014-01-13copyright year 2014Max Kellermann1-1/+1
2013-12-04system/Resolver: use std::string to allocate internal bufferMax Kellermann1-13/+11
No GLib memory allocation.
2013-12-04system/Resolver: sockaddr_to_string() returns std::string()Max Kellermann1-11/+17
No GLib memory allocation.
2013-11-28include cleanup using iwyuMax Kellermann1-0/+3
2013-11-04system/resolver: return path of UNIX domain socketsMax Kellermann1-7/+15
getnameinfo() doesn't work well - it always returns "localhost".
2013-10-15*: use WIN32 instead of G_OS_WIN32Max Kellermann1-3/+3
2013-09-05use standard snprintf() instead of GLib g_snprintf()Max Kellermann1-1/+2
2013-09-04util/Error: new error passing libraryMax Kellermann1-7/+12
Replaces GLib's GError.
2013-09-04system/resolver: convert to C++Max Kellermann1-7/+7
2013-08-07Makefile.am: move sources to libsystem.aMax Kellermann1-0/+0
2012-07-10require GLib 2.16Max Kellermann1-1/+0
GLib 2.16 was released more than 4 years ago. Let's remove some cruft from the glib_compat.h header, and avoid new cruft to it.
2011-10-09don't define WINVER in *.c filesMax Kellermann1-1/+0
In a C file, that is too late, because _mingw.h defaults to 0x0502, and ours would be illegal redefintion.
2011-09-20resolver: add function resolve_host_port()Max Kellermann1-2/+61
2011-09-20socket_util: move sockaddr_to_string() to resolver.cMax Kellermann1-83/+1
2011-09-20fd_util: add function close_socket()Max Kellermann1-3/+3
Wrap close(), use closesocket() on WIN32/WinSock.
2011-09-19Set socket TCP keepalive option on incoming connectionsDan McGee1-0/+15
If a connected host disappears without our knowledge, as can happen over wireless or a hibernating machine, we continue to hold the port open waiting for messages. Because we never try to send anything down this now-broken pipe, the connection will sit idle taking up a slot in our allowed incoming connections list. If enough of these happen, an unintended Denial of Service takes place, where all connection slots are filled with now-broken, never ending connections. Setting the TCP keepalive option at least allows these to time out after the default two hours, which is sufficient in the non-malicious case. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-01-29copyright year 2011Max Kellermann1-1/+1
2010-05-18socket_util: fix setsockopt() argument type on WIN32Max Kellermann1-1/+7
In the winsock headers, the setsockopt() argument is declared as "const char *", not "const void *".
2010-03-21Define winnt or greater on mingw32 to take advantage of get*info().Avuton Olrich1-0/+1
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-11-12include config.h in all sourcesMax Kellermann1-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.
2009-11-08fd_util: added O_NONBLOCK functionsMax Kellermann1-1/+1
Changed the wrappers for pipe(), socket(), accept(). On WIN32, this does not work for pipe().
2009-11-07set the close-on-exec flag on all file descriptorsMax Kellermann1-1/+2
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.
2009-04-01socket_util: fixed format warningMax Kellermann1-1/+1
g_set_error() is a printf-like function, and expects a format string. Using the return value of gai_strerror() is unsafe.
2009-03-16socket_util: use g_strerror() instead of strerror()Max Kellermann1-1/+1
g_strerror() is more portable, and guarantees that the returned string is UTF-8 encoded.
2009-03-14socket_util: added socket_bind_listen()Max Kellermann1-0/+61
Moved code from listen_add_address() (listen.c) to socket_util.c.
2009-03-13all: Update copyright header.Avuton Olrich1-3/+4
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.
2009-03-06socket_util: check if IN6_IS_ADDR_V4MAPPED is definedMax Kellermann1-2/+2
On some systems, the macro IN6_IS_ADDR_V4MAPPED() is not available. Don't try to convert IPv6 to their IPV4 equivalents in this case.
2009-03-01socket_util: include ws2tcpip.h for getnameinfo()Max Kellermann1-0/+4
Windows doesn't have the standard headers sys/socket.h and netdb.h.
2009-02-28socket_util: unpack V4MAPPED addressesMax Kellermann1-0/+20
Unpack IPv4 addresses which are packed inside an IPv6 address, i.e. return "127.0.0.1" rather than "::ffff:127.0.0.1".
2009-02-28socket_util: added function sockaddr_to_string()Max Kellermann1-19/+29
Create the socket_util.c library, the first function is sockaddr_to_string(): it converts a sockaddr struct to a string containing the IP address in a human-readable form.
2009-02-22encoder: added lame mp3 encoderMax Kellermann1-0/+4
This new LAME encoder plugin is based on the existing shout_mp3.c plugin.
2009-02-22encoder: added vorbis encoderMax Kellermann1-0/+5
This new vorbis encoder plugin is based on the existing shout_ogg.c plugin.
2009-02-22added the encoder APIMax Kellermann1-11/+16
The new generic encoder API will replace shout's custom encoder API.
2009-01-07pcm_prng: renamed prng() to pcm_prng()Max Kellermann1-1/+2
2009-01-03pcm_utils: use the custom PRNG for volume ditheringMax Kellermann1-11/+9
Don't use libc's rand() function, because it is slow. Our own trivial linear congruential generator is good enough for dithering.
2008-12-30listen: moved redirect_stdin() to daemon.cMax Kellermann1-0/+6
redirect_stdin() is a daemonization function, and disconnecting from the standard input is always a good idea for MPD.
2008-12-30main: moved daemonize() to daemon.cMax Kellermann1-12/+5
2008-12-27cmdline: use gboolean instead of intMax Kellermann1-4/+6
Prepare for the migration to the GLib option parser, which uses gboolean for flags.
2008-12-27moved command line parser to cmdline.cMax Kellermann1-7/+13
2008-10-31added prefix to header macrosMax Kellermann1-2/+2
"LOG_H" is a macro which is also used by ffmpeg/log.h. This is ffmpeg's fault, because short macros should be reserved for applications, but since it's always a good idea to choose prefixed macro names, even for applications, we are going to do that in MPD.
2008-10-08don't include os_compat.hMax Kellermann1-1/+1
When there are standardized headers, use these instead of the bloated os_compat.h.
2008-09-09output: moved code from audioOutput.c to output_control.cMax Kellermann1-19/+0
Similar to decoder_control.c, output_control.c will provide functions for controlling the output thread (which will be implemented later).