Browse Source

Merge lp:~tangent-org/gearmand/1.0-build/ Build: jenkins-Gearmand-401

Continuous Integration 12 years ago
parent
commit
da96286955

+ 13 - 0
libgearman-server/connection.cc

@@ -716,3 +716,16 @@ void gearman_server_con_delete_timeout(gearman_server_con_st *con)
     con->timeout_event= NULL;
   }
 }
+
+gearman_server_con_st *gearmand_ready(gearmand_connection_list_st *universal)
+{
+  if (universal->ready_con_list)
+  {
+    gearmand_io_st *con= universal->ready_con_list;
+    con->options.ready= false;
+    GEARMAN_LIST_DEL(universal->ready_con, con, ready_);
+    return con->root;
+  }
+
+  return NULL;
+}

+ 5 - 0
libgearman-server/connection.h

@@ -195,8 +195,13 @@ void gearman_server_con_delete_timeout(gearman_server_con_st *con);
 void gearman_server_con_protocol_release(gearman_server_con_st *con);
 
 gearman_server_con_st* build_gearman_server_con_st(void);
+
 void destroy_gearman_server_con_st(gearman_server_con_st* arg);
 
+void gearmand_connection_list_init(gearmand_connection_list_st *source, gearmand_event_watch_fn *watch_fn, void *watch_context);
+
+gearman_server_con_st *gearmand_ready(gearmand_connection_list_st *gearman);
+
 /** @} */
 
 #ifdef __cplusplus

+ 0 - 59
libgearman-server/connection_list.cc

@@ -1,59 +0,0 @@
-/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
- *  Gearmand client and server library.
- *
- *  Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
- *  Copyright (C) 2008 Brian Aker, Eric Day
- *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are
- *  met:
- *
- *      * Redistributions of source code must retain the above copyright
- *  notice, this list of conditions and the following disclaimer.
- *
- *      * Redistributions in binary form must reproduce the above
- *  copyright notice, this list of conditions and the following disclaimer
- *  in the documentation and/or other materials provided with the
- *  distribution.
- *
- *      * The names of its contributors may not be used to endorse or
- *  promote products derived from this software without specific prior
- *  written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "gear_config.h"
-#include <libgearman-server/error.h>
-#include <libgearman-server/constants.h>
-#include <libgearman-server/connection_list.h>
-#include <libgearman-server/io.h>
-#include <libgearman-server/common.h>
-#include <libgearman-server/connection.h>
-#include <assert.h>
-
-gearman_server_con_st *gearmand_ready(gearmand_connection_list_st *universal)
-{
-  if (universal->ready_con_list)
-  {
-    gearmand_io_st *con= universal->ready_con_list;
-    con->options.ready= false;
-    GEARMAN_LIST_DEL(universal->ready_con, con, ready_);
-    return con->root;
-  }
-
-  return NULL;
-}

+ 0 - 62
libgearman-server/connection_list.h

@@ -1,62 +0,0 @@
-/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
- *  Gearmand client and server library.
- *
- *  Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
- *  Copyright (C) 2008 Brian Aker, Eric Day
- *  All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are
- *  met:
- *
- *      * Redistributions of source code must retain the above copyright
- *  notice, this list of conditions and the following disclaimer.
- *
- *      * Redistributions in binary form must reproduce the above
- *  copyright notice, this list of conditions and the following disclaimer
- *  in the documentation and/or other materials provided with the
- *  distribution.
- *
- *      * The names of its contributors may not be used to endorse or
- *  promote products derived from this software without specific prior
- *  written permission.
- *
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#pragma once 
-
-struct gearmand_io_st;
-
-#include <libgearman-server/struct/connection_list.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct gearmand_connection_list_st gearmand_connection_list_st;
-
-GEARMAN_INTERNAL_API
-void gearmand_connection_list_init(gearmand_connection_list_st *source, gearmand_event_watch_fn *watch_fn, void *watch_context);
-
-/*
-  Get next connection that is ready for I/O.
-*/
-GEARMAN_INTERNAL_API
-gearman_server_con_st *gearmand_ready(gearmand_connection_list_st *gearman);
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 1
libgearman-server/gearmand.h

