summaryrefslogtreecommitdiffstats
path: root/net/base/nss_memio.h
diff options
context:
space:
mode:
authordavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-18 10:22:16 +0000
committerdavidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-18 10:22:16 +0000
commit33d66495fa95dcbb4f6ec46d76fc4f93983a4baf (patch)
tree66c40477753d0656c22d720d304f0cd858db13b8 /net/base/nss_memio.h
parentea3e171f4715b84d1fd42bfd954c66ceac5717fc (diff)
downloadchromium_src-33d66495fa95dcbb4f6ec46d76fc4f93983a4baf.zip
chromium_src-33d66495fa95dcbb4f6ec46d76fc4f93983a4baf.tar.gz
chromium_src-33d66495fa95dcbb4f6ec46d76fc4f93983a4baf.tar.bz2
Stop attempting to write to transport sockets in NSS on failure.
On failure, future transport writes should synchronously return. This is important on Chrome OS and Linux where we have a separate NSS task runner. If we query the transport each time (in hopes that it will return the error code) it becomes an asynchronous error and so the state machine keeps pumping itself in response to the state change. (It alternates between "write pending" and "write failed".) Add a test that asserts we do not keep trying to write to the transport in a loop. This fixes one of the infinite loops in bug #381160, but not the other. BUG=381160 Review URL: https://codereview.chromium.org/337823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/nss_memio.h')
-rw-r--r--net/base/nss_memio.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/base/nss_memio.h b/net/base/nss_memio.h
index 8481d15..b2b873b 100644
--- a/net/base/nss_memio.h
+++ b/net/base/nss_memio.h
@@ -79,12 +79,13 @@ int memio_GetReadableBufferSize(memio_Private *secret);
void memio_PutReadResult(memio_Private *secret, int bytes_read);
/* Ask memio what data it has to send to the network.
- * Returns up to two buffers of data by writing the positions and lengths into
- * |buf1|, |len1| and |buf2|, |len2|.
+ * If there was previous a write error, the NSPR error code is returned.
+ * Otherwise, it returns 0 and provides up to two buffers of data by
+ * writing the positions and lengths into |buf1|, |len1| and |buf2|, |len2|.
*/
-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);
/* Tell memio how many bytes were sent to the network.
* If bytes_written is < 0, it is treated as an NSPR error code.