/* LibMemcached
+ * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
* Copyright (C) 2006-2009 Brian Aker
* All rights reserved.
*
/* -*- Mode: C; tab-width: 2; c-basic-offset: 2; indent-tabs-mode: nil -*- */
#undef NDEBUG
-#include <config.h>
+#include <mem_config.h>
#ifdef HAVE_POLL_H
#include <poll.h>
#include <unistd.h>
#include <libmemcached-1.0/memcached.h>
-#include <libmemcached/socket.hpp>
-#include <libmemcached/memcached/protocol_binary.h>
-#include <libmemcached/byteorder.h>
-#include <clients/utilities.h>
+
+#include "libmemcached/socket.hpp"
+#include "libmemcached/memcached/protocol_binary.h"
+#include "libmemcached/byteorder.h"
+#include "clients/utilities.h"
#include <vector>
*/
static memcached_socket_t set_noblock(void)
{
-#ifdef WIN32
+#if defined(_WIN32)
u_long arg = 1;
if (ioctlsocket(sock, FIONBIO, &arg) == SOCKET_ERROR)
{
verify(*key != NULL);
char *ptr= end + 1;
+ errno= 0;
unsigned long val= strtoul(ptr, &end, 10); /* flags */
+ verify(errno == 0);
verify(ptr != end);
verify(val == 0);
verify(end != NULL);
+ errno= 0;
*ndata = (ssize_t)strtoul(end, &end, 10); /* size */
+ verify(errno == 0);
verify(ptr != end);
verify(end != NULL);
while (end and *end != '\n' and isspace(*end))
char *ptr= buffer + 6 + strlen(key) + 1;
char *end;
+ errno= 0;
unsigned long val= strtoul(ptr, &end, 10); /* flags */
+ verify(errno == 0);
verify(ptr != end);
verify(val == 0);
verify(end != NULL);
+
+ errno= 0;
val= strtoul(end, &end, 10); /* size */
+ verify(errno == 0);
verify(ptr != end);
verify(val == datasize);
verify(end != NULL);
char *ptr= buffer + 6 + strlen(key) + 1;
char *end;
+ errno= 0;
unsigned long val= strtoul(ptr, &end, 10); /* flags */
+ verify(errno == 0);
verify(ptr != end);
verify(val == 0);
verify(end != NULL);
+
+ errno= 0;
val= strtoul(end, &end, 10); /* size */
+ verify(errno == 0);
verify(ptr != end);
verify(val == datasize);
verify(end != NULL);
+
+ errno= 0;
*cas= strtoul(end, &end, 10); /* cas */
+ verify(errno == 0);
verify(ptr != end);
verify(val == datasize);
verify(end != NULL);