@@ -58,7 +58,6 @@
 
 #include <libgearman-server/constants.h>
 #include <libgearman-server/wakeup.h>
-#include <libgearman-server/connection_list.h>
 #include <libgearman-server/byteorder.h>
 #include <libgearman-server/log.h>
 #include <libgearman-server/packet.h>

+ 0 - 2
libgearman-server/include.am

@@ -35,7 +35,6 @@ noinst_HEADERS+= \
 		 libgearman-server/client.h \
 		 libgearman-server/common.h \
 		 libgearman-server/connection.h \
-		 libgearman-server/connection_list.h \
 		 libgearman-server/constants.h \
 		 libgearman-server/function.h \
 		 libgearman-server/gearmand.h \
@@ -61,7 +60,6 @@ libgearman_server_libgearman_server_la_SOURCES+= \
 						 libgearman-server/byteorder.cc \
 						 libgearman-server/client.cc \
 						 libgearman-server/connection.cc \
-						 libgearman-server/connection_list.cc \
 						 libgearman-server/function.cc \
 						 libgearman-server/gearmand.cc \
 						 libgearman-server/gearmand_con.cc \

+ 2 - 11
libgearman-server/io.h

@@ -47,6 +47,8 @@
 #include <sys/socket.h>
 #include <netdb.h>
 
+#include <libgearman-server/struct/connection_list.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -78,7 +80,6 @@ extern "C" {
  * @return On success, a pointer to the (possibly allocated) structure. On
  *  failure this will be NULL.
  */
-GEARMAN_INTERNAL_API
   void gearmand_connection_init(gearmand_connection_list_st *gearman,
                                 gearmand_io_st *connection,
                                 struct gearmand_con_st *dcon,
@@ -90,11 +91,9 @@ GEARMAN_INTERNAL_API
  * @param[in] connection Structure previously initialized with gearmand_connection_init(),
  *  gearmand_connection_init_args(), or gearman_connection_clone().
  */
-GEARMAN_INTERNAL_API
 void gearmand_io_free(gearmand_io_st *connection);
 
 
-GEARMAN_INTERNAL_API
 gearmand_error_t gearman_io_set_option(gearmand_io_st *connection,
                                                gearmand_connection_options_t options,
                                                bool value);
@@ -103,45 +102,37 @@ gearmand_error_t gearman_io_set_option(gearmand_io_st *connection,
 /**
  * Set connection to an already open file descriptor.
  */
-GEARMAN_INTERNAL_API
 gearmand_error_t gearman_io_set_fd(gearmand_io_st *connection, int fd);
 
 /**
  * Get application context pointer.
  */
-GEARMAN_INTERNAL_API
 gearmand_con_st *gearman_io_context(const gearmand_io_st *connection);
 
 /**
  * Used by thread to send packets.
  */
-GEARMAN_INTERNAL_API
 gearmand_error_t gearman_io_send(gearman_server_con_st *connection,
                                  const struct gearmand_packet_st *packet, bool flush);
 
 /**
  * Used by thread to recv packets.
  */
-GEARMAN_INTERNAL_API
 gearmand_error_t gearman_io_recv(gearman_server_con_st *con, bool recv_data);
 
 /**
  * Set events to be watched for a connection.
  */
-GEARMAN_INTERNAL_API
 gearmand_error_t gearmand_io_set_events(gearman_server_con_st *connection, short events);
 
 /**
  * Set events that are ready for a connection. This is used with the external
  * event callbacks.
  */
-GEARMAN_INTERNAL_API
 gearmand_error_t gearmand_io_set_revents(gearman_server_con_st *connection, short revents);
 
-GEARMAN_INTERNAL_API
 void gearmand_sockfd_close(int& sockfd);
 
-GEARMAN_INTERNAL_API
 void gearmand_pipe_close(int& sockfd);
 
 /** @} */