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

Unified Diff: net/base/nss_memio.c

Issue 337823002: Stop attempting to write to transport sockets in NSS on failure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more comments Created 6 years, 6 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
Index: net/base/nss_memio.c
diff --git a/net/base/nss_memio.c b/net/base/nss_memio.c
index 77e35da2d550642e637a1059a49aa48a56316a28..570540337745da8ef37fa23a3c8c09f057417778 100644
--- a/net/base/nss_memio.c
+++ b/net/base/nss_memio.c
@@ -442,17 +442,21 @@ void memio_PutReadResult(memio_Private *secret, int bytes_read)
}
}
-void memio_GetWriteParams(memio_Private *secret,
- const char **buf1, unsigned int *len1,
- const char **buf2, unsigned int *len2)
+int memio_GetWriteParams(memio_Private *secret,
+ const char **buf1, unsigned int *len1,
+ const char **buf2, unsigned int *len2)
{
struct memio_buffer* mb = &((PRFilePrivate *)secret)->writebuf;
PR_ASSERT(mb->bufsize);
+ if (mb->last_err)
+ return mb->last_err;
+
*buf1 = &mb->buf[mb->head];
*len1 = memio_buffer_used_contiguous(mb);
*buf2 = mb->buf;
*len2 = memio_buffer_wrapped_bytes(mb);
+ return 0;
}
void memio_PutWriteResult(memio_Private *secret, int bytes_written)

Powered by Google App Engine
This is Rietveld 408576698