Reland r276815: Add tests for session cache and false start behavior.

Was speculatively reverted in https://codereview.chromium.org/332523008/, but
it does not appear to be the cause. (ssl_client_socket_unittest.cc is unrelated
and tlslite is only used in test server. ChromeAsyncSocketTest does not appear
to use the test server. Rather they use mock sockets.

Original description:

False start should not disable the session cache, but if we never process the
server Finished message, the session cannot be resumed.

BUG=none

Original review URL: https://codereview.chromium.org/301283004

Review URL: https://codereview.chromium.org/337773003

git-svn-id: http://src.chromium.org/svn/trunk/src/third_party/tlslite@277206 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/README.chromium b/README.chromium
index 029c2db..5487bfc 100644
--- a/README.chromium
+++ b/README.chromium
@@ -33,3 +33,5 @@
 - patches/dhe_rsa.patch: Implement DHE_RSA-based cipher suites.
 - patches/req_cert_types.patch: Add a reqCertTypes parameter to populate the
   certificate_types field of CertificateRequest.
+- patches/ignore_write_failure.patch: Don't invalidate sessions on write
+  failures.
diff --git a/patches/ignore_write_failure.patch b/patches/ignore_write_failure.patch
new file mode 100644
index 0000000..169e4d5
--- /dev/null
+++ b/patches/ignore_write_failure.patch
@@ -0,0 +1,15 @@
+diff --git a/third_party/tlslite/tlslite/tlsrecordlayer.py b/third_party/tlslite/tlslite/tlsrecordlayer.py
+index 8b92221..370dc9a 100644
+--- a/third_party/tlslite/tlslite/tlsrecordlayer.py
++++ b/third_party/tlslite/tlslite/tlsrecordlayer.py
+@@ -286,7 +286,9 @@ class TLSRecordLayer(object):
+         except GeneratorExit:
+             raise
+         except Exception:
+-            self._shutdown(False)
++            # Don't invalidate the session on write failure if abrupt closes are
++            # okay.
++            self._shutdown(self.ignoreAbruptClose)
+             raise
+ 
+     def close(self):
diff --git a/tlslite/tlsrecordlayer.py b/tlslite/tlsrecordlayer.py
index 8b92221..370dc9a 100644
--- a/tlslite/tlsrecordlayer.py
+++ b/tlslite/tlsrecordlayer.py
@@ -286,7 +286,9 @@
         except GeneratorExit:
             raise
         except Exception:
-            self._shutdown(False)
+            # Don't invalidate the session on write failure if abrupt closes are
+            # okay.
+            self._shutdown(self.ignoreAbruptClose)
             raise
 
     def close(self):