Changeset 2593
- Timestamp:
- Jul 27, 2008, 11:08:57 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/src/server.c
r2590 r2593 46 46 ret = write(screen_list->c_socket, msg, strlen(msg)); 47 47 if(ret < 0) 48 { 48 49 fprintf(stderr, "Failed to send message to client: %s\n", strerror(errno)); 50 detach(screen_list); 51 } 49 52 return ret; 50 53 } … … 77 80 void *buf; 78 81 char *buf2; 79 debug("Resquesting refresh");80 82 buf = cucul_export_memory (screen_list->cv, "caca", &bytes); 81 83 buf2 = malloc(bytes+8); … … 85 87 connect_client(screen_list); 86 88 if(screen_list->c_socket) 87 write(screen_list->c_socket, buf2, bytes+8); 89 if(write(screen_list->c_socket, buf2, bytes+8) <= 0) 90 detach(screen_list); 88 91 free(buf); 89 92 free(buf2); … … 94 97 { 95 98 screen_list->attached = 0; 96 return send_to_client("DETACH", screen_list); 99 if(screen_list->c_socket) 100 { 101 send_to_client("DETACH", screen_list); 102 close(screen_list->c_socket); 103 screen_list->c_socket = 0; 104 } 105 return 0; 97 106 } 98 107
Note: See TracChangeset
for help on using the changeset viewer.