From f9d04eb55f50a2f907bea037f7fb125de6d7ed23 Mon Sep 17 00:00:00 2001 From: Evgeniy Polyakov Date: Mon, 23 Apr 2012 05:05:10 +0400 Subject: [PATCH] Return sub data from smack_write() call - this is needed for fastcgi frontend --- example/smack_backend.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/example/smack_backend.c b/example/smack_backend.c index a96f557..52742bd 100644 --- a/example/smack_backend.c +++ b/example/smack_backend.c @@ -127,11 +127,22 @@ static int smack_backend_write(struct smack_backend *s, void *state, struct dnet err = smack_write(s->smack, &idx, data); if (err < 0) goto err_out_exit; - +#if 0 err = smack_backend_lookup_raw(s, &idx, state, cmd, attr); if (err) goto err_out_exit; +#else + if (!(cmd->flags & DNET_FLAGS_NEED_ACK)) { + char reply[1024]; + char id_str[DNET_ID_SIZE * 2 + 1]; + + snprintf(reply, sizeof(reply), "", + dnet_dump_id_len_raw(cmd->id.id, DNET_ID_SIZE, id_str), + (unsigned long long)io->offset, (unsigned long long)io->size); + err = dnet_send_reply(state, cmd, attr, reply, 256, 0); + } +#endif dnet_backend_log(DNET_LOG_INFO, "%s: SMACK: : WRITE: Ok: offset: %llu, size: %llu.\n", dnet_dump_id(&cmd->id), (unsigned long long)io->offset, (unsigned long long)io->size); -- 2.11.4.GIT