Add AsyncSocketExceptionType for early data rejection.
authorKyle Nekritz <knekritz@fb.com>
Wed, 27 Sep 2017 20:11:31 +0000 (13:11 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 27 Sep 2017 20:20:33 +0000 (13:20 -0700)
Summary: To be used to signal that data that was sent as TLS 1.3 early data was lost. This needs its own exception type as it requires special handling (ie it should usually be retried immediately).

Reviewed By: siyengar

Differential Revision: D5869914

fbshipit-source-id: ca0d8ef19cb991e9d6ffe0f8c99abfb03b748ce6

folly/io/async/AsyncSocketException.h

index 7732b56295505a111eb074fde051f3993930ed5e..19aecd2f4d52a9255b17d451f1fddae9c21ed892 100644 (file)
@@ -40,7 +40,8 @@ class AsyncSocketException : public std::runtime_error {
     SSL_ERROR = 12,
     COULD_NOT_BIND = 13,
     SASL_HANDSHAKE_TIMEOUT = 14,
-    NETWORK_ERROR = 15
+    NETWORK_ERROR = 15,
+    EARLY_DATA_REJECTED = 16,
   };
 
   AsyncSocketException(AsyncSocketExceptionType type,
@@ -100,6 +101,8 @@ class AsyncSocketException : public std::runtime_error {
         return "SASL handshake timeout";
       case NETWORK_ERROR:
         return "Network error";
+      case EARLY_DATA_REJECTED:
+        return "Early data rejected";
       default:
         return "(Invalid exception type)";
     }