examples: Remove unused lambda capture

This commit is contained in:
Tatsuhiro Tsujikawa 2018-04-03 22:07:02 +09:00
parent 2f9121cf44
commit 6f3ce2c72d
2 changed files with 5 additions and 5 deletions

View File

@ -67,14 +67,14 @@ int main(int argc, char *argv[]) {
return;
}
req->on_response([&sess](const response &res) {
req->on_response([](const response &res) {
std::cerr << "HTTP/2 " << res.status_code() << std::endl;
for (auto &kv : res.header()) {
std::cerr << kv.first << ": " << kv.second.value << "\n";
}
std::cerr << std::endl;
res.on_data([&sess](const uint8_t *data, std::size_t len) {
res.on_data([](const uint8_t *data, std::size_t len) {
std::cerr.write(reinterpret_cast<const char *>(data), len);
std::cerr << std::endl;
});

View File

@ -91,17 +91,17 @@ int main(int argc, char *argv[]) {
return;
}
req->on_response([&sess, req](const response &res) {
req->on_response([](const response &res) {
std::cerr << "response header was received" << std::endl;
print_header(res);
res.on_data([&sess](const uint8_t *data, std::size_t len) {
res.on_data([](const uint8_t *data, std::size_t len) {
std::cerr.write(reinterpret_cast<const char *>(data), len);
std::cerr << std::endl;
});
});
req->on_close([&sess](uint32_t error_code) {
req->on_close([](uint32_t error_code) {
std::cerr << "request done with error_code=" << error_code << std::endl;
});