Move RDB server logic to separate file
This commit is contained in:
+4
-4
@@ -1,6 +1,7 @@
|
||||
#ifndef RDBSERVER_REQUEST_H
|
||||
#define RDBSERVER_REQUEST_H
|
||||
|
||||
#include <cmdbuf.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define INBUF_LEN 256
|
||||
@@ -29,15 +30,14 @@ typedef struct RdbRequest {
|
||||
size_t index;
|
||||
} inbuf;
|
||||
rdb_read_state_t state;
|
||||
char *cmd;
|
||||
size_t cmdlen;
|
||||
size_t outlen;
|
||||
char *outbuf;
|
||||
size_t outbuflen;
|
||||
char chk;
|
||||
} RdbRequest;
|
||||
|
||||
void rdb_request_init(RdbRequest *req, int connfd, char *cmd, size_t cmdlen);
|
||||
void rdb_request_reset(RdbRequest *req);
|
||||
void rdb_request_set_blocking(RdbRequest *req, bool blocking);
|
||||
rdb_read_result_t rdb_request_read(RdbRequest *req, size_t *len);
|
||||
rdb_read_result_t rdb_request_read(RdbRequest *req, CommandBuf *cmd);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef RDBSERVER_SERVER_H_
|
||||
#define RDBSERVER_SERVER_H_
|
||||
|
||||
#include <client.h>
|
||||
#include <cmdbuf.h>
|
||||
#include <stdbool.h>
|
||||
#include <vb.h>
|
||||
|
||||
int handle_command(RdbClient *client, CommandBuf *cmd, VB *sim, bool *running);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user