Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lib http client #697

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix missing include
  • Loading branch information
leoparente committed Oct 20, 2023
commit a51096e795107a749fa05fad71c382df28e69a7f
15 changes: 10 additions & 5 deletions libs/visor_http_client/httpssession.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
#pragma once

#include <unordered_map>
#include <vector>

#include <nghttp2/nghttp2.h>
#include <openssl/err.h>
#include <openssl/ssl.h>

#include "base64.h"
#include "target.h"
#include "tcpsession.h"
#include "url_parser.h"

struct Target {
http_parser_url *parsed;
std::string address;
std::string uri;
};

enum class HTTPMethod {
POST,
GET,
};


struct http2_stream_data {
http2_stream_data(std::string _scheme, std::string _authority, std::string _path, int32_t _id, std::string _data)
: scheme(_scheme)
Expand Down Expand Up @@ -71,11 +76,11 @@ class HTTPSSession : public TCPSession

int session_receive();

virtual void close();
void close() override;

virtual void receive_data(const char data[], size_t len);
void receive_data(const char data[], size_t len) override;

virtual void write(std::unique_ptr<char[]> data, size_t len);
void write(std::unique_ptr<char[]> data, size_t len) override;

void process_receive(const uint8_t *data, size_t len);

Expand Down
11 changes: 0 additions & 11 deletions libs/visor_http_client/target.h

This file was deleted.

1 change: 0 additions & 1 deletion libs/visor_http_client/test_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#endif

#include "httpssession.h"
#include "target.h"

void connect_tcp_events(std::shared_ptr<uvw::tcp_handle> tcp_handle, std::shared_ptr<TCPSession> tcp_session)
{
Expand Down
Loading