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

Unified Diff: net/socket/ssl_client_socket_mac.cc

Issue 160333: If a write is pending, just add it to the buffer. Don't trigger a second conc... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_mac.cc
===================================================================
--- net/socket/ssl_client_socket_mac.cc (revision 21838)
+++ net/socket/ssl_client_socket_mac.cc (working copy)
@@ -736,10 +736,21 @@
return status;
}
+ bool send_pending = !us->send_buffer_.empty();
+
if (data)
us->send_buffer_.insert(us->send_buffer_.end(),
static_cast<const char*>(data),
static_cast<const char*>(data) + *data_length);
+
+ if (send_pending) {
+ // If we have I/O in flight, just add the data to the end of the buffer and
+ // return to our caller. The existing callback will trigger the write of the
+ // new data when it sees that data remains in the buffer after removing the
+ // sent data.
+ return noErr;
wtc 2009/07/29 18:05:17 Perhaps you can reproduce the "always lie to our c
Avi (use Gerrit) 2009/07/29 18:22:41 Sure. We can't return would-block. The caller wan
+ }
+
int rv;
do {
scoped_refptr<IOBuffer> buffer = new IOBuffer(us->send_buffer_.size());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698