aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmpdclient.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-09-21libmpdclient: added another connection->sock checkMax Kellermann1-0/+6
Check if connection->sock is valid in mpd_executeCommand().
2008-09-21libmpdclient: check connection->sock >= 0Max Kellermann1-0/+10
mpd_wait() must not be called when the socket is dead; add an assertion there. In mpd_recv(), add a run-time check.
2008-09-18libmpdclient: added resolver libraryMax Kellermann1-199/+74
The resolver library provides unified access to all resolvers (getaddrinfo(), gethostbyname(), Unix domain sockets). Like getaddrinfo(), it can return more than one address for a host name. This fixes bug 1517 (http://www.musicpd.org/mantis/view.php?id=1517).
2008-09-18libmpdclient: moved code to mpd_recv(), mpd_wait()Max Kellermann1-90/+129
Create generic utility functions for doint I/O: two wait functions, and mpd_recv() fills the input buffer. These functions are used in mpd_newConnection() and mpd_getNextReturnElement().
2008-09-18libmpdclient: smaller input bufferMax Kellermann1-4/+4
Even for large responses, 16kB should be enough. There is no performance gain for larger buffers, even if MPD is local.
2008-09-18libmpdclient: smaller error bufferMax Kellermann1-20/+22
512 characters should be well enough for error messages which are actually being displayed somewhere. Use sizeof(errorStr) instead of MPD_BUFFER_MAX_LENGTH everywhere. Do proper length checking when copying the output buffer to errorStr.
2008-09-18libmpdclient: use memmove() instead of strcpy() for moving the bufferMax Kellermann1-8/+8
In general, don't treat the input buffer as a null-terminated string: don't append '\0', don't use strchr() and strtok(). To delete consumed portions of the buffer, strcpy() is bad anyway, because it does not allow overlapping buffers.
2008-09-18libmpdclient: don't strdup() MPD's welcome messageMax Kellermann1-7/+3
Why bother duplicating the buffer, when we can simply parse the response directly from the input buffer?
2008-09-18libmpdclient: use size_t and ssize_tMax Kellermann1-2/+2
When working with buffer lengths and recv() results, we should declare size_t and ssize_t variables, otherwise the code may fail on 64 bit machines.
2008-09-17code style, indent with tabs IVMax Kellermann1-38/+36
Follow the same code style als MPD itself.
2008-09-16libmpdclient: moved code to song.cMax Kellermann1-67/+0
Move everything which manipulates the mpd_Song struct to song.c. Thousands of lines of too much for libmpdclient.c!
2008-09-16libmpdclient: const pointersMax Kellermann1-1/+1
Pass const pointers whenever possible.
2008-09-15manage tag string allocations in a poolMax Kellermann1-43/+44
There are many duplicated strings in the tag database, e.g. many songs having the same artist. Don't allocate such strings twice, manage all strings in a pool.
2008-09-15added support for unix domain socketsMax Kellermann1-1/+58
If a host name starts with a slash, it is assumed to be a unix domain socket path. The port is ignored. This code is disabled on WIN32, until someone tests it.
2008-09-15const pointersMax Kellermann1-5/+6
Convert pointers to const whenever it is possible. Fixes all those -Wconst warnings.
2008-09-15code style, indent with tabsMax Kellermann1-6/+9
Follow the same code style als MPD itself. This patch only fixes parts of the code which are going to be touched in the following bunch of patches, i.e. there will be more "code style" patches in the future.
2008-09-15remove unused static functionsMax Kellermann1-2/+3
Also remove some commented code and unused function parameters.
2006-08-04the updated sourcesAndreas Obergrusberger1-402/+527
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4543 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-03-28IPv6 patch from Jelmer VernooijKalle Wallin1-81/+50
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3963 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-06-16Test new search functionality with qball's version of libmpdclientKalle Wallin1-4/+162
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3360 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-06-05libmpdclient updateKalle Wallin1-15/+40
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3320 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-01-23Updated libmpdclient to r2897Kalle Wallin1-4/+5
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@2898 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-01-19libmpdclient updateAvuton Olrich1-2/+88
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@2889 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-30Updated libmpdclient to r1743Kalle Wallin1-17/+36
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1744 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-16libmpdclient updated (r1507) - added path to mpdclient_cmd_db_update() Kalle Wallin1-3/+8
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1508 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-14Major cleanup of the mpd client code (mpc->mpdclient)Kalle Wallin1-76/+194
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1481 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-08Check playlist length and remove songs (plchanges command)Kalle Wallin1-3/+3
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1393 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-07Support plchangesKalle Wallin1-7/+40
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1380 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-06-05Changed directory layout (for future use of gettext)Kalle Wallin1-5/+36
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1342 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-04-06SOCKLEN_TKalle Wallin1-1/+1
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@616 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-03-29Updated to 0.10.1Kalle Wallin1-0/+8
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@535 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-03-19Updated to 0.10.xKalle Wallin1-4/+100
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@294 09075e82-0dd4-0310-85a5-a0d7c8717e4f