proxygen
HTTPConstants.cpp
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  */
11 
12 namespace proxygen {
13 
14 #define CONNECTION_CLOSE_REASON_STRING(e, r) r,
15 const char* connectionCloseStrings[] = {
17 };
18 #undef CONNECTION_CLOSE_REASON_STRING
19 
20 const char* getConnectionCloseReasonStringByIndex(unsigned int index) {
21  if (index >= (unsigned int)ConnectionCloseReason::kMAX_REASON) {
22  index = (unsigned int)ConnectionCloseReason::kMAX_REASON - 1;
23  }
24 
25  return connectionCloseStrings[index];
26 }
27 
29  return connectionCloseStrings[(unsigned int)r];
30 }
31 
32 }
ConnectionCloseReason
Definition: HTTPConstants.h:51
const char * getConnectionCloseReasonString(ConnectionCloseReason r)
#define CONNECTION_CLOSE_REASON_GEN(x)
Definition: HTTPConstants.h:34
const char * connectionCloseStrings[]
const char * getConnectionCloseReasonStringByIndex(unsigned int index)
#define CONNECTION_CLOSE_REASON_STRING(e, r)