Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 31a8a25

Browse files
Tianyi Chenapavlo
authored andcommitted
formatting
1 parent c3f2f72 commit 31a8a25

File tree

5 files changed

+101
-91
lines changed

5 files changed

+101
-91
lines changed

src/include/network/connection_handle.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#pragma once
14-
#include <unordered_map>
1514
#include <event2/buffer.h>
1615
#include <event2/bufferevent.h>
1716
#include <event2/event.h>
1817
#include <event2/listener.h>
18+
#include <unordered_map>
1919

2020
#include <csignal>
2121
#include <cstdio>
@@ -30,13 +30,13 @@
3030
#include "common/exception.h"
3131
#include "common/logger.h"
3232

33-
#include "network/connection_handler_task.h"
34-
#include "protocol_handler.h"
3533
#include "marshal.h"
34+
#include "network/connection_handler_task.h"
3635
#include "network_state.h"
36+
#include "protocol_handler.h"
3737

38-
#include <openssl/ssl.h>
3938
#include <openssl/err.h>
39+
#include <openssl/ssl.h>
4040

4141
namespace peloton {
4242
namespace network {
@@ -58,7 +58,6 @@ namespace network {
5858
*/
5959
class ConnectionHandle {
6060
public:
61-
6261
/**
6362
* Update the existing event to listen to the passed flags
6463
*/
@@ -212,12 +211,11 @@ class ConnectionHandle {
212211
bool ssl_handshake_ = false;
213212
bool finish_startup_packet_ = false;
214213
bool ssl_able_;
215-
214+
216215
// TODO(Tianyi) hide this in protocol handler
217216
InputPacket initial_packet_;
218217

219-
short curr_event_flag_; // current libevent event flag
220-
218+
short curr_event_flag_; // current libevent event flag
221219
};
222-
}
223-
}
220+
} // namespace network
221+
} // namespace peloton

src/include/network/postgres_protocol_handler.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
#include <vector>
2020

2121
#include "common/cache.h"
22+
#include "common/internal_types.h"
2223
#include "common/portal.h"
2324
#include "common/statement.h"
2425
#include "common/statement_cache.h"
25-
#include "traffic_cop/traffic_cop.h"
2626
#include "protocol_handler.h"
27-
#include "common/internal_types.h"
27+
#include "traffic_cop/traffic_cop.h"
2828

2929
// Packet content macros
3030
#define NULL_CONTENT_SIZE -1
@@ -78,13 +78,15 @@ class PostgresProtocolHandler : public ProtocolHandler {
7878
static bool ReadPacket(Buffer &rbuf, InputPacket &rpkt);
7979

8080
/* Routine to deal with the first packet from the client */
81-
bool ProcessInitialPackets(InputPacket* pkt, Client client, bool ssl_able, bool& ssl_sent, bool& finish_startup_packet);
81+
bool ProcessInitialPackets(InputPacket *pkt, Client client, bool ssl_able,
82+
bool &ssl_sent, bool &finish_startup_packet);
8283

8384
/* Routine to deal with SSL request message */
84-
void ProcessSSLRequestPacket(bool ssl_able, bool& ssl_handshake);
85+
void ProcessSSLRequestPacket(bool ssl_able, bool &ssl_handshake);
8586

8687
/* Routine to deal with general Startup message */
87-
bool ProcessStartupPacket(InputPacket* pkt, int32_t proto_version, Client client, bool& finish_startup_packet);
88+
bool ProcessStartupPacket(InputPacket *pkt, int32_t proto_version,
89+
Client client, bool &finish_startup_packet);
8890

8991
bool GetFinishedStartupPacket();
9092

@@ -111,7 +113,7 @@ class PostgresProtocolHandler : public ProtocolHandler {
111113

112114
// Used to send a packet that indicates the completion of a query. Also has
113115
// txn state mgmt
114-
void CompleteCommand(const QueryType& query_type, int rows);
116+
void CompleteCommand(const QueryType &query_type, int rows);
115117

116118
// Specific response for empty or NULL queries
117119
void SendEmptyQueryResponse();

src/include/network/protocol_handler.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
#pragma once
1414

15-
#include "traffic_cop/traffic_cop.h"
16-
#include "marshal.h"
1715
#include "common/internal_types.h"
16+
#include "marshal.h"
17+
#include "traffic_cop/traffic_cop.h"
1818
// Packet content macros
1919

2020
namespace peloton {
@@ -36,7 +36,9 @@ class ProtocolHandler {
3636
// bool ManageStartupPacket();
3737
virtual void SendInitialResponse();
3838

39-
virtual bool ProcessInitialPackets(InputPacket* pkt, Client client, bool ssl_able, bool& ssl_sent, bool& finish_startup_packet) = 0;
39+
virtual bool ProcessInitialPackets(InputPacket *pkt, Client client,
40+
bool ssl_able, bool &ssl_sent,
41+
bool &finish_startup_packet) = 0;
4042

4143
virtual ProcessResult Process(Buffer &rbuf, const size_t thread_id);
4244

0 commit comments

Comments
 (0)