client: return early on error in client_defer_output()

Exit the function when an error occurs, and move the rest of the
following code one indent level left.
This commit is contained in:
Max Kellermann 2008-08-28 20:03:54 +02:00
parent 7774cd2774
commit 20f06162dd

View File

@ -722,7 +722,7 @@ int client_print(int fd, const char *buffer, size_t buflen)
static void client_defer_output(struct client *client, static void client_defer_output(struct client *client,
const void *data, size_t length) const void *data, size_t length)
{ {
struct sllnode *buf = client->deferred_send; struct sllnode *buf;
assert(client->deferred_send != NULL); assert(client->deferred_send != NULL);
@ -735,11 +735,13 @@ static void client_defer_output(struct client *client,
(unsigned long)client_max_output_buffer_size); (unsigned long)client_max_output_buffer_size);
/* cause client to close */ /* cause client to close */
client->expired = 1; client->expired = 1;
} else { return;
while (buf->next)
buf = buf->next;
buf->next = new_sllnode(data, length);
} }
buf = client->deferred_send;
while (buf->next)
buf = buf->next;
buf->next = new_sllnode(data, length);
} }
static void client_write_output(struct client *client) static void client_write_output(struct client *client)