fix some bug
This commit is contained in:
parent
22fd0dfea3
commit
d02eb2e69c
@ -17,6 +17,7 @@ Server OPTION and arguments:
|
||||
Client option and arguments:
|
||||
- `-b` or `--benchmark` :benchmark mode
|
||||
- `-nv` or `--no-verbose` :no progress bar
|
||||
- `-t [number]` or `--thread [number]` :set to thread number.
|
||||
|
||||
Available macro:
|
||||
|
||||
|
2
client.c
2
client.c
@ -286,7 +286,6 @@ void * WorkerProc(void * args){
|
||||
filename = filename_buf;
|
||||
}
|
||||
pthread_mutex_unlock(&global_state.queueing_mutex);
|
||||
fprintf(stdout,"request %s\n",filename);
|
||||
|
||||
ret->retval += SendOpAndReceiveFile(filename,&arg->addr);
|
||||
ret->op_count++;
|
||||
@ -375,7 +374,6 @@ int main(int argc, const char *argv[]){
|
||||
if (t != 1) break;
|
||||
filename = filename_buf;
|
||||
}
|
||||
fprintf(stdout,"request %s\n",filename);
|
||||
retval += SendOpAndReceiveFile(filename,(struct sockaddr *)&addr);
|
||||
bench.op_count++;
|
||||
}
|
||||
|
4
server.c
4
server.c
@ -345,7 +345,7 @@ int main(int argc, const char *argv[]){
|
||||
char ip_buf[INET_ADDRSTRLEN];
|
||||
const char * msg = inet_ntop(AF_INET,&addr.sin_addr,ip_buf,sizeof(ip_buf));
|
||||
assert(msg != NULL);
|
||||
fprintf(stderr,"server bind on %s:%d\n",msg ,binding_port_number);
|
||||
fprintf(stdout,"server bind on %s:%d\n",msg ,binding_port_number);
|
||||
}
|
||||
|
||||
if(listen(sock,MAX_LISTEN_SOCKET) < 0){
|
||||
@ -357,7 +357,7 @@ int main(int argc, const char *argv[]){
|
||||
{
|
||||
char ip_buf[INET_ADDRSTRLEN];
|
||||
const char * msg = inet_ntop(AF_INET,&client_addr.sin_addr,ip_buf,sizeof(ip_buf));
|
||||
fprintf(stderr,"Connected on : %s:%d\n",msg == NULL ? "(null)" : msg , ntohs(addr.sin_port));
|
||||
fprintf(stdout,"Connected on : %s:%d\n",msg == NULL ? "(null)" : msg , ntohs(addr.sin_port));
|
||||
for(;;){
|
||||
pthread_mutex_lock(&globalState.sock_mutex);
|
||||
if (queue_isfull(&globalState.socks)){
|
||||
|
Loading…
Reference in New Issue
Block a user