File tree 1 file changed +19
-1
lines changed
third-party/thrift/src/thrift/lib/cpp2/transport/rocket/framing/parser
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ class AlignedParserStrategy {
109
109
110
110
std::unique_ptr<folly::IOBuf> createHeaderBuffer ();
111
111
std::unique_ptr<folly::IOBuf> createDataBuffer ();
112
+ std::unique_ptr<folly::IOBuf> createRequestResponseDataBuffer ();
113
+ std::unique_ptr<folly::IOBuf> createPayloadDataBuffer ();
112
114
113
115
void handleAwaitingHeader (size_t len);
114
116
@@ -133,10 +135,26 @@ std::unique_ptr<folly::IOBuf> AlignedParserStrategy<T>::createHeaderBuffer() {
133
135
}
134
136
135
137
template <typename T>
136
- std::unique_ptr<folly::IOBuf> AlignedParserStrategy<T>::createDataBuffer() {
138
+ std::unique_ptr<folly::IOBuf>
139
+ AlignedParserStrategy<T>::createRequestResponseDataBuffer() {
140
+ return folly::IOBuf::createCombined (remainingData_);
141
+ }
142
+
143
+ template <typename T>
144
+ std::unique_ptr<folly::IOBuf>
145
+ AlignedParserStrategy<T>::createPayloadDataBuffer() {
137
146
return folly::IOBuf::createCombined (remainingData_);
138
147
}
139
148
149
+ template <typename T>
150
+ std::unique_ptr<folly::IOBuf> AlignedParserStrategy<T>::createDataBuffer() {
151
+ if (frameType_ == FrameType::PAYLOAD) {
152
+ return createPayloadDataBuffer ();
153
+ } else {
154
+ return createRequestResponseDataBuffer ();
155
+ }
156
+ }
157
+
140
158
template <typename T>
141
159
void AlignedParserStrategy<T>::getReadBuffer(
142
160
void ** bufReturn, size_t * lenReturn) {
You can’t perform that action at this time.
0 commit comments