1 --- a/libgearman/client.cc 2012-05-04 05:51:48.000000000 +0200
2 +++ b/libgearman/client.cc 2013-06-06 16:02:19.223730770 +0200
5 if (client->new_tasks == 0)
7 - gearman_return_t local_ret= gearman_flush_all(client->universal);
8 - if (gearman_failed(local_ret))
12 + gearman_flush_all(client->universal);
16 --- a/libgearman/universal.cc 2012-05-04 05:51:48.000000000 +0200
17 +++ b/libgearman/universal.cc 2013-06-06 16:02:19.223730770 +0200
22 -gearman_return_t gearman_flush_all(gearman_universal_st& universal)
24 + * Flush all shouldn't return any error, because there's no way to indicate
25 + * which connection experienced an issue. Error detection is better done in gearman_wait()
26 + * after flushing all the connections here.
28 +void gearman_flush_all(gearman_universal_st& universal)
30 for (gearman_connection_st *con= universal.con_list; con; con= con->next)
36 - gearman_return_t ret= con->flush();
37 - if (gearman_failed(ret) and ret != GEARMAN_IO_WAIT)
44 - return GEARMAN_SUCCESS;
47 gearman_return_t gearman_wait(gearman_universal_st& universal)
48 --- a/libgearman/universal.hpp 2012-05-04 05:51:48.000000000 +0200
49 +++ b/libgearman/universal.hpp 2013-06-06 16:02:19.223730770 +0200
52 // Flush the send buffer for all connections.
54 -gearman_return_t gearman_flush_all(gearman_universal_st&);
55 +void gearman_flush_all(gearman_universal_st&);
58 * Set custom memory allocation function for workloads. Normally gearman uses
59 --- a/libgearman/connection.cc 2012-05-04 05:51:48.000000000 +0200
60 +++ b/libgearman/connection.cc 2013-06-06 16:02:19.227730820 +0200
63 recv_buffer_ptr= recv_buffer;
66 + // created_id_next is incremented for every outbound packet (except status).
67 + // created_id is incremented for every response packet received, and also when
68 + // no packets are received due to an error. There are lots of such error paths
69 + // and it seems simpler to just reset these both to zero when a connection is
75 void gearman_connection_st::free_recv_packet()