Apache Benchmark (ab) currently supports making requests only using HTTP/1.0 ( https://github.com/apache/httpd/blob/trunk/support/ab.c#L1886 ) Some proxies/sidecars used in Kubernetes (e.g. Envoy when installed by Istio) support only HTTP/1.1 (or 2) by default. It would be nice if there was a flag to enable HTTP/1.1 requests in ab. Is this something that would be acceptable for ab or is it completely out of scope?
(In reply to Andrei from comment #0) > Is this something that would be acceptable for ab or is it completely out of > scope? Sure, there could be for instance a command line "-1" option to control this. Would you propose a patch?
I've just tried now to create a PR ( https://github.com/apache/httpd/pull/173 ) but the change fails because C89/C90 style is (still) being used (e.g. https://travis-ci.com/github/apache/httpd/jobs/486139913 ) ab.c:1874:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const char *const http_version = http_spec == HTTP_1_1 ? "HTTP/1.1" : "HTTP/1.0"; ^~~~~ I would have preferred to use a const pointer, but that would mean to move all three initializations to the top of the function. Which solution is preferred? * move definitions and initialization at the top of the file * define at top, initialize just before apr_snprintf * inline again the initialization as arguments to the apr_snprintf function (I don't find this easily readable)
(In reply to Andrei from comment #2) > Which solution is > preferred? > > * move definitions and initialization at the top of the file > * define at top, initialize just before apr_snprintf > * inline again the initialization as arguments to the apr_snprintf function Move the const definitions with initializations at the top of the test() function? It seems that the initializations depend on globals only so there's no previous initialization in in the test() function itself which prevents that, unless I'm missing something..
If it's going to advertise HTTP/1.1 support, ab also needs to support HTTP/1.1 message syntax, e.g. chunked transfer-coding, which it doesn't currently, so surely this isn't as simple as changing the request-line.
(In reply to Yann Ylavic from comment #3) > Move the const definitions with initializations at the top of the test() > function? Yes, at the top of the function, not the method. (In reply to Joe Orton from comment #4) > If it's going to advertise HTTP/1.1 support, ab also needs to support > HTTP/1.1 message syntax, e.g. chunked transfer-coding, which it doesn't > currently, so surely this isn't as simple as changing the request-line. Yes, you're right. I was just thinking of my (simple) use case... :|