mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
Userland: Rename IPC ClientConnection => ConnectionFromClient
This was done with CLion's automatic rename feature and with: find . -name ClientConnection.h | rename 's/ClientConnection\.h/ConnectionFromClient.h/' find . -name ClientConnection.cpp | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
This commit is contained in:
parent
efac862570
commit
3a71748e5d
137 changed files with 896 additions and 896 deletions
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <SQLServer/ClientConnection.h>
|
||||
#include <SQLServer/ConnectionFromClient.h>
|
||||
#include <SQLServer/DatabaseConnection.h>
|
||||
#include <SQLServer/SQLStatement.h>
|
||||
|
||||
|
@ -30,7 +30,7 @@ DatabaseConnection::DatabaseConnection(String database_name, int client_id)
|
|||
, m_client_id(client_id)
|
||||
{
|
||||
if (LexicalPath path(m_database_name); (path.title() != m_database_name) || (path.dirname() != ".")) {
|
||||
auto client_connection = ClientConnection::client_connection_for(m_client_id);
|
||||
auto client_connection = ConnectionFromClient::client_connection_for(m_client_id);
|
||||
client_connection->async_connection_error(m_connection_id, (int)SQL::SQLErrorCode::InvalidDatabaseName, m_database_name);
|
||||
return;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ DatabaseConnection::DatabaseConnection(String database_name, int client_id)
|
|||
s_connections.set(m_connection_id, *this);
|
||||
deferred_invoke([this]() {
|
||||
m_database = SQL::Database::construct(String::formatted("/home/anon/sql/{}.db", m_database_name));
|
||||
auto client_connection = ClientConnection::client_connection_for(m_client_id);
|
||||
auto client_connection = ConnectionFromClient::client_connection_for(m_client_id);
|
||||
if (auto maybe_error = m_database->open(); maybe_error.is_error()) {
|
||||
client_connection->async_connection_error(m_connection_id, (int)SQL::SQLErrorCode::InternalError, maybe_error.error().string_literal());
|
||||
return;
|
||||
|
@ -59,7 +59,7 @@ void DatabaseConnection::disconnect()
|
|||
deferred_invoke([this]() {
|
||||
m_database = nullptr;
|
||||
s_connections.remove(m_connection_id);
|
||||
auto client_connection = ClientConnection::client_connection_for(client_id());
|
||||
auto client_connection = ConnectionFromClient::client_connection_for(client_id());
|
||||
if (client_connection)
|
||||
client_connection->async_disconnected(m_connection_id);
|
||||
else
|
||||
|
@ -70,7 +70,7 @@ void DatabaseConnection::disconnect()
|
|||
int DatabaseConnection::sql_statement(String const& sql)
|
||||
{
|
||||
dbgln_if(SQLSERVER_DEBUG, "DatabaseConnection::sql_statement(connection_id {}, database '{}', sql '{}'", connection_id(), m_database_name, sql);
|
||||
auto client_connection = ClientConnection::client_connection_for(client_id());
|
||||
auto client_connection = ConnectionFromClient::client_connection_for(client_id());
|
||||
if (!client_connection) {
|
||||
warnln("Cannot notify client of database disconnection. Client disconnected");
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue