internet_address local_addr = internet_address
(internet_address::localhost(), client->stack().hostname(), 0);
open_common(local_addr); // open the common support for biz.
- _grabber.start(NIL); // crank up our background data pump on the socket.
+ _grabber.start(NULL_POINTER); // crank up our background data pump on the socket.
}
~cromp_client_record() {
// stops the background activity of this object and drops the connection
// to the client.
void croak() {
-// FUNCDEF("croak");
+ FUNCDEF("croak");
_grabber.stop();
int actions = 0;
while (get_incoming_data(actions)) {
bool saw_something = false; // true if we got a packet.
while (actions++ < MAXIMUM_ACTIONS_PER_CLIENT) {
// pull in anything waiting.
- infoton *item = NIL;
+ infoton *item = NULL_POINTER;
octopus_request_id req_id;
outcome ret = retrieve_and_restore_any(item, req_id,
first_one? DATA_AWAIT_TIMEOUT : 0);
_parent(parent) {}
void perform_activity(void *formal(ptr)) {
-// FUNCDEF("perform_activity");
+ FUNCDEF("perform_activity");
_parent.drop_dead_clients();
}
_parent(parent) {}
void perform_activity(void *formal(ptr)) {
-// FUNCDEF("perform_activity");
+ FUNCDEF("perform_activity");
_parent.look_for_clients(*this);
}
_accepting_threads(accepting_threads),
_dropper(new client_dropping_thread(*this)),
_enabled(false),
- _encrypt_arm(NIL),
+ _encrypt_arm(NULL_POINTER),
_default_security(new cromp_security),
- _security_arm(NIL)
+ _security_arm(NULL_POINTER)
{
-// FUNCDEF("constructor");
+ FUNCDEF("constructor");
}
cromp_server::~cromp_server()
WHACK(_where);
WHACK(_default_security);
WHACK(_list_lock);
- _encrypt_arm = NIL;
- _security_arm = NIL;
+ _encrypt_arm = NULL_POINTER;
+ _security_arm = NULL_POINTER;
}
internet_address cromp_server::location() const { return *_where; }
const octopus_entity &ent)
{
FUNCDEF("wrap_infoton");
- if (!_enabled) return NIL;
+ if (!_enabled) return NULL_POINTER;
// identity is not wrapped with encryption; we need to establish and identity
// to talk on a distinct channel with the server. even if that identity were
// compromised, the interloper should still not be able to listen in on the
// itself is not encrypted and we don't want to re-encrypt the wrapper.
if (dynamic_cast<identity_infoton *>(request)
|| dynamic_cast<encryption_infoton *>(request)
- || dynamic_cast<encryption_wrapper *>(request)) return NIL;
+ || dynamic_cast<encryption_wrapper *>(request)) return NULL_POINTER;
#ifdef DEBUG_CROMP_SERVER
LOG(astring("encrypting ") + request->text_form());
// lock here is released a bit down below.
if (!key) {
LOG(astring("failed to locate key for entity ") + ent.text_form());
- return NIL;
+ return NULL_POINTER;
}
byte_array packed_request;
infoton::fast_pack(packed_request, *request);
#endif
for (int i = 0; i < _accepting_threads; i++) {
// crank in a new thread and tell it yes on starting it.
- _accepters->add_thread(new connection_management_thread(*this), true, NIL);
+ _accepters->add_thread(new connection_management_thread(*this), true, NULL_POINTER);
}
- _dropper->start(NIL);
+ _dropper->start(NULL_POINTER);
return OKAY;
}
void cromp_server::disable_servers()
{
-// FUNCDEF("disable_servers");
+ FUNCDEF("disable_servers");
if (!_enabled) return;
_dropper->stop(); // signal the thread to leave when it can.
_accepters->stop_all(); // signal the accepting threads to exit.
bool cromp_server::disconnect_entity(const octopus_entity &id)
{
-// FUNCDEF("disconnect_entity");
+ FUNCDEF("disconnect_entity");
if (!_enabled) return false;
LOCK_LISTS;
int indy = _clients->find(id);
bool cromp_server::find_entity(const octopus_entity &id,
internet_address &found)
{
-// FUNCDEF("find_entity");
+ FUNCDEF("find_entity");
if (!_enabled) return false;
found = internet_address();
LOCK_LISTS;
FUNCDEF("accept_one_client");
#endif
if (!_enabled) return common::INCOMPLETE;
- spocket *accepted = NIL;
+ spocket *accepted = NULL_POINTER;
//printf((timestamp(true, true) + "into accept\n").s());
outcome ret = spock()->accept(accepted, wait);
//printf((timestamp(true, true) + "out of accept\n").s());
outcome cromp_server::get_from_client(const octopus_request_id &id,
infoton * &data, int timeout)
{
-// FUNCDEF("get_from_client");
+ FUNCDEF("get_from_client");
if (!_enabled) return common::INCOMPLETE;
//hmmm: this implementation locks the lists; can't we get the client to do
// most of the work for this?