Fix snd/recv when number is higher then domain of value.
[awesomized/libmemcached] / libmemcached / csl / context.h
index 94f6813463f364d252a41d4343cedb32ee084e07..12e028ddcaeac95c74c33073e273d3957a1cff50 100644 (file)
@@ -52,7 +52,8 @@ public:
     memc(NULL),
     rc(rc_arg),
     _is_server(false),
-    _end(false)
+    _end(false),
+    _has_hash(false)
   {
     _hostname[0]= 0;
     buf= option_string;
@@ -60,6 +61,8 @@ public:
     memc= memc_arg;
     init_scanner();
     rc= MEMCACHED_SUCCESS;
+
+    memc->state.is_parsing= true;
   }
 
   bool end()
@@ -75,6 +78,8 @@ public:
     _end= true;
   }
 
+  bool set_hash(memcached_hash_t hash);
+
   void set_server()
   {
     _is_server= true;
@@ -85,14 +90,14 @@ public:
     _is_server= false;
   }
 
-  bool is_server()
+  bool is_server() const
   {
     return _is_server;
   }
 
   const char *set_hostname(const char *str, size_t size);
 
-  const char *hostname()
+  const char *hostname() const
   {
     return _hostname;
   }
@@ -103,6 +108,7 @@ public:
   ~Context()
   {
     destroy_scanner();
+    memc->state.is_parsing= false;
   }
 
   yytokentype previous_token;
@@ -122,4 +128,5 @@ private:
   bool _is_server;
   bool _end;
   char _hostname[NI_MAXHOST];
+  bool _has_hash;
 };