Added message processing callback call upon message reading within memcached_purge
authorJean-Charles Redoutey <jc@Jayce2009lnx>
Mon, 30 Nov 2009 20:48:43 +0000 (21:48 +0100)
committerJean-Charles Redoutey <jc@Jayce2009lnx>
Mon, 30 Nov 2009 20:48:43 +0000 (21:48 +0100)
libmemcached/memcached_purge.c

index 9e5e31aba04e3f9d1416b15794ab35ea6067883d..7485da33d343bcacb046f2a6d5153e323605b201 100644 (file)
@@ -65,6 +65,20 @@ memcached_return memcached_purge(memcached_server_st *ptr)
         ret = rc;
         memcached_io_reset(ptr);
       }
+
+      if (ptr->root->callbacks != NULL)
+      {
+        memcached_callback_st cb = *ptr->root->callbacks;
+        if (rc == MEMCACHED_SUCCESS)
+        {
+          for (unsigned int y = 0; y < cb.number_of_callback; y++)
+          {
+            rc = (*cb.callback[y])(ptr->root, result_ptr, cb.context);
+            if (rc != MEMCACHED_SUCCESS)
+              break;
+          }
+        }
+      }
     }
 
     memcached_result_free(result_ptr);