gearman with http, bad request line , gearmand die

Bug #1348865 reported by jiaofuyou on 2014-07-26
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Gearman
Undecided
Unassigned

Bug Description

gearmand -L 127.0.0.1 --http-port 8080 -r http

telnet 127.0.0.1 8080

input any content, like "aaa"

gearmand log, dont stop have:

bad request line aaa

to memory out

Related branches

chjgcn (chjgcn) wrote :

You can open file libgearman-server/plugins/protocol/http/protocol.cc , find 'bad request line:' and 'bad method:', then chang 'GEARMAND_SUCCESS' to 'GEARMAND_INVALID_PACKET' after them. This way is quick for this bug.

You can also use my patch file here, but the patch file contains other patches for bug fixes and/or better support of SSL connection, planed job and HTTP protocol. Read these links below for details:
    https://bugs.launchpad.net/gearmand/+bug/1338861
    https://bugs.launchpad.net/gearmand/+bug/1352411
    https://answers.launchpad.net/gearmand/+question/252097

jiaofuyou (jiaofuyou) wrote :

sorry, your gearmand-1.1.12.patch have some problem

gearman http POST reture is NULL

gearman log:

  DEBUG 2014-08-11 04:49:21.416779 [ 2 ] Sending HTTP response: Content-length:0 data_size:8 gearmand_command_t:WORK_COMPLETE response:OK -> libgearman-server/plugins/protocol/http/protocol.cc:172

data_size:8 //it is OK
Content-length:0 //it is Error

chjgcn (chjgcn) wrote :

I have posted a newer patch file in
    https://bugs.launchpad.net/gearmand/+bug/1352411/comments/4
and the protocol 'HTTP' will work perfectly,

jiaofuyou (jiaofuyou) wrote :
Download full text (22.4 KiB)

your newest gearmand patch file is where?

https://bugs.launchpad.net/gearmand/+bug/1348865/+attachment/4173483/+files/gearmand-1.1.12.patch

[root@localhost gearmand-1.1.12]# patch -p0 < ../gearmand-1.1.12.patch
patching file libgearman/add.cc
patching file libgearman/client.cc
patching file libgearman/client.hpp
patching file libgearman/command.cc
patching file libgearman/command.gperf
patching file libgearman/command.hpp
patching file libgearman/connection.cc
patching file libgearman/execute.cc
patching file libgearman/interface/universal.hpp
patching file libgearman/protocol/submit.cc
patching file libgearman/protocol/submit.h
patching file libgearman/run.cc
patching file libgearman/universal.cc
patching file libgearman/universal.hpp
patching file libgearman/worker.cc
patching file libgearman/worker.hpp
patching file libgearman-1.0/client.h
patching file libgearman-1.0/protocol.h
patching file libgearman-1.0/worker.h
patching file libgearman-server/function.cc
patching file libgearman-server/gearmand.cc
patching file libgearman-server/gearmand_con.cc
patching file libgearman-server/io.cc
patching file libgearman-server/job.cc
patching file libgearman-server/job.h
patching file libgearman-server/plugins/protocol/gear/protocol.cc
patching file libgearman-server/plugins/protocol/http/protocol.cc
patching file libgearman-server/plugins/queue/mysql/queue.cc
patching file libgearman-server/server.cc
patching file libgearman-server/struct/function.h
patching file libgearman-server/struct/job.h
patching file libgearman-server/struct/server.h
patching file tests/libgearman-1.0/protocol.cc
patching file util/instance.cc

--- ...

chjgcn (chjgcn) wrote :

add the line below into libgearman/check.cc :
#include <cstring>

chjgcn (chjgcn) wrote :

The <cstring> header file should be added in to libgearman/interface/universal.hpp .
The patch file posted here also contains other bug fixes and functionality enhancements which may be usefull for you.

palik (1-infe-w) wrote :

Is currently anyone working on gearman 1.1.12? Last commit was done on 2014-02-15 21:44:23
The patched bug fixes are not in http://bazaar.launchpad.net/~tangent-trunk/gearmand/1.2/
Is it any other branch?

palik (1-infe-w) on 2014-12-15
description: updated
palik (1-infe-w) wrote :

gearman 1.0 contains the bug too.
bug fixing proposed in
https://code.launchpad.net/~1-infe-w/gearmand/1.0/+merge/244981

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers