chunkd: add LOGIN message, don't send username in each request
PATCH 1/1 chunkd: add LOGIN message, don't send username in each request
Just committed...
commit 8ee54c1631af713bc11426400a405d948ce71ffc
Author: Jeff Garzik <[email protected]> Date: Tue Nov 10 02:56:17 2009 -0500
Add LOGIN request, and stop sending username in each message.
The per-request message header shrinks by 64 bytes.
This is an incompatible network protocol change, but the programming API stays unchanged.
Also,
libchunkdc: better validation of stc_new() arguments
Signed-off-by Jeff Garzik <[email protected]>
include/chunk_msg.h +1 -1
@@ -20,6 +20,7 @@ enum chunksrv_ops {CHO_PUT =3 ,CHO_DEL =4 ,CHO_LIST =5 , + CHO_LOGIN = 6, }; enum chunk_errcode {
@@ -44,7 +45,6 @@ struct chunksrv_req {uint16_t key_len;uint32_t nonce;/* random number, to stir checksum */ uint64_t data_len;/* len of addn'l data */ -char user[CHD_USER_SZ ];/* username */ char sig[CHD_SIG_SZ ];/* HMAC signature */ /* variable-length key */
lib/chunkdc.c +44 -1
69 lines not on this page · raw message
server/chunkd.h +2 -0
@@ -76,6 +76,8 @@ struct client {char addr_host[64 ];/* ASCII version of inet addr */ int fd;/* socket */ +char user[CHD_USER_SZ +1 ]; +SSL *ssl;bool read_want_write;bool write_want_read;
server/object.c +3 -3
@@ -30,7 +30,7 @@ bool object_del(struct client *cli)resp_init_req (resp, &cli->creq); - rcb =fs_obj_delete (cli->creq.user, cli->key, cli->key_len, &err); + rcb =fs_obj_delete (cli->user, cli->key, cli->key_len, &err);if (!rcb)return cli_err (cli, err, true);
@@ -189,7 +189,7 @@ bool cli_evt_data_in(struct client *cli, unsigned int events)bool object_put (struct client *cli) { -const char *user = cli->creq.user; +const char *user = cli->user;uint64_t content_len =le64_to_cpu (cli->creq.data_len);enum chunk_errcode err;
@@ -286,7 +286,7 @@ bool object_get(struct client *cli, bool want_body)resp_init_req (&get_resp->resp, &cli->creq); - cli->in_obj = obj =fs_obj_open (cli->creq.user, cli->key, + cli->in_obj = obj =fs_obj_open (cli->user, cli->key, cli->key_len, &err);if (!obj) {free (get_resp);
server/server.c +56 -17
131 lines not on this page · raw message