Commit 802cca29 authored by 's avatar
Browse files

clear some code

git-svn-id: file:///home/svn/mapi/trunk@744 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent b153a842
......@@ -138,29 +138,21 @@ int mapiipc_remote_write_to_all(remote_flowdescr_t* rflow)
void *mapiipc_comm_thread(void *host) {
//Reads an IPC message. Blocking call
//char buffer[DIMAPI_DATA_SIZE]; DELETE
struct dmapiipcbuf* dbuf;
remote_flowdescr_t* rflow;
host_flow* hflow;
int recv_bytes;
//unsigned int dbuf_bytes=0; DELETE
//int pending;
int sockfd=((struct host *)host)->sockfd;
struct timeval tv1, tv2;
int cnt=-3;
/* Guarantees that thread resources are deallocated upon return */
pthread_detach(pthread_self());
//dbuf=(struct dmapiipcbuf*)&buffer[0]; DELETE
dbuf = (struct dmapiipcbuf *)malloc(sizeof(struct dmapiipcbuf));
while (1) {
if (host==NULL) break;
// gettimeofday(&tv1,NULL);
recv_bytes=readn(sockfd, dbuf, BASIC_SIZE);
if (recv_bytes == 0) { // the peer has gone
......@@ -189,12 +181,7 @@ void *mapiipc_comm_thread(void *host) {
continue;
}
}
// gettimeofday(&tv2,NULL);
// fprintf(stderr,"%d internal read delay %lu sec and %lu usec from host %s\n",cnt++,tv2.tv_sec-tv1.tv_sec, tv2.tv_usec-tv1.tv_usec,((struct host *)host)->hostname);
fflush(stderr);
// gettimeofday(&tv1,NULL);
hflow=(host_flow*)flist_get( ((struct host*)host)->flows, dbuf->fd );
if (hflow!=NULL) {
rflow=flist_get(remote_flowlist, hflow->scope_fd);
......@@ -205,17 +192,8 @@ void *mapiipc_comm_thread(void *host) {
}
else {
memcpy( hflow->dbuf, dbuf, dbuf->length ); //place data
//pthread_mutex_lock(&rflow->mutex);
//if (rflow->pending_msgs>0) {
//--rflow->pending_msgs;
//pending=rflow->pending_msgs;
//pthread_mutex_unlock(&rflow->mutex);
//if ( pending==0 ) {
sem_post( &rflow->fd_sem );
//}
//}
//else pthread_mutex_unlock(&rflow->mutex);
sem_post( &rflow->fd_sem );
}
}
else {
......@@ -224,12 +202,7 @@ void *mapiipc_comm_thread(void *host) {
//failure
continue;
}
// gettimeofday(&tv2,NULL);
// fprintf(stderr,"%d internal read delay %lu sec and %lu usec from host %s\n",cnt++,tv2.tv_sec-tv1.tv_sec, tv2.tv_usec-tv1.tv_usec,((struct host *)host)->hostname);
//dbuf_bytes=dbuf_bytes-dbuf->length; DELETE
//memcpy(buffer,buffer+dbuf->length,dbuf_bytes); DELETE
}
free(dbuf);
......
Supports Markdown
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