Commit 6a58af36 authored by 's avatar
Browse files

comment out debugging printfs

git-svn-id: file:///home/svn/mapi/trunk@1204 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 608ab5ac
......@@ -126,7 +126,7 @@ int mapiipc_write(struct mapiipcbuf *qbuf){ // sends an IPC message to mapid
if(send(sock, qbuf, sizeof(struct mapiipcbuf), MSG_NOSIGNAL) == -1){
WARNING_CMD(printf("\nsend: %s [%s:%d]\n", strerror(errno), __FILE__, __LINE__));
//WARNING_CMD(printf("\nsend: %s [%s:%d]\n", strerror(errno), __FILE__, __LINE__));
#ifdef RECONNECT
offline_device *device = NULL;
......@@ -134,7 +134,7 @@ int mapiipc_write(struct mapiipcbuf *qbuf){ // sends an IPC message to mapid
flowdescr_t* flow = NULL;
functdescr_t *fun = NULL;
printf("\n ---> Mapid is down\n");
//printf("\n ---> Mapid is down\n");
restore_network_mapid();
mapi_create_offline_device_mapid();
......@@ -265,7 +265,7 @@ int mapiipc_remote_write(struct dmapiipcbuf *dbuf, struct host *h){ // sends an
// MSG_NOSIGNAL : requests not to send SIGPIPE on errors on stream oriented sockets when the other end breaks the connection
// need in mapi_get_next_packet()
if(send(h->sockfd, dbuf, dbuf->length, MSG_NOSIGNAL) <= 0){
WARNING_CMD( printf("send: %s [%s:%d]\n", strerror(errno), __FILE__, __LINE__) );
//WARNING_CMD( printf("send: %s [%s:%d]\n", strerror(errno), __FILE__, __LINE__) );
sem_wait(&h->connection); // lock the semaphore
}
#else
......@@ -340,13 +340,13 @@ void *mapiipc_comm_thread(void *host){ // reads an IPC message - blocking call
if(recv_bytes == 0){ // the peer has gone
#ifdef RECONNECT
printf("\n\t---> Mapicommd is down. Socket closed from host: %s\n", ((struct host *)host)->hostname);
//printf("\n\t---> Mapicommd is down. Socket closed from host: %s\n", ((struct host *)host)->hostname);
check_net = check_network_mapicommd((struct host *) host);
if(check_net == 1) // network is up
continue;
else{ // network is down
printf("\nNetwork down ...\n");
//printf("\nNetwork down ...\n");
restore_network_mapicommd((struct host *) host);
dbuf_.cmd = IGNORE_SLEEP;
......@@ -380,13 +380,13 @@ void *mapiipc_comm_thread(void *host){ // reads an IPC message - blocking call
else if(recv_bytes == -1){
#ifdef RECONNECT
printf("\n\t---> Mapicommd is down. Socket closed from host: %s\n", ((struct host *)host)->hostname);
//printf("\n\t---> Mapicommd is down. Socket closed from host: %s\n", ((struct host *)host)->hostname);
check_net = check_network_mapicommd((struct host *) host);
if(check_net == 1) // network is up
continue;
else{ // network is down
printf("\nNetwork down ...\n");
//printf("\nNetwork down ...\n");
restore_network_mapicommd((struct host *) host);
dbuf_.cmd = IGNORE_SLEEP;
......@@ -432,13 +432,13 @@ void *mapiipc_comm_thread(void *host){ // reads an IPC message - blocking call
#endif
if(recv_bytes == 0){ // the peer has gone
#ifdef RECONNECT
printf("\n\t---> Mapicommd is down. Socket closed from host: %s\n", ((struct host *)host)->hostname);
//printf("\n\t---> Mapicommd is down. Socket closed from host: %s\n", ((struct host *)host)->hostname);
check_net = check_network_mapicommd((struct host *) host);
if(check_net == 1) // network is up
continue;
else{ // network is down
printf("\nNetwork down ...\n");
//printf("\nNetwork down ...\n");
restore_network_mapicommd((struct host *) host);
dbuf_.cmd = IGNORE_SLEEP;
......@@ -472,13 +472,13 @@ void *mapiipc_comm_thread(void *host){ // reads an IPC message - blocking call
else if(recv_bytes == -1){
#ifdef RECONNECT
printf("\n\t---> Mapicommd is down. Socket closed from host: %s\n", ((struct host *)host)->hostname);
//printf("\n\t---> Mapicommd is down. Socket closed from host: %s\n", ((struct host *)host)->hostname);
check_net = check_network_mapicommd((struct host *) host);
if(check_net == 1) // network is up
continue;
else{ // network is down
printf("\nNetwork down ...\n");
//printf("\nNetwork down ...\n");
restore_network_mapicommd((struct host *) host);
dbuf_.cmd = IGNORE_SLEEP;
......@@ -907,13 +907,13 @@ void restore_network_mapicommd(struct host *h){
for(tries = 0; ; tries++){
printf("\n---> Reconnection try #%d", tries);
//printf("\n---> Reconnection try #%d", tries);
check_net = check_network_mapicommd(h);
fflush(stdout);
if(check_net == 1){ // network is now up ...
printf("\nMapid server is back online ...\n");
//printf("\nMapid server is back online ...\n");
mapiipc_remote_close(h); // release previous socket resources
mapiipc_remote_init(h); // initializes IPC for DiMAPI functions
......@@ -926,7 +926,7 @@ void restore_network_mapicommd(struct host *h){
time += time; // increase waiting time
}
fprintf(stderr,"\nNetwork is down (reconnection tries expired)\n");
//fprintf(stderr,"\nNetwork is down (reconnection tries expired)\n");
exit(EXIT_FAILURE);
}
......@@ -1421,13 +1421,13 @@ void restore_network_mapid(void){
for(tries = 0; ; tries++){
printf("\n---> Reconnection try #%d", tries);
//printf("\n---> Reconnection try #%d", tries);
check_net = check_network_mapid();
fflush(stdout);
if(check_net == 1){ // network is now up ...
printf("\nMapid is back online ...\n\n");
//printf("\nMapid is back online ...\n\n");
mapiipc_client_close(); // release previous socket resources
mapiipc_client_init(); // initializes IPC for mapi functions
return;
......@@ -1437,7 +1437,7 @@ void restore_network_mapid(void){
if (tries < 8)
time += time; // increase waiting time
}
fprintf(stderr,"\nNetwork is down (reconnection tries expired)\n");
//fprintf(stderr,"\nNetwork is down (reconnection tries expired)\n");
exit(EXIT_FAILURE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment