{ memcached_literal_param("\r\n") }
};
- if (memcached_is_udp(instance->root))
- {
- size_t send_length= io_vector_total_size(vector, 6);
-
- if (send_length > MAX_UDP_DATAGRAM_LENGTH - UDP_DATAGRAM_HEADER_LENGTH)
- {
- return MEMCACHED_WRITE_FAILURE;
- }
-
- if (send_length +instance->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
- {
- memcached_io_write(instance);
- }
- }
-
/* Send command header */
return memcached_vdo(instance, vector, 6, flush);
}
request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES;
request.message.header.request.bodylen= htonl((uint32_t)(key_length + memcached_array_size(instance->root->_namespace)));
- if (memcached_is_udp(instance->root))
- {
- size_t cmd_size= sizeof(request.bytes) + key_length;
- if (cmd_size > MAX_UDP_DATAGRAM_LENGTH - UDP_DATAGRAM_HEADER_LENGTH)
- {
- return MEMCACHED_WRITE_FAILURE;
- }
-
- if (cmd_size +instance->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
- {
- memcached_io_write(instance);
- }
- }
-
libmemcached_io_vector_st vector[]=
{
{ NULL, 0 },
**/
if (memcached_is_udp(instance->root))
{
+ if (vector->buffer or vector->length)
+ {
+ return memcached_set_error(*instance->root, MEMCACHED_NOT_SUPPORTED, MEMCACHED_AT,
+ memcached_literal_param("UDP messages was attempted, but vector was not setup for it"));
+ }
+
size_t write_length= io_vector_total_size(vector, 11) +UDP_DATAGRAM_HEADER_LENGTH;
if (write_length > MAX_UDP_DATAGRAM_LENGTH - UDP_DATAGRAM_HEADER_LENGTH)