* @param text the text to spool
* @return status of the spool operation
*/
-static protocol_binary_response_status raw_response_handler(memcached_protocol_client_st *client, const char *text)
+static protocol_binary_response_status ascii_raw_response_handler(memcached_protocol_client_st *client, const char *text)
{
if (client->is_verbose)
{
};
client->mute = false;
- raw_response_handler(client, errmsg[client->ascii_command]);
+ ascii_raw_response_handler(client, errmsg[client->ascii_command]);
}
/**
uint32_t textlen)
{
memcached_protocol_client_st *client= (memcached_protocol_client_st*)cookie;
- raw_response_handler(client, "VERSION ");
+ ascii_raw_response_handler(client, "VERSION ");
client->root->spool(client, text, textlen);
- raw_response_handler(client, "\r\n");
+ ascii_raw_response_handler(client, "\r\n");
return PROTOCOL_BINARY_RESPONSE_SUCCESS;
}
if (key != NULL)
{
- raw_response_handler(client, "STAT ");
+ ascii_raw_response_handler(client, "STAT ");
client->root->spool(client, key, keylen);
- raw_response_handler(client, " ");
+ ascii_raw_response_handler(client, " ");
client->root->spool(client, body, bodylen);
- raw_response_handler(client, "\r\n");
+ ascii_raw_response_handler(client, "\r\n");
}
else
{
- raw_response_handler(client, "END\r\n");
+ ascii_raw_response_handler(client, "END\r\n");
}
return PROTOCOL_BINARY_RESPONSE_SUCCESS;
if (client->root->callback->interface.v1.delete_object == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return;
}
if (rval == PROTOCOL_BINARY_RESPONSE_SUCCESS)
{
- raw_response_handler(client, "DELETED\r\n");
+ ascii_raw_response_handler(client, "DELETED\r\n");
}
else if (rval == PROTOCOL_BINARY_RESPONSE_KEY_ENOENT)
{
- raw_response_handler(client, "NOT_FOUND\r\n");
+ ascii_raw_response_handler(client, "NOT_FOUND\r\n");
}
else
{
char msg[80];
snprintf(msg, sizeof(msg), "SERVER_ERROR: delete_object failed %u\r\n",(uint32_t)rval);
- raw_response_handler(client, msg);
+ ascii_raw_response_handler(client, msg);
}
}
{
if (client->root->callback->interface.v1.increment == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return;
}
rval= client->root->callback->interface.v1.increment(client,
{
if (client->root->callback->interface.v1.decrement == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return;
}
rval= client->root->callback->interface.v1.decrement(client,
{
char buffer[80];
snprintf(buffer, sizeof(buffer), "%"PRIu64"\r\n", result);
- raw_response_handler(client, buffer);
+ ascii_raw_response_handler(client, buffer);
}
else
{
- raw_response_handler(client, "NOT_FOUND\r\n");
+ ascii_raw_response_handler(client, "NOT_FOUND\r\n");
}
}
{
if (client->root->callback->interface.v1.stat == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return;
}
if (client->root->callback->interface.v1.version == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return;
}
if (client->root->callback->interface.v1.flush_object == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return;
}
protocol_binary_response_status rval;
rval= client->root->callback->interface.v1.flush_object(client, timeout);
if (rval == PROTOCOL_BINARY_RESPONSE_SUCCESS)
- raw_response_handler(client, "OK\r\n");
+ ascii_raw_response_handler(client, "OK\r\n");
else
- raw_response_handler(client, "SERVER_ERROR: internal error\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: internal error\r\n");
}
/**
if (nkey == 0)
{
/* return error */
- raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
+ ascii_raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
return -1;
}
if (errno != 0)
{
/* return error */
- raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
+ ascii_raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
return -1;
}
if (errno != 0)
{
/* return error */
- raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
+ ascii_raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
return -1;
}
if (errno != 0)
{
/* return error */
- raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
+ ascii_raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
return -1;
}
if (errno != 0)
{
/* return error */
- raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
+ ascii_raw_response_handler(client, "CLIENT_ERROR: bad key\r\n");
return -1;
}
/* FALLTHROUGH */
if (rval == PROTOCOL_BINARY_RESPONSE_SUCCESS)
{
- raw_response_handler(client, "STORED\r\n");
+ ascii_raw_response_handler(client, "STORED\r\n");
}
else
{
{
if (rval == PROTOCOL_BINARY_RESPONSE_KEY_EEXISTS)
{
- raw_response_handler(client, "EXISTS\r\n");
+ ascii_raw_response_handler(client, "EXISTS\r\n");
}
else if (rval == PROTOCOL_BINARY_RESPONSE_KEY_ENOENT)
{
- raw_response_handler(client, "NOT_FOUND\r\n");
+ ascii_raw_response_handler(client, "NOT_FOUND\r\n");
}
else
{
- raw_response_handler(client, "NOT_STORED\r\n");
+ ascii_raw_response_handler(client, "NOT_STORED\r\n");
}
}
else
{
- raw_response_handler(client, "NOT_STORED\r\n");
+ ascii_raw_response_handler(client, "NOT_STORED\r\n");
}
}
if (client->root->callback->interface.v1.replace == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return false;
}
if (client->root->callback->interface.v1.set == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return false;
}
if (client->root->callback->interface.v1.add == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return false;
}
if (client->root->callback->interface.v1.replace == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return false;
}
if (client->root->callback->interface.v1.append == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return false;
}
if (client->root->callback->interface.v1.prepend == NULL)
{
- raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: callback not implemented\r\n");
return false;
}
}
else
{
- raw_response_handler(client, "SERVER_ERROR: Command not implemented\n");
+ ascii_raw_response_handler(client, "SERVER_ERROR: Command not implemented\n");
}
}
else
}
else
{
- raw_response_handler(client, "OK\r\n");
+ ascii_raw_response_handler(client, "OK\r\n");
}
break;