diff options
author | Gyuhwan Park <unstabler@unstabler.pl> | 2022-05-19 12:23:33 +0300 |
---|---|---|
committer | Gyuhwan Park <unstabler@unstabler.pl> | 2022-05-19 12:24:39 +0300 |
commit | 3479e00d4e9404fa1dcdbbf8305ca5cf7d7bdcc8 (patch) | |
tree | 31d90f91560974726a30f95961cf5ba892b14b2a | |
parent | ef2d1434460dba1550d9b016c452aa0221abe1db (diff) |
fix: use $HOME/.ulalaca_projector.sock as default path
-rw-r--r-- | ulalaca.cpp | 17 | ||||
-rw-r--r-- | ulalaca.hpp | 4 |
2 files changed, 17 insertions, 4 deletions
diff --git a/ulalaca.cpp b/ulalaca.cpp index 932e146..7196448 100644 --- a/ulalaca.cpp +++ b/ulalaca.cpp @@ -7,10 +7,11 @@ #endif #include <algorithm> +#include <chrono> +#include <functional> #include <iostream> +#include <sstream> #include <string> -#include <functional> -#include <chrono> #include "ulalaca.hpp" #include "SocketStream.hpp" @@ -112,11 +113,10 @@ int XrdpUlalaca::lib_mod_set_param(XrdpUlalaca *_this, const char *_name, const int XrdpUlalaca::lib_mod_connect(XrdpUlalaca *_this) { _this->serverMessage("establishing connection to SessionProjector", 0); - try { _this->_socket = std::make_unique<UnixSocket>( - "/Users/unstabler/ulalaca-projector.socket" + _this->getSessionSocketPath(_this->_username) ); _this->_socket->connect(); } catch (SystemCallException &e) { @@ -124,6 +124,8 @@ int XrdpUlalaca::lib_mod_connect(XrdpUlalaca *_this) { return 1; } + _this->_password.clear(); + _this->_projectionThread = std::make_unique<ProjectionThread>( *_this, *(_this->_socket) ); @@ -183,6 +185,13 @@ int XrdpUlalaca::lib_mod_server_version_message(XrdpUlalaca *_this) { return 0; } +std::string XrdpUlalaca::getSessionSocketPath(std::string &username) { + std::stringstream sstream; + sstream << "/Users/" << username << "/.ulalaca_projector.sock"; + + return sstream.str(); +} + int XrdpUlalaca::decideCopyRectSize() const { bool isRFXCodec = _clientInfo.rfx_codec_id != 0; bool isJPEGCodec = _clientInfo.jpeg_codec_id != 0; diff --git a/ulalaca.hpp b/ulalaca.hpp index 70eb28e..bac5248 100644 --- a/ulalaca.hpp +++ b/ulalaca.hpp @@ -185,6 +185,10 @@ public: static int lib_mod_server_monitor_full_invalidate(XrdpUlalaca *_this, int width, int height); static int lib_mod_server_version_message(XrdpUlalaca *_this); + + /* session-broker related */ + /** @deprecated */ + inline std::string getSessionSocketPath(std::string &username); /* paint related */ inline int decideCopyRectSize() const; |