basic_client: lib
$(CC) $(CC_OPTS) $(EXE_LD_OPTS) basic_client.c -o $@
+test: lib
+ $(CC) $(CC_OPTS) $(EXE_LD_OPTS) test.c -o $@
+
+
# --- Libs -----------------------------------------------
lib:
remaining -= (int) (time(NULL) - start);
}
- info_handler("It took %d reads to grab this messag", counter);
}
/* again, see if there are any messages in the message queue */
void message_set_router_info( transport_message* msg, char* router_from,
char* router_to, char* router_class, char* router_command, int broadcast_enabled ) {
- msg->router_from = strdup(router_from);
- msg->router_to = strdup(router_to);
- msg->router_class = strdup(router_class);
- msg->router_command = strdup(router_command);
+ if(router_from)
+ msg->router_from = strdup(router_from);
+ else
+ msg->router_from = strdup("");
+
+ if(router_to)
+ msg->router_to = strdup(router_to);
+ else
+ msg->router_to = strdup("");
+
+ if(router_class)
+ msg->router_class = strdup(router_class);
+ else
+ msg->router_class = strdup("");
+
+ if(router_command)
+ msg->router_command = strdup(router_command);
+ else
+ msg->router_command = strdup("");
+
msg->broadcast = broadcast_enabled;
if( msg->router_from == NULL || msg->router_to == NULL ||