~brianaker/libmemcached/gear-clean

« back to all changes in this revision

Viewing changes to libmemcached/fetch.cc

  • Committer: Continuous Integration
  • Date: 2014-02-01 22:30:50 UTC
  • mfrom: (1174.1.11 libmemcached-1.0)
  • Revision ID: ci@tangent.org-20140201223050-9oskut4own512lem
Merge lp:~brianaker/libmemcached/1251482 Build: jenkins-Libmemcached-439

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
  *error= MEMCACHED_MAXIMUM_RETURN; // We use this to see if we ever go into the loop
195
195
  memcached_instance_st *server;
196
196
  memcached_return_t read_ret= MEMCACHED_SUCCESS;
 
197
  bool connection_failures= false;
197
198
  while ((server= memcached_io_get_readable_server(ptr, read_ret)))
198
199
  {
199
200
    char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
203
204
    {
204
205
      continue;
205
206
    }
 
207
    else if (*error == MEMCACHED_CONNECTION_FAILURE)
 
208
    {
 
209
      connection_failures= true;
 
210
      continue;
 
211
    }
206
212
    else if (*error == MEMCACHED_SUCCESS)
207
213
    {
208
214
      result->count++;
230
236
  {
231
237
    *error= MEMCACHED_NOTFOUND;
232
238
  }
 
239
  else if (connection_failures)
 
240
  {
 
241
    /*  
 
242
        If we have a connection failure to some servers, the caller may
 
243
        wish to treat that differently to getting a definitive NOT_FOUND
 
244
        from all servers, so return MEMCACHED_CONNECTION_FAILURE to allow
 
245
        that. 
 
246
        */
 
247
    *error= MEMCACHED_CONNECTION_FAILURE;
 
248
  }
233
249
  else if (*error == MEMCACHED_SUCCESS)
234
250
  {
235
251
    *error= MEMCACHED_END;