[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-403
From: |
Giuseppe Scrivano |
Subject: |
[myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-403-gf4bbcce |
Date: |
Sun, 07 Nov 2010 13:30:09 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".
The branch, master has been updated
via f4bbcce36e335d416d77341aa3c14a4e28b802d1 (commit)
from a3bccbb22ef3f94797c8a82b85742d79cccf9815 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f4bbcce36e335d416d77341aa3c14a4e28b802d1
Author: Giuseppe Scrivano <address@hidden>
Date: Sun Nov 7 14:31:49 2010 +0100
Proxy: do not use chunked transfer encoding if the content-length is known.
diff --git a/myserver/src/http_handler/proxy/proxy.cpp
b/myserver/src/http_handler/proxy/proxy.cpp
index da8fa56..001dfa4 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -216,6 +216,8 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket&
client,
/* At this point we can modify the response struct before send it to the
client. */
checkDataChunks (td, &keepalive, &useChunks);
+ if (td->response.contentLength.length ())
+ useChunks = false;
td->response.setValue ("Connection", keepalive ? "keep-alive" : "close");
@@ -271,7 +273,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
bool keepalive,
string *serverTransferEncoding)
{
- u_long contentLength = 0;
+ size_t contentLength = 0;
size_t nbr = 0, nbw = 0, length = 0, inPos = 0;
u_long bufferDataSize = 0;
@@ -283,7 +285,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
if (res->contentLength.length ())
{
- contentLength = atol (res->contentLength.c_str ());
+ contentLength = atoll (res->contentLength.c_str ());
if (contentLength < 0)
return HttpDataHandler::RET_FAILURE;
}
@@ -313,10 +315,10 @@ int Proxy::readPayLoad (HttpThreadContext* td,
break;
HttpDataHandler::appendDataToHTTPChannel (td,
- td->buffer->getBuffer
(),
- nbr, &(td->outputData),
- out, td->appendOutputs,
- useChunks);
+ td->buffer->getBuffer
(),
+ nbr, &(td->outputData),
+ out, td->appendOutputs,
+ useChunks);
written += nbr;
}
}
diff --git a/myserver/src/protocol/http/http_headers.cpp
b/myserver/src/protocol/http/http_headers.cpp
index 9d00073..0733316 100644
--- a/myserver/src/protocol/http/http_headers.cpp
+++ b/myserver/src/protocol/http/http_headers.cpp
@@ -75,9 +75,9 @@ u_long HttpHeaders::buildHTTPResponseHeader (char *str,
*/
HttpResponseHeader::Entry *e = response->other.get ("transfer-encoding");
- if (!e || (e && e->value.find ("chunked", 0) == string::npos ))
+ if (!e || (e && e->value.find ("chunked", 0) == string::npos))
{
- pos += myserver_strlcpy (pos, "Content-length: ", MAX - (long)(pos -
str));
+ pos += myserver_strlcpy (pos, "Content-Length: ", MAX - (long)(pos -
str));
pos += myserver_strlcpy (pos, response->contentLength.c_str (),
MAX - (long)(pos - str));
pos += myserver_strlcpy (pos, "\r\n", MAX - (long)(pos - str));
-----------------------------------------------------------------------
Summary of changes:
myserver/src/http_handler/proxy/proxy.cpp | 14 ++++++++------
myserver/src/protocol/http/http_headers.cpp | 4 ++--
2 files changed, 10 insertions(+), 8 deletions(-)
hooks/post-receive
--
GNU MyServer
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-403-gf4bbcce,
Giuseppe Scrivano <=