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

fix some typos (cosmetic) #9

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ap_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ap_server::implementation {

void set_config(ap_config_ptr &config) { ap_config_ = config; }

void set_handler(ap_handler_ptr hanlder) { ap_handler_ = hanlder; }
void set_handler(ap_handler_ptr handler) { ap_handler_ = handler; }

bool start() {
if (airplay_tcp_service_)
Expand Down Expand Up @@ -192,7 +192,7 @@ ap_server::~ap_server() {

void ap_server::set_config(ap_config_ptr &config) { impl_->set_config(config); }

void ap_server::set_handler(ap_handler_ptr &hanlder) { impl_->set_handler(hanlder); }
void ap_server::set_handler(ap_handler_ptr &handler) { impl_->set_handler(handler); }

bool aps::ap_server::start() { return impl_->start(); }

Expand Down
4 changes: 2 additions & 2 deletions src/network/xtxp_connection_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void request_route_table::register_request_route(const request_route_t &route) {
}
}

request_hanlder request_route_table::query_handler(const request &req, error_code &ec) {
request_handler request_route_table::query_handler(const request &req, error_code &ec) {
std::lock_guard<std::mutex> l(mtx_);

std::string scheme;
Expand All @@ -64,7 +64,7 @@ request_hanlder request_route_table::query_handler(const request &req, error_cod
scheme = req.scheme_version.substr(0, index);
}

request_hanlder handler;
request_handler handler;

auto it_scheme_method = route_table_.find(scheme);
if (it_scheme_method == route_table_.end()) {
Expand Down
8 changes: 4 additions & 4 deletions src/network/xtxp_connection_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ namespace network {
/// <summary>
///
/// </summary>
typedef std::function<void(const request &req, response &res)> request_hanlder;
typedef std::function<void(const request &req, response &res)> request_handler;

/// <summary>
/// path -> handler
/// </summary>
typedef std::map<std::string, request_hanlder> path_map;
typedef std::map<std::string, request_handler> path_map;

/// <summary>
/// method -> path table
Expand All @@ -57,7 +57,7 @@ struct request_route_s {
std::string scheme;
std::string method;
std::string path;
request_hanlder handler;
request_handler handler;
};
typedef request_route_s request_route_t;

Expand All @@ -80,7 +80,7 @@ class request_route_table {

void register_request_route(const request_route_t &route);

request_hanlder query_handler(const request &req, error_code &ec);
request_handler query_handler(const request &req, error_code &ec);

private:
route_table route_table_;
Expand Down
6 changes: 3 additions & 3 deletions src/service/ap_airplay_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ using namespace aps::service::details;

namespace aps {
namespace service {
ap_airplay_connection::ap_airplay_connection(asio::io_context &io_ctx, ap_config_ptr &config, ap_handler_ptr &hanlder,
ap_airplay_connection::ap_airplay_connection(asio::io_context &io_ctx, ap_config_ptr &config, ap_handler_ptr &handler,
tcp_service_weak_ptr service)
: xtxp_connection_base(io_ctx)
, session_id_(0)
, session_type_(unknown_session)
, start_pos_in_ms_(0)
, config_(config)
, handler_(hanlder)
, handler_(handler)
, service_(std::move(service))
, mirroring_session_handler_(nullptr)
, video_session_handler_(nullptr) {
Expand Down Expand Up @@ -1168,7 +1168,7 @@ ap_airplay_service::ap_airplay_service(ap_config_ptr &config, uint16_t port /*=

ap_airplay_service::~ap_airplay_service() = default;

void ap_airplay_service::set_handler(ap_handler_ptr &hanlder) { handler_ = hanlder; }
void ap_airplay_service::set_handler(ap_handler_ptr &handler) { handler_ = handler; }

tcp_connection_ptr ap_airplay_service::prepare_new_connection() {
return std::make_shared<ap_airplay_connection>(io_context(), config_, handler_, shared_from_this());
Expand Down
2 changes: 1 addition & 1 deletion src/service/ap_airplay_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class ap_airplay_service : public tcp_service_base, public std::enable_shared_fr

~ap_airplay_service();

void set_handler(ap_handler_ptr &hanlder);
void set_handler(ap_handler_ptr &handler);

protected:
virtual tcp_connection_ptr prepare_new_connection() override;
Expand Down
12 changes: 6 additions & 6 deletions src/service/ap_casting_event_connection_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ aps::service::ap_casting_event_connection_manager &ap_casting_event_connection_m

void ap_casting_event_connection_manager::insert(const std::string &id, xtxp_connection_base_weak_ptr p) {
std::lock_guard<std::mutex> l(mtx_);
even_connection_map_[id] = std::move(p);
event_connection_map_[id] = std::move(p);
}

void ap_casting_event_connection_manager::remove(const std::string &id) {
std::lock_guard<std::mutex> l(mtx_);
auto it = even_connection_map_.find(id);
if (it != even_connection_map_.end()) {
even_connection_map_.erase(it);
auto it = event_connection_map_.find(id);
if (it != event_connection_map_.end()) {
event_connection_map_.erase(it);
}
}

xtxp_connection_base_weak_ptr ap_casting_event_connection_manager::get(const std::string &id) {
std::lock_guard<std::mutex> l(mtx_);
auto it = even_connection_map_.find(id);
if (it != even_connection_map_.end()) {
auto it = event_connection_map_.find(id);
if (it != event_connection_map_.end()) {
return it->second;
}
return xtxp_connection_base_weak_ptr();
Expand Down
2 changes: 1 addition & 1 deletion src/service/ap_casting_event_connection_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ap_casting_event_connection_manager {
~ap_casting_event_connection_manager();

private:
event_connection_map even_connection_map_;
event_connection_map event_connection_map_;
std::mutex mtx_;
};

Expand Down
12 changes: 6 additions & 6 deletions src/service/ap_casting_media_data_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#if PERSIST_STREAM_DATA
#include <filesystem>
void create_serssion_folder(const std::string &session) { std::filesystem::create_directory(session); }
void create_session_folder(const std::string &session) { std::filesystem::create_directory(session); }

void create_resource_file(const std::string &session, const std::string &uri, const std::string &data) {
std::string fn = generate_file_name();
Expand Down Expand Up @@ -69,7 +69,7 @@ bool ap_casting_media_data_store::request_media_data(const std::string &primary_

if (id != e_app_unknown) {
#if PERSIST_STREAM_DATA
create_serssion_folder(session_id);
create_session_folder(session_id);
#endif
app_id_ = id;
session_id_ = session_id;
Expand Down Expand Up @@ -110,10 +110,10 @@ std::string ap_casting_media_data_store::process_media_data(const std::string &u
media_data = adjust_primary_media_data(data);
} else {
// Adjust the secondary media data and cache it
media_data = adjust_secondary_meida_data(data);
media_data = adjust_secondary_media_data(data);
}

std::string path = extrac_uri_path(uri);
std::string path = extract_uri_path(uri);

if (!path.empty() && !media_data.empty()) {
add_media_data(path, media_data);
Expand Down Expand Up @@ -236,7 +236,7 @@ std::string ap_casting_media_data_store::adjust_primary_uri(const std::string &u
return s;
}

std::string ap_casting_media_data_store::extrac_uri_path(const std::string &uri) {
std::string ap_casting_media_data_store::extract_uri_path(const std::string &uri) {
std::string s = uri;
switch (app_id_) {
case e_app_youtube:
Expand Down Expand Up @@ -266,7 +266,7 @@ std::string ap_casting_media_data_store::adjust_primary_media_data(const std::st
return data;
}

std::string ap_casting_media_data_store::adjust_secondary_meida_data(const std::string &data) {
std::string ap_casting_media_data_store::adjust_secondary_media_data(const std::string &data) {
std::string result = data;

static std::regex youtube_pattern("#YT-EXT-CONDENSED-URL:BASE-URI=\"(.*)\",PARAMS=.*PREFIX=\"(.*)\"");
Expand Down
4 changes: 2 additions & 2 deletions src/service/ap_casting_media_data_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ class ap_casting_media_data_store {

std::string adjust_primary_uri(const std::string &uri);

std::string extrac_uri_path(const std::string &uri);
std::string extract_uri_path(const std::string &uri);

std::string adjust_primary_media_data(const std::string &data);

static std::string adjust_secondary_meida_data(const std::string &data);
static std::string adjust_secondary_media_data(const std::string &data);

// For Youtube
std::string adjust_mlhls_data(const std::string &data);
Expand Down
Loading