Changeset 696
- Timestamp:
- May 3, 2007 8:12:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/vizservers/pymolproxy/pymolproxy.c
r694 r696 143 143 if ((result < 0) && (errno != EAGAIN) && (errno != EINTR)) 144 144 { 145 fprintf(stderr," Error reading sock(%d), %d/%s\n", sock, errno,strerror(errno));145 fprintf(stderr,"pymolproxy: Error reading sock(%d), %d/%s\n", sock, errno,strerror(errno)); 146 146 break; 147 147 } … … 336 336 337 337 if (waitForString(pymol, "PyMOL>", buffer, 800)) { 338 fprintf(stderr," Timeout reading data [%s]\n",buffer);338 fprintf(stderr,"pymolproxy: Timeout reading data [%s]\n",buffer); 339 339 pymol->error = 1; 340 340 pymol->status = TCL_ERROR; … … 681 681 pymol->immediate_update |= push; 682 682 pymol->invalidate_cache = 1; 683 fprintf(stderr,"LabelCmd: state = %d, pymolstate = %d\n",state,pymol->labels); 683 684 684 if (state) { 685 685 sendf(pymol, "set label_color,white,all\n"); … … 866 866 867 867 if (tmpf <= 0) 868 fprintf(stderr," error opening file %d\n",errno);868 fprintf(stderr,"pymolproxy: error opening file %d\n",errno); 869 869 870 870 write(tmpf,pdbdata,strlen(pdbdata)); … … 1111 1111 1112 1112 execvp(command,argv); 1113 fprintf(stderr," Failed to start pyMol\n");1113 fprintf(stderr,"pymolproxy: Failed to start pyMol\n"); 1114 1114 exit(-1); 1115 1115 } … … 1177 1177 // send images back 1178 1178 1179 if (1)1180 fprintf(stderr,"Pymol Ready.\n");1181 1182 1179 gettimeofday(&end, NULL); 1183 1180 … … 1210 1207 if ( status < 0 ) 1211 1208 { 1212 fprintf(stderr, " POLL ERROR: status = %d, errno = %d, %s \n", status,errno,strerror(errno));1209 fprintf(stderr, "pymolproxy: POLL ERROR: status = %d, errno = %d, %s \n", status,errno,strerror(errno)); 1213 1210 } 1214 1211 else if (status > 0) … … 1216 1213 gettimeofday(&now,NULL); 1217 1214 1218 if (ufd[0].revents) { 1219 1215 if (ufd[0].revents) { /* Client Stdout Connection: command input */ 1220 1216 if (read(ufd[0].fd,&ch,1) <= 0) 1221 1217 { 1222 fprintf(stderr,"EOF or Lost Connection. status = %d, errno = %d, %s \n", status,errno,strerror(errno)); 1223 break; 1218 if (errno != EINTR) 1219 { 1220 fprintf(stderr,"pymolproxy: Lost Client Connection.\n"); 1221 break; 1222 } 1224 1223 } 1225 1224 else … … 1237 1236 } 1238 1237 1239 if (ufd[1].revents ) { 1238 if (ufd[1].revents ) { /* pyMol Stdout Connection: pymol (unexpected) output */ 1240 1239 if (read(ufd[1].fd, &ch, 1) <= 0) 1241 1240 { 1242 if (errno == EAGAIN) 1243 fprintf(stderr,"EAGAIN error reading pymol stdout... retrying.\n"); 1244 else { 1245 fprintf(stderr,"Lost PyMol Session. (errno=%d)\n",errno); 1241 if (errno != EINTR) { 1242 fprintf(stderr,"pymolproxy: lost connection (stdout) to pymol server\n"); 1246 1243 break; 1247 1244 } … … 1255 1252 dyBufferAppend(&dybuffer, &ch, 1); 1256 1253 fprintf(stderr,"STDOUT>%s",dybuffer.data); 1257 1258 if (dybuffer.data[0]=='I' && dybuffer.data[1] == 0)1259 pymol.need_update = 1;1260 1261 1254 dyBufferSetLength(&dybuffer,0); 1262 1255 } … … 1264 1257 } 1265 1258 1266 if (ufd[2].revents) { 1259 if (ufd[2].revents) { /* pyMol Stderr Connection: pymol standard error output */ 1267 1260 if (read(ufd[2].fd, &ch, 1) <= 0) 1268 1261 { 1269 if (errno == EAGAIN) 1270 fprintf(stderr,"EAGAIN error reading pymol stderr... retrying.\n"); 1271 else { 1272 fprintf(stderr,"Lost PyMol Stderr Session. (errno=%d)\n", errno); 1262 if (errno != EINTR) { 1263 fprintf(stderr,"pymolproxy: lost connection (stderr) to pymol server\n"); 1273 1264 break; 1274 1265 } … … 1281 1272 dyBufferAppend(&dybuffer2, &ch, 1); 1282 1273 fprintf(stderr,"stderr>%s", dybuffer2.data); 1283 1284 1274 dyBufferSetLength(&dybuffer2,0); 1285 1275 } … … 1308 1298 } 1309 1299 1310 fprintf(stderr,"Waiting for process to end\n");1311 1312 1300 status = waitpid(pid, NULL, WNOHANG); 1313 1301 1314 1302 if (status == -1) 1315 fprintf(stderr, " Error waiting on process(%d)\n", errno);1303 fprintf(stderr, "pymolproxy: error waiting on pymol server to exit (%d)\n", errno); 1316 1304 else if (status == 0) { 1317 fprintf(stderr, " Attempting to SIGTERM process.\n");1305 fprintf(stderr, "pymolproxy: attempting to SIGTERM pymol server\n"); 1318 1306 kill(-pid, SIGTERM); // kill process group 1319 1307 alarm(5); … … 1323 1311 while ((status == -1) && (errno == EINTR)) 1324 1312 { 1325 fprintf(stderr, " Attempting to SIGKILL process.\n");1313 fprintf(stderr, "pymolproxy: Attempting to SIGKILL process.\n"); 1326 1314 kill(-pid, SIGKILL); // kill process group 1327 1315 alarm(10); … … 1331 1319 } 1332 1320 1333 fprintf(stderr, " Process ended\n");1321 fprintf(stderr, "pymolproxy: pymol server process ended\n"); 1334 1322 1335 1323 dyBufferFree(&pymol.image);
Note: See TracChangeset
for help on using the changeset viewer.