proxygen
HTTPConstants.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 namespace proxygen {
13 
14 //enum class ConnectionCloseReason : unsigned int {
15 // SHUTDOWN, // shutdown...probably due to the short shutdown
16 // // time we won't be able to see any of this
17 // READ_EOF, // received FIN from client so the connection is
18 // // not reusable any more
19 // GOAWAY, // session closed due to ingress goaway
20 // SESSION_PARSE_ERROR, // http/spdy parse error
21 // REMOTE_ERROR, // The various 5xx error
22 // TRANSACTION_ABORT, // transaction sendAbort()
23 // TIMEOUT, // read/write timeout excluding shutdown
24 // IO_READ_ERROR, // read error
25 // IO_WRITE_ERROR, // write error
26 // REQ_NOTREUSABLE, // client request is not reusable (http 1.0 or
27 // // Connection: close)
28 // ERR_RESP, // various 4xx error
29 // UNKNOWN, // this probably indicate some bug that the close
30 // // reason is not accounted for
31 // kMAX_REASON
32 //};
33 
34 #define CONNECTION_CLOSE_REASON_GEN(x) \
35  x(SHUTDOWN, "shutdown") \
36  x(READ_EOF, "read_eof") \
37  x(GOAWAY, "goaway") \
38  x(SESSION_PARSE_ERROR, "session_parse_err") \
39  x(REMOTE_ERROR, "remote_err") \
40  x(TRANSACTION_ABORT, "transaction_abort") \
41  x(TIMEOUT, "timeout") \
42  x(IO_READ_ERROR, "io_read_err") \
43  x(IO_WRITE_ERROR, "io_write_err") \
44  x(REQ_NOTREUSABLE, "req_not_reusable") \
45  x(ERR_RESP, "err_resp") \
46  x(UNKNOWN, "unknown") \
47  x(FLOW_CONTROL, "flow_control") \
48  x(kMAX_REASON, "unset")
49 
50 #define CONNECTION_CLOSE_REASON_ENUM(e, r) e,
53 };
54 #undef CONNECTION_CLOSE_REASON_ENUM
55 
56 extern const char* getConnectionCloseReasonStringByIndex(unsigned int i);
58 
62 enum class UpgradeProtocol: int {
63  // We only support changing to TCP after CONNECT requests
64  TCP
65 };
66 
67 }
ConnectionCloseReason
Definition: HTTPConstants.h:51
const char * getConnectionCloseReasonString(ConnectionCloseReason r)
#define CONNECTION_CLOSE_REASON_GEN(x)
Definition: HTTPConstants.h:34
const char * getConnectionCloseReasonStringByIndex(unsigned int index)
#define CONNECTION_CLOSE_REASON_ENUM(e, r)
Definition: HTTPConstants.h:50