Browse Source

Merge in changes to remove dead options.

Brian Aker 14 years ago
parent
commit
80c8c8e39d

+ 0 - 1
libgearman-server/constants.h

@@ -87,7 +87,6 @@ typedef enum
   GEARMAND_CON_READY,
   GEARMAND_CON_PACKET_IN_USE,
   GEARMAND_CON_EXTERNAL_FD,
-  GEARMAND_CON_IGNORE_LOST_CONNECTION,
   GEARMAND_CON_CLOSE_AFTER_FLUSH,
   GEARMAND_CON_MAX
 } gearmand_connection_options_t;

+ 0 - 2
libgearman-server/io.cc

@@ -122,8 +122,6 @@ gearmand_error_t gearman_io_set_option(gearmand_io_st *connection,
   case GEARMAND_CON_EXTERNAL_FD:
     connection->options.external_fd= value;
     break;
-  case GEARMAND_CON_IGNORE_LOST_CONNECTION:
-    break;
   case GEARMAND_CON_CLOSE_AFTER_FLUSH:
     connection->options.close_after_flush= value;
     break;

+ 2 - 19
libgearman/connection.cc

@@ -96,7 +96,6 @@ gearman_connection_st::gearman_connection_st(gearman_universal_st &universal_arg
 {
   options.ready= false;
   options.packet_in_use= false;
-  options.close_after_flush= false;
 
   if (options_args)
   {
@@ -158,7 +157,6 @@ gearman_connection_st *gearman_connection_copy(gearman_universal_st& universal,
 
   connection->options.ready= from.options.ready;
   connection->options.packet_in_use= from.options.packet_in_use;
-  connection->options.close_after_flush= from.options.close_after_flush;
 
   strcpy(connection->host, from.host);
   connection->port= from.port;
@@ -205,7 +203,6 @@ gearman_return_t gearman_connection_set_option(gearman_connection_st *connection
   case GEARMAN_CON_IGNORE_LOST_CONNECTION:
     break;
   case GEARMAN_CON_CLOSE_AFTER_FLUSH:
-    connection->options.close_after_flush= value;
     break;
   case GEARMAN_CON_EXTERNAL_FD:
   case GEARMAN_CON_MAX:
@@ -405,27 +402,13 @@ gearman_return_t gearman_connection_st::send(const gearman_packet_st& packet_arg
 
   case GEARMAN_CON_SEND_UNIVERSAL_FLUSH:
   case GEARMAN_CON_SEND_UNIVERSAL_FLUSH_DATA:
-    {
-      gearman_return_t ret= flush();
-      if (gearman_success(ret) and options.close_after_flush)
-      {
-        close();
-        ret= GEARMAN_LOST_CONNECTION;
-      }
-      return ret;
-    }
+    return flush();
   }
 
   if (flush_buffer)
   {
     send_state= GEARMAN_CON_SEND_UNIVERSAL_FLUSH;
-    gearman_return_t ret= flush();
-    if (ret == GEARMAN_SUCCESS && options.close_after_flush)
-    {
-      close();
-      ret= GEARMAN_LOST_CONNECTION;
-    }
-    return ret;
+    return flush();
   }
 
   send_state= GEARMAN_CON_SEND_STATE_NONE;

+ 0 - 1
libgearman/connection.hpp

@@ -45,7 +45,6 @@ struct gearman_connection_st
   struct {
     bool ready;
     bool packet_in_use;
-    bool close_after_flush;
   } options;
   enum gearman_con_universal_t state;
   enum gearman_con_send_t send_state;

+ 0 - 2
tests/internals.cc

@@ -289,7 +289,6 @@ static test_return_t connection_init_test(void *)
 
   test_false(connection_ptr->options.ready);
   test_false(connection_ptr->options.packet_in_use);
-  test_false(connection_ptr->options.close_after_flush);
 
   delete connection_ptr;
 
@@ -307,7 +306,6 @@ static test_return_t connection_alloc_test(void *)
 
   test_false(connection_ptr->options.ready);
   test_false(connection_ptr->options.packet_in_use);
-  test_false(connection_ptr->options.close_after_flush);
 
   delete connection_ptr;