rgw/civetweb.cc fixes, possibly superflous warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello *,

i had a hard time trying to get the civetweb part of radosgw running.
Symptoms are:
curl/wget/s3cmd work fine, all windows clients (CloudBerry and
S3-Browser) refuse to work.
They work fine with the apache<>fastcgi<>radosgw chain.

Looks like they wait for the "\r" in "\r\n" in the response line which
is missing for civetweb:

------------------------
diff --git a/src/rgw/rgw_civetweb.cc b/src/rgw/rgw_civetweb.cc
index a31177f..3396eac 100644
--- a/src/rgw/rgw_civetweb.cc
+++ b/src/rgw/rgw_civetweb.cc
@@ -128,7 +128,7 @@ int RGWMongoose::send_status(const char *status,
const char *status_name)
   if (!status_name)
     status_name = "";

-  snprintf(buf, sizeof(buf), "HTTP/1.1 %s %s\n", status, status_name);
+  snprintf(buf, sizeof(buf), "HTTP/1.1 %s %s\r\n", status, status_name);

   bufferlist bl;
   bl.append(buf);
@@ -168,5 +168,5 @@ int RGWMongoose::send_content_length(uint64_t len)
   has_content_length = true;
   char buf[21];
   snprintf(buf, sizeof(buf), "%"PRIu64, len);
-  return print("Content-Length: %s\n", buf);
+  return print("Content-Length: %s\r\n", buf);
 }

------------------------

I couldn't test the patch but let instead haproxy insert the missing
\r and now it
works for those windows clients.

Another thing i noticed is that there's this line:
----------------------------
rgw_main.cc
index 9614b07..115697c 100644
@@ -1124,7 +1124,7 @@ int main(int argc, const char **argv)
       string err;

       int port;
      config->get_val("port", 80, &port);

------------------------

here it warns about my config because "port" is a string. Later, this
is again fetched
from the config but this time as a string and fed to

------------------------------------
class RGWMongooseFrontend : public RGWFrontend {
[...]
    conf->get_val("port", "80", &port_str);
    const char *options[] = {"listening_ports", port_str.c_str(),
"enable_keep_alive", "yes", "num_threads", thread_pool_buf, NULL};
------------------------------------
I (we?) want this to be a string to be able to bind it to specific ips?
(i.e. "rgw frontends = civetweb port=127.0.0.1:2081")

I dunno if you need the port as an integer in the env object.

Thx & Cheers

 Benedikt
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux