Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1210)

Unified Diff: net/test/embedded_test_server/http_connection.cc

Issue 1421903008: Revert of SSL in EmbeddedTestServer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/embedded_test_server/http_connection.h ('k') | net/test/embedded_test_server/http_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/embedded_test_server/http_connection.cc
diff --git a/net/test/embedded_test_server/http_connection.cc b/net/test/embedded_test_server/http_connection.cc
index e60e9455dd143994eb03485acc6343586157ece2..83d2e9f4e562ec5bfaf579fae8bcfc75832256f0 100644
--- a/net/test/embedded_test_server/http_connection.cc
+++ b/net/test/embedded_test_server/http_connection.cc
@@ -6,6 +6,7 @@
#include "net/base/net_errors.h"
#include "net/socket/stream_socket.h"
+#include "net/test/embedded_test_server/http_response.h"
namespace net {
namespace test_server {
@@ -19,8 +20,9 @@
HttpConnection::~HttpConnection() {
}
-void HttpConnection::SendResponseBytes(const std::string& response_string,
- const SendCompleteCallback& callback) {
+void HttpConnection::SendResponse(scoped_ptr<HttpResponse> response,
+ const base::Closure& callback) {
+ const std::string response_string = response->ToResponseString();
if (response_string.length() > 0) {
scoped_refptr<DrainableIOBuffer> write_buf(new DrainableIOBuffer(
new StringIOBuffer(response_string), response_string.length()));
@@ -40,8 +42,6 @@
if (rv == ERR_IO_PENDING)
return;
- if (rv < 0)
- break;
buf->DidConsume(rv);
}
@@ -53,10 +53,6 @@
void HttpConnection::OnSendInternalDone(const base::Closure& callback,
scoped_refptr<DrainableIOBuffer> buf,
int rv) {
- if (rv < 0) {
- callback.Run();
- return;
- }
buf->DidConsume(rv);
SendInternal(callback, buf);
}
« no previous file with comments | « net/test/embedded_test_server/http_connection.h ('k') | net/test/embedded_test_server/http_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698