Changeset 93e883d
- Timestamp:
- Feb 11, 2007, 10:36:00 AM (18 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 16138b0
- Parents:
- 687c674
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
r272a4a0 r93e883d 70 70 return(""); 71 71 #endif 72 } 73 74 int owl_zephyr_loadsubs_helper(ZSubscription_t subs[], int count) 75 { 76 int i, ret = 0; 77 /* sub without defaults */ 78 if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) { 79 owl_function_error("Error subscribing to zephyr notifications."); 80 ret=-2; 81 } 82 83 /* free stuff */ 84 for (i=0; i<count; i++) { 85 owl_free(subs[i].zsub_class); 86 owl_free(subs[i].zsub_classinst); 87 owl_free(subs[i].zsub_recipient); 88 } 89 return ret; 72 90 } 73 91 … … 87 105 char buffer[1024], subsfile[1024]; 88 106 ZSubscription_t subs[3001]; 89 int count, ret , i;107 int count, ret; 90 108 struct stat statbuff; 91 109 … … 103 121 104 122 ZResetAuthentication(); 105 /* need to redo this to do chunks, not just bail after 3000 */106 123 count=0; 107 124 file=fopen(subsfile, "r"); … … 116 133 } 117 134 118 if (count >= 3000) break; /* also tell the user */ 135 if (count >= 3000) { 136 ret = owl_zephyr_loadsubs_helper(subs, count); 137 if (ret != 0) { 138 fclose(file); 139 return(ret); 140 } 141 count=0; 142 } 119 143 120 144 /* add it to the list of subs */ … … 135 159 fclose(file); 136 160 137 /* sub without defaults */ 138 ret=0; 139 if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) { 140 owl_function_error("Error subscribing to zephyr notifications."); 141 ret=-2; 142 } 143 144 /* free stuff */ 145 for (i=0; i<count; i++) { 146 owl_free(subs[i].zsub_class); 147 owl_free(subs[i].zsub_classinst); 148 owl_free(subs[i].zsub_recipient); 149 } 161 ret=owl_zephyr_loadsubs_helper(subs, count); 150 162 151 163 return(ret);
Note: See TracChangeset
for help on using the changeset viewer.