Merge lp:~1-infe-w/gearmand/gearmand into lp:gearmand

Proposed by palik on 2015-09-15
Status: Needs review
Proposed branch: lp:~1-infe-w/gearmand/gearmand
Merge into: lp:gearmand
Diff against target: 84 lines (+16/-8)
3 files modified
docs/Makefile (+3/-0)
libgearman-server/plugins/protocol/http/protocol.cc (+8/-6)
libgearman-server/plugins/queue/libmemcached/queue.cc (+5/-2)
To merge this branch: bzr merge lp:~1-infe-w/gearmand/gearmand
Reviewer Review Type Date Requested Status
Tangent Trunk 2015-09-15 Pending
Review via email: mp+271083@code.launchpad.net

Description of the change

HTTP POST result without content.
Same as
https://code.launchpad.net/~1-infe-w/gearmand/1.0/+merge/244981

To post a comment you must log in.
lp:~1-infe-w/gearmand/gearmand updated on 2015-09-15
911. By palik on 2015-09-15

bad request line, or bad http method kills gearmand

palik (1-infe-w) wrote :

gearmand can be killed by unknown HTTP method or malicious request

#1348865
r911

Unmerged revisions

911. By palik on 2015-09-15

bad request line, or bad http method kills gearmand

910. By palik on 2015-09-15

bug fix: HTTP Request yields Response with empty content

909. By palik on 2015-05-29

LibmemcachedQueue::done mecache_delete returns MEMCACHED_NOTFOUND; callback_loader dangerous unique_size assertion

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/Makefile'
--- docs/Makefile 2014-02-16 02:15:49 +0000
+++ docs/Makefile 2015-09-15 13:29:21 +0000
@@ -198,3 +198,6 @@
198 $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml198 $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
199 @echo199 @echo
200 @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."200 @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
201
202install:
203
201204
=== modified file 'libgearman-server/plugins/protocol/http/protocol.cc'
--- libgearman-server/plugins/protocol/http/protocol.cc 2013-07-07 00:16:26 +0000
+++ libgearman-server/plugins/protocol/http/protocol.cc 2015-09-15 13:29:21 +0000
@@ -157,6 +157,9 @@
157 case GEARMAN_COMMAND_WORK_FAIL:157 case GEARMAN_COMMAND_WORK_FAIL:
158 case GEARMAN_COMMAND_ECHO_RES:158 case GEARMAN_COMMAND_ECHO_RES:
159 case GEARMAN_COMMAND_WORK_COMPLETE:159 case GEARMAN_COMMAND_WORK_COMPLETE:
160 {
161 ret_ptr = GEARMAND_SUCCESS;
162 }
160 break;163 break;
161164
162 case GEARMAN_COMMAND_JOB_CREATED:165 case GEARMAN_COMMAND_JOB_CREATED:
@@ -215,14 +218,13 @@
215 "HTTP/1.0 200 OK\r\n"218 "HTTP/1.0 200 OK\r\n"
216 "X-Gearman-Job-Handle: %.*s\r\n"219 "X-Gearman-Job-Handle: %.*s\r\n"
217 "X-Gearman-Command: %s\r\n"220 "X-Gearman-Command: %s\r\n"
218 "Content-Length: %d\r\n"221 "Content-Length: %" PRIu64 "\r\n"
219 "Server: Gearman/" PACKAGE_VERSION "\r\n"222 "Server: Gearman/" PACKAGE_VERSION "\r\n"
220 "\r\n%.*s",223 "\r\n",
221 packet->command == GEARMAN_COMMAND_JOB_CREATED ? int(packet->arg_size[0]) : int(packet->arg_size[0] - 1),224 packet->command == GEARMAN_COMMAND_JOB_CREATED ? int(packet->arg_size[0]) : int(packet->arg_size[0] - 1),
222 (const char *)packet->arg[0], // Job handle225 (const char *)packet->arg[0], // Job handle
223 gearman_strcommand(packet->command),226 gearman_strcommand(packet->command),
224 int(content.size()), // Content-length227 (uint64_t)packet->data_size); // Content-length
225 int(content.size()), &content[0]);
226 }228 }
227 else229 else
228 {230 {
@@ -294,7 +296,7 @@
294 {296 {
295 gearmand_log_error(GEARMAN_DEFAULT_LOG_PARAM, "bad request line: %.*s", (uint32_t)request_size, request);297 gearmand_log_error(GEARMAN_DEFAULT_LOG_PARAM, "bad request line: %.*s", (uint32_t)request_size, request);
296 set_response(gearmand::protocol::httpd::HTTP_NOT_FOUND);298 set_response(gearmand::protocol::httpd::HTTP_NOT_FOUND);
297 ret_ptr= GEARMAND_SUCCESS;299 ret_ptr= GEARMAND_INVALID_PACKET;
298 return 0;300 return 0;
299 }301 }
300302
@@ -330,7 +332,7 @@
330 {332 {
331 gearmand_log_error(GEARMAN_DEFAULT_LOG_PARAM, "bad method: %.*s", (uint32_t)method_size, method_str);333 gearmand_log_error(GEARMAN_DEFAULT_LOG_PARAM, "bad method: %.*s", (uint32_t)method_size, method_str);
332 set_response(gearmand::protocol::httpd::HTTP_METHOD_NOT_ALLOWED);334 set_response(gearmand::protocol::httpd::HTTP_METHOD_NOT_ALLOWED);
333 ret_ptr= GEARMAND_SUCCESS;335 ret_ptr= GEARMAND_INVALID_PACKET;
334 return 0;336 return 0;
335 }337 }
336 }338 }
337339
=== modified file 'libgearman-server/plugins/queue/libmemcached/queue.cc'
--- libgearman-server/plugins/queue/libmemcached/queue.cc 2013-05-12 01:03:50 +0000
+++ libgearman-server/plugins/queue/libmemcached/queue.cc 2015-09-15 13:29:21 +0000
@@ -243,7 +243,10 @@
243 memcached_return rc= memcached_delete(memc_, (const char *)key, key_length, 0);243 memcached_return rc= memcached_delete(memc_, (const char *)key, key_length, 0);
244 if (rc != MEMCACHED_SUCCESS)244 if (rc != MEMCACHED_SUCCESS)
245 {245 {
246 return gearmand_gerror(memcached_last_error_message(memc_), GEARMAND_QUEUE_ERROR);246 if(rc != MEMCACHED_NOTFOUND)
247 {
248 return gearmand_gerror(memcached_strerror(memc_, rc), GEARMAND_QUEUE_ERROR);
249 }
247 }250 }
248251
249 return GEARMAND_SUCCESS;252 return GEARMAND_SUCCESS;
@@ -313,7 +316,7 @@
313 size_t unique_size= strlen(unique);316 size_t unique_size= strlen(unique);
314317
315 assert(unique);318 assert(unique);
316 assert(unique_size);319 //assert(unique_size);
317 assert(function);320 assert(function);
318 assert(function_len);321 assert(function_len);
319322

Subscribers

People subscribed via source and target branches

to all changes: