Browse Source

I think I tracked down the bug... I'll fix it tomorrow

master
David Lanzendörfer 7 months ago
parent
commit
515f833785
9 changed files with 21 additions and 24 deletions
  1. +3
    -3
      pep-server.cpp
  2. +1
    -3
      server.cpp
  3. +5
    -9
      tests.cpp
  4. +1
    -1
      types/pEpDBusEncryptionFlags.h
  5. +6
    -4
      types/pEpDBusMessage.cpp
  6. +1
    -1
      types/pEpDBusMessage.h
  7. +1
    -1
      types/pEpDBusRating.h
  8. +2
    -1
      types/pEpDBusStatus.h
  9. +1
    -1
      types/pEpDBusStringList.h

+ 3
- 3
pep-server.cpp View File

@ -11,10 +11,8 @@
#include "pep-server.h"
static const char *ASYNC_SERVER_PATH = "/security/pep";
pEp::Server::Server(DBus::Connection &connection)
: DBus::ObjectAdaptor(connection, ASYNC_SERVER_PATH)
: DBus::ObjectAdaptor(connection, "/security/pep")
{
}
@ -24,6 +22,8 @@ pEp::Server::~Server()
void pEp::Server::send_test(const pEpDBusMessage& src)
{
std::cout << "Got something" << std::endl;
return;
}
void pEp::Server::decrypt_message(const pEpDBusMessage& src, const pEpDBusStringList& keylist, const pEpDBusRating& rating,


+ 1
- 3
server.cpp View File

@ -4,8 +4,6 @@
#include <signal.h>
static const char *ASYNC_SERVER_NAME = "security.pep";
DBus::BusDispatcher dispatcher;
void niam(int sig)
@ -21,7 +19,7 @@ int main()
DBus::default_dispatcher = &dispatcher;
DBus::Connection conn = DBus::Connection::SessionBus();
conn.request_name(ASYNC_SERVER_NAME);
conn.request_name("security.pep");
pEp::Server server(conn);


+ 5
- 9
tests.cpp View File

@ -6,9 +6,9 @@ int main()
{
DBus::default_dispatcher = &dispatcher;
DBus::Connection conn = DBus::Connection::SessionBus();
pEp::Client *client = new pEp::Client(conn, "/security/pep", "security.pep");
pEp::Client client(conn, "/security/pep", "security.pep");
/*message m;
message m;
pEp_identity from;
from.address="leviathan@libresilicon.com";
m.from=&from;
@ -19,13 +19,9 @@ int main()
pEpDBusEncryptionFlags flags;
pEpDBusStatus status;
src.clear();
src << m;*/
src << m;
//client.decrypt_message(src,keylist,rating,flags,status,dst);
//client.send_test(src);
for(int i=0; i<100; i++){
std::cout << i << std::endl;
client->send_test();
}
//dst >> m;
client.send_test(src);
dst >> m;
return 0;
}

+ 1
- 1
types/pEpDBusEncryptionFlags.h View File

@ -7,7 +7,7 @@ class pEpDBusEncryptionFlags : public DBus::Variant
{
public:
pEpDBusEncryptionFlags();
std::string signature() { return "s"; }
const DBus::Signature signature() const { return "s"; }
friend DBus::Variant& operator<<(DBus::Variant&, const pEpDBusEncryptionFlags&);
};


+ 6
- 4
types/pEpDBusMessage.cpp View File

@ -12,18 +12,20 @@ pEpDBusMessage::pEpDBusMessage(message m)
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusMessage&)
{
DBus::Variant ret;
// TODO Copy the writer over to the other variant
return ret;
}
message& pEpDBusMessage::operator >> (message&)
message& pEpDBusMessage::operator >> (message &m)
{
message m;
//m.from->address << reader();
return m;
}
message& pEpDBusMessage::operator << (message&)
message& pEpDBusMessage::operator << (message &m)
{
message m;
writer().append_string("test");
//writer().append_string(m.from->address);
return m;
}

+ 1
- 1
types/pEpDBusMessage.h View File

@ -14,7 +14,7 @@ public:
message& operator >> (message&);
message& operator << (message&);
std::string signature() { return "s"; }
const DBus::Signature signature() const { return "b"; }
friend DBus::Variant& operator << (DBus::Variant&, const pEpDBusMessage&);
};


+ 1
- 1
types/pEpDBusRating.h View File

@ -7,7 +7,7 @@ class pEpDBusRating : public DBus::Variant
{
public:
pEpDBusRating();
std::string signature() { return "s"; }
const DBus::Signature signature() const { return "s"; }
friend DBus::Variant& operator<<(DBus::Variant&, const pEpDBusRating&);
};


+ 2
- 1
types/pEpDBusStatus.h View File

@ -11,7 +11,8 @@ public:
pEpDBusStatus();
pEpDBusStatus(PEP_STATUS);
std::string signature() { return "s"; }
const DBus::Signature signature() const { return "s"; }
friend DBus::Variant& operator<<(DBus::Variant&, const pEpDBusStatus&);
};


+ 1
- 1
types/pEpDBusStringList.h View File

@ -7,7 +7,7 @@ class pEpDBusStringList : public DBus::Variant
{
public:
pEpDBusStringList();
std::string signature() { return "s"; }
const DBus::Signature signature() const { return "s"; }
friend DBus::Variant& operator<<(DBus::Variant&, const pEpDBusStringList&);
};


Loading…
Cancel
Save