Client: move output buffer code to new class PeakBuffer

This commit is contained in:
Max Kellermann
2013-01-15 01:12:08 +01:00
parent 4fa724461e
commit 3e03527930
7 changed files with 245 additions and 165 deletions

View File

@@ -25,6 +25,7 @@
#include "ClientMessage.hxx"
#include "CommandListBuilder.hxx"
#include "command.h"
#include "util/PeakBuffer.hxx"
#include <set>
#include <string>
@@ -40,12 +41,8 @@ enum {
CLIENT_MAX_MESSAGES = 64,
};
struct deferred_buffer {
size_t size;
char data[sizeof(long)];
};
struct Partition;
class PeakBuffer;
class Client {
public:
@@ -71,12 +68,9 @@ public:
CommandListBuilder cmd_list;
GQueue *deferred_send; /* for output if client is slow */
size_t deferred_bytes; /* mem deferred_send consumes */
unsigned int num; /* client number */
char send_buf[16384];
size_t send_buf_used; /* bytes used this instance */
PeakBuffer output_buffer;
/** is this client waiting for an "idle" response? */
bool idle_waiting;