- 24 Dec, 2008 1 commit
-
-
Max Kellermann authored
When a response is very long (e.g. a large playlist > 100k songs), most of it will end up in the deferred buffers. Filling the deferred queue is very expensive currently, because a new buffer is allocated for every client_write() operation. This may lead to long delays, and the client might give up and disconnect meanwhile. This patch makes MPD attempt to flush the deferred queue as often as possible, to work around this problem. Due to the MPD 0.14 code freeze, we should not optimize the buffering code now.
-
- 02 Dec, 2008 1 commit
-
-
Thomas Jansen authored
We want to remove gcc.h eventually. This takes care of all the G_GNUC_PRINTF macros.
-
- 24 Nov, 2008 1 commit
-
-
Thomas Jansen authored
-
- 22 Nov, 2008 1 commit
-
-
Marc Pavot authored
The client may provide the names of idle events as arguments to the "idle" command to inform MPD that it is only interested in these events.
-
- 31 Oct, 2008 5 commits
-
-
Max Kellermann authored
Return bool instead of int.
-
Max Kellermann authored
After a partial write, chances are vanishing that another write() will succeed. Don't try immediately.
-
Max Kellermann authored
Another custom data structore converted to GLib.
-
Max Kellermann authored
Replace a custom data structure with a GLib one.
-
Max Kellermann authored
The list cache aims to save memory allocations, and complicates the code a bit. We should rather use GLib slices later, which are easy to use.
-
- 22 Oct, 2008 1 commit
-
-
Max Kellermann authored
Eliminate CamelCase in all public and static functions.
-
- 17 Oct, 2008 7 commits
-
-
Max Kellermann authored
client->permission is a bit set, and should be unsigned.
-
Max Kellermann authored
Reduce two temporary variables to only one.
-
Max Kellermann authored
There is no sense in using the kernel's send buffer size (SO_SNDBUF) for MPD's send buffer. Convert it into a static buffer of 4 kB.
-
Max Kellermann authored
Use a literal in the struct declaration, and sizeof(client->buffer) everywhere else. Also shrink the buffer from 40 kB to 4 kB. The buffer must only be large enough to hold one line of input, and 4 kB is still more than enough.
-
Max Kellermann authored
The buffer pointers must not exceed the buffer size.
-
Max Kellermann authored
Use ssize_t instead of int.
-
Max Kellermann authored
Commit 6eb62e47 didn't obey partial lines correctly: when a line wasn't finished in one read, the first part was ignored when the rest arrived.
-
- 15 Oct, 2008 3 commits
-
-
Max Kellermann authored
Enable authentication over unix sockets. Store the client's uid in the client struct.
-
Max Kellermann authored
-
Max Kellermann authored
Use memchr() instead of manually traversing the input buffer. Update the client's properties after all commands have been processed. Check for buffer overflow once.
-
- 14 Oct, 2008 1 commit
-
-
Max Kellermann authored
"idle" waits until something noteworthy happens on the server, e.g. song change, playlist modified, database updated. This allows clients to keep up to date without polling.
-
- 08 Oct, 2008 1 commit
-
-
Max Kellermann authored
When there are standardized headers, use these instead of the bloated os_compat.h.
-
- 17 Sep, 2008 1 commit
-
-
Max Kellermann authored
The assertion on "!client_is_expired(client)" was wrong, because writing the command response may cause the client to become expired. Replace that assertion with a check.
-
- 10 Sep, 2008 5 commits
-
-
Max Kellermann authored
Remove one comparison by changing branch order.
-
Max Kellermann authored
Since the caller chain doesn't care about the return value (except for COMMAND_RETURN_KILL, COMMAND_RETURN_CLOSE), just return 0 if there is nothing special. This saves one local variable initialization, and one access to it. Also remove one unreachable "return 1" from client_read().
-
Max Kellermann authored
Don't close the client within client_process_line(), return COMMAND_RETURN_CLOSE instead. This is the signal for the caller chain to actually close it. This makes dealing with the client pointer a lot safer, since the caller always knows whether it is still valid.
-
Max Kellermann authored
It's easier to reuse the variable if it has a more generic name.
-
Max Kellermann authored
Don't update client data if it is going to be closed anyway.
-
- 07 Sep, 2008 7 commits
-
-
Max Kellermann authored
Don't pass a pointer to client->permission to processCommand(), better let the code in command.c use the new permission getter/setter functions.
-
Max Kellermann authored
The code in command.c shouldn't mess with a pointer to client->permission. Provide an API for accessing this value.
-
Max Kellermann authored
All callers of fdprintf() have been converted to client_printf() or fprintf(); it is time to remove this clumsy hack now. We can also remove client_print() which took a file descriptor as parameter.
-
Max Kellermann authored
Now that we have removed all invocations of client_get_fd(), we can safely remove this transitional function. All access to the file descriptor is now hidden behind the interface declared in client.h.
-
Max Kellermann authored
These two functions take a client struct instead of the file descriptor. We will now begin passing the client struct around instead of a raw file descriptor (which needed a linear lookup in the client list to be useful).
-
Max Kellermann authored
Based on client_puts(), client_printf() is the successor of fdprintf(). As soon as all fdprintf() callers have been rewritten to use client_printf(), we can remove fdprintf().
-
Max Kellermann authored
client_write() writes a buffer to the client and buffers it if required. client_puts() does the same for a C string. The next patch will add more tools which will replace fdprintf() later.
-
- 06 Sep, 2008 3 commits
-
-
Max Kellermann authored
As usual, include only headers which are really needed.
-
Max Kellermann authored
client->fd becomes -1 when the client expires. Don't use FD_ISSET() with this expired client; doing so would cause a crash due to SIGBUS.
-
Max Kellermann authored
Since client->fd==-1 has become our "expired" flag, it may already be -1 when client_close() is called. Don't assert that it is still non-negative, and call client_set_expired() instead.
-
- 29 Aug, 2008 2 commits
-
-
Max Kellermann authored
Instead of passing the pointer to the "expired" flag to processListOfCommands(), this function should use the client API to check this flag. We can now remove the "global_expired" hack introduced recently.
-
Max Kellermann authored
Start exporting the client struct as an opaque struct. For now, pass it only to processCommand() and processListOfCommands(), and provide a function to extract the socket handle. Later, we will propagate the pointer to all command implementations, and of course to client_print() etc.
-