static int handle_router( char* words[] );
/* utility method for print time data */
-/* static int handle_time( char* words[] ); */
+static int handle_time( char* words[] );
/* handles app level requests */
static int handle_request( char* words[], int relay );
if( !strcmp(words[0],"router") )
ret_val = handle_router( words );
- /*
else if( !strcmp(words[0],"time") )
ret_val = handle_time( words );
- */
else if (!strcmp(words[0],"request"))
ret_val = handle_request( words, 0 );
}
-/*
static int handle_time( char* words[] ) {
-
- if( ! words[1] ) {
-
- char buf[36];
- memset(buf,0,36);
- get_timestamp(buf);
- printf( "%s\n", buf );
- return 1;
- }
-
- if( words[1] ) {
- time_t epoch = (time_t)atoi( words[1] );
- char* localtime = strdup( ctime( &epoch ) );
- printf( "%s => %s", words[1], localtime );
- free(localtime);
- return 1;
- }
-
- return 0;
-
+ if(!words[1]) {
+ printf("%f\n", get_timestamp_millis());
+ } else {
+ time_t epoch = (time_t) atoi(words[1]);
+ printf("%s", ctime(&epoch));
+ }
+ return 1;
}
-*/