Merge lp:~brianaker/gearmand/ssl-update into lp:gearmand

Proposed by Brian Aker on 2013-07-06
Status: Merged
Merged at revision: 807
Proposed branch: lp:~brianaker/gearmand/ssl-update
Merge into: lp:gearmand
Diff against target: 130 lines (+53/-10)
5 files modified
libgearman-server/gearmand_con.cc (+3/-1)
libgearman-server/io.cc (+21/-0)
libgearman-server/plugins/protocol/gear/protocol.cc (+5/-9)
libgearman-server/struct/io.h (+23/-0)
tests/libgearman-1.0/gearman_execute_partition.cc (+1/-0)
To merge this branch: bzr merge lp:~brianaker/gearmand/ssl-update
Reviewer Review Type Date Requested Status
Tangent Trunk 2013-07-06 Pending
Review via email: mp+173304@code.launchpad.net
To post a comment you must log in.
lp:~brianaker/gearmand/ssl-update updated on 2013-07-06
807. By Tangent.Org Continuous Integration on 2013-07-06

Merge lp:~brianaker/gearmand/ssl-update Build: jenkins-Gearmand-710

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libgearman-server/gearmand_con.cc'
2--- libgearman-server/gearmand_con.cc 2013-06-26 23:50:02 +0000
3+++ libgearman-server/gearmand_con.cc 2013-07-06 09:39:28 +0000
4@@ -719,7 +719,9 @@
5 gearmand_error_t rc;
6 if ((rc= _con_add(thread, dcon)) != GEARMAND_SUCCESS)
7 {
8- gearmand_gerror("_con_add() has failed, please report any crashes that occur immediatly after this.", rc);
9+ gearmand_log_gerror(GEARMAN_DEFAULT_LOG_PARAM, rc, "%s:%s _con_add() has failed, please report any crashes that occur immediatly after this.",
10+ dcon->host,
11+ dcon->port);
12 gearmand_con_free(dcon);
13 }
14 }
15
16=== modified file 'libgearman-server/io.cc'
17--- libgearman-server/io.cc 2013-07-06 00:33:10 +0000
18+++ libgearman-server/io.cc 2013-07-06 09:39:28 +0000
19@@ -99,6 +99,27 @@
20 connection->recv_buffer_size= 0;
21 }
22
23+
24+const char* gearmand_io_st::host() const
25+{
26+ if (context)
27+ {
28+ return context->host;
29+ }
30+
31+ return "-";
32+}
33+
34+const char* gearmand_io_st::port() const
35+{
36+ if (context)
37+ {
38+ return context->port;
39+ }
40+
41+ return "-";
42+}
43+
44 static size_t _connection_read(gearman_server_con_st *con, void *data, size_t data_size, gearmand_error_t &ret)
45 {
46 ssize_t read_size;
47
48=== modified file 'libgearman-server/plugins/protocol/gear/protocol.cc'
49--- libgearman-server/plugins/protocol/gear/protocol.cc 2013-07-06 00:33:10 +0000
50+++ libgearman-server/plugins/protocol/gear/protocol.cc 2013-07-06 09:39:28 +0000
51@@ -317,21 +317,17 @@
52
53 CyaSSL_set_fd(connection->_ssl, connection->con.fd);
54
55- bool connecting= true;
56- while (connecting)
57+ if (CyaSSL_accept(connection->_ssl) != SSL_SUCCESS)
58 {
59- if (CyaSSL_accept(connection->_ssl) == SSL_SUCCESS)
60- {
61- connecting= false;
62- break;
63- }
64-
65 if (CyaSSL_get_error(connection->_ssl, 0) != SSL_ERROR_WANT_READ)
66 {
67 int cyassl_error= CyaSSL_get_error(connection->_ssl, 0);
68 char cyassl_error_buffer[1024]= { 0 };
69 CyaSSL_ERR_error_string(cyassl_error, cyassl_error_buffer);
70- return gearmand_log_gerror(GEARMAN_DEFAULT_LOG_PARAM, GEARMAND_LOST_CONNECTION, "%s(%d)", cyassl_error_buffer, cyassl_error);
71+ return gearmand_log_gerror(GEARMAN_DEFAULT_LOG_PARAM, GEARMAND_LOST_CONNECTION, "%s:%s %s(%d)",
72+ connection->host(),
73+ connection->port(),
74+ cyassl_error_buffer, cyassl_error);
75 }
76 }
77 gearmand_log_info(GEARMAN_DEFAULT_LOG_PARAM, "GearSSL connection made: %d", connection->con.fd);
78
79=== modified file 'libgearman-server/struct/io.h'
80--- libgearman-server/struct/io.h 2013-06-26 23:50:02 +0000
81+++ libgearman-server/struct/io.h 2013-07-06 09:39:28 +0000
82@@ -94,6 +94,9 @@
83 char recv_buffer[GEARMAND_RECV_BUFFER_SIZE];
84
85 gearmand_io_st() { }
86+
87+ const char* host() const;
88+ const char* port() const;
89 };
90
91 namespace gearmand { namespace protocol {class Context; } }
92@@ -151,6 +154,26 @@
93 {
94 }
95
96+ const char* host() const
97+ {
98+ if (_host)
99+ {
100+ return _host;
101+ }
102+
103+ return "-";
104+ }
105+
106+ const char* port() const
107+ {
108+ if (_port)
109+ {
110+ return _port;
111+ }
112+
113+ return "-";
114+ }
115+
116 void set_protocol(gearmand::protocol::Context* arg)
117 {
118 protocol= arg;
119
120=== modified file 'tests/libgearman-1.0/gearman_execute_partition.cc'
121--- tests/libgearman-1.0/gearman_execute_partition.cc 2013-03-29 07:43:50 +0000
122+++ tests/libgearman-1.0/gearman_execute_partition.cc 2013-07-06 09:39:28 +0000
123@@ -127,6 +127,7 @@
124 test_return_t gearman_execute_partition_basic(void *object)
125 {
126 gearman_client_st *client= (gearman_client_st *)object;
127+ ASSERT_TRUE(client);
128
129 ASSERT_EQ(GEARMAN_SUCCESS,
130 gearman_client_echo(client, test_literal_param("this is mine")));

Subscribers

People subscribed via source and target branches

to all changes: