void my_stat_completion(int rc, const struct Stat *stat, const void *data) { fprintf(stderr, "%s: rc = %d Stat:\n", (char*)data, rc); dumpStat(stat); free((void*)data); if(batchMode) shutdownThisThing=1; }
void my_strings_stat_completion(int rc, const struct String_vector *strings, const struct Stat *stat, const void *data) { my_strings_completion(rc, strings, data); dumpStat(stat); if(batchMode) shutdownThisThing=1; }
void od_completion(int rc, const struct Stat *stat, const void *data) { int i; fprintf(stderr, "od command response: rc = %d Stat:\n", rc); dumpStat(stat); // send a whole bunch of requests recvd=0; sent=0; to_send=200; for (i=0; i<to_send; i++) { char buf[4096*16]; memset(buf, -1, sizeof(buf)-1); buf[sizeof(buf)-1]=0; sendRequest(buf); } }
void my_data_completion(int rc, const char *value, int value_len, const struct Stat *stat, const void *data) { struct timeval tv; int sec; int usec; gettimeofday(&tv, 0); sec = tv.tv_sec - startTime.tv_sec; usec = tv.tv_usec - startTime.tv_usec; fprintf(stderr, "time = %d msec\n", sec*1000 + usec/1000); fprintf(stderr, "%s: rc = %d\n", (char*)data, rc); if (value) { fprintf(stderr, " value_len = %d\n", value_len); assert(write(2, value, value_len) == value_len); } fprintf(stderr, "\nStat:\n"); dumpStat(stat); free((void*)data); if(batchMode) shutdownThisThing=1; }
void my_string_stat_completion(int rc, const char *name, const struct Stat *stat, const void *data) { my_string_completion(rc, name, data); dumpStat(stat); }