-## $Id: Makefile.am,v 1.51 2006-08-29 10:06:31 marc Exp $
+## $Id: Makefile.am,v 1.52 2006-08-30 10:48:52 adam Exp $
MAINTAINERCLEANFILES = Makefile.in config.in config.hpp
filter_virt_db.cpp filter_virt_db.hpp \
filter_z3950_client.cpp filter_z3950_client.hpp \
gduutil.cpp gduutil.hpp \
- package.cpp package.hpp \
+ origin.cpp package.cpp package.hpp \
pipe.cpp pipe.hpp \
plainfile.cpp \
router.hpp router_chain.hpp router_chain.cpp \
-/* $Id: filter_frontend_net.cpp,v 1.20 2006-08-30 09:56:41 marc Exp $
+/* $Id: filter_frontend_net.cpp,v 1.21 2006-08-30 10:48:52 adam Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
m_no_requests = 0;
m_delete_flag = false;
m_package = package;
- // TODO why is m_origin not set here someplace ?? MC ??
+ const char *peername = PDU_Observable->getpeername();
+ if (!peername)
+ peername = "unknown";
+ m_origin.set_tcpip_address(std::string(peername), m_session.id());
}
--- /dev/null
+/* $Id: origin.cpp,v 1.1 2006-08-30 10:48:52 adam Exp $
+ Copyright (c) 2005-2006, Index Data.
+
+ See the LICENSE file for details
+ */
+
+
+#include "config.hpp"
+#include "package.hpp"
+
+#include <iostream>
+
+namespace mp = metaproxy_1;
+
+mp::Origin::Origin() : type(API)
+{
+ origin_id = 0;
+}
+
+void mp::Origin::set_tcpip_address(std::string addr, unsigned long s)
+{
+ address = addr;
+ origin_id = s;
+ type = TCPIP;
+}
+
+std::ostream& std::operator<<(std::ostream& os, mp::Origin& o)
+{
+ if (o.address != "")
+ os << o.address;
+ else
+ os << "0";
+ os << ":" << o.origin_id;
+ return os;
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * c-file-style: "stroustrup"
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
-/* $Id: package.cpp,v 1.14 2006-08-30 09:56:41 marc Exp $
+/* $Id: package.cpp,v 1.15 2006-08-30 10:48:52 adam Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
return os;
}
-std::ostream& std::operator<<(std::ostream& os, mp::Origin& o)
-{
- if (o.address != "")
- os << o.address;
- else
- os << "0";
- os << ":" << o.port;
- return os;
-}
-
/*
* Local variables:
-/* $Id: package.hpp,v 1.21 2006-08-30 09:56:41 marc Exp $
+/* $Id: package.hpp,v 1.22 2006-08-30 10:48:52 adam Exp $
Copyright (c) 2005-2006, Index Data.
See the LICENSE file for details
TCPIP
} type;
std::string address; // UNIX+TCPIP
- int port; // TCPIP only
+ unsigned long origin_id;
public:
- Origin() : type(API) {};
-
+ Origin();
+ void set_tcpip_address(std::string addr, unsigned long id);
};
class Package {