Changeset b57db73 for benchmark/io/http/main.cfa
- Timestamp:
- Jan 16, 2021, 5:20:59 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 0197418
- Parents:
- 35ea4f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/main.cfa
r35ea4f3 rb57db73 80 80 //=================== 81 81 // Parse args 82 const char * path =parse_options(argc, argv);82 parse_options(argc, argv); 83 83 84 84 //=================== 85 85 // Open Files 86 sout | "Filling cache from" | path; 87 fill_cache( path ); 86 if( options.file_cache.path ) { 87 sout | "Filling cache from" | options.file_cache.path; 88 fill_cache( options.file_cache.path ); 89 } 88 90 89 91 //=================== … … 147 149 } 148 150 149 if(options.file_cache. fixed_fds) {151 if(options.file_cache.path && options.file_cache.fixed_fds) { 150 152 register_fixed_files(cl, fds, pipe_off); 151 153 } … … 184 186 } 185 187 186 sout | "Notifying connections ";188 sout | "Notifying connections..." | nonl; flush( sout ); 187 189 for(i; options.clopts.nworkers) { 188 190 workers[i].done = true; 189 191 cancel(workers[i].cancel); 190 192 } 191 192 sout | "Shutting down socket"; 193 sout | "done"; 194 195 sout | "Shutting down socket..." | nonl; flush( sout ); 193 196 int ret = shutdown( server_fd, SHUT_RD ); 194 if( ret < 0 ) { abort( "shutdown error: (%d) %s\n", (int)errno, strerror(errno) ); } 197 if( ret < 0 ) { 198 abort( "shutdown error: (%d) %s\n", (int)errno, strerror(errno) ); 199 } 200 sout | "done"; 195 201 196 202 //=================== 197 203 // Close Socket 198 sout | "Closing Socket ";204 sout | "Closing Socket..." | nonl; flush( sout ); 199 205 ret = close( server_fd ); 200 206 if(ret < 0) { 201 207 abort( "close socket error: (%d) %s\n", (int)errno, strerror(errno) ); 202 208 } 203 sout | "Stopping connection threads..." | nonl; 209 sout | "Stopping connection threads..." | nonl; flush( sout ); 204 210 } 205 211 sout | "done"; 206 212 207 sout | "Stopping protocol threads..." | nonl; 213 sout | "Stopping protocol threads..." | nonl; flush( sout ); 208 214 deinit_protocol(); 209 215 sout | "done"; 210 216 211 sout | "Stopping processors..." | nonl; 217 sout | "Stopping processors..." | nonl; flush( sout ); 212 218 } 213 219 sout | "done"; 214 220 215 sout | "Closing splice fds..." | nonl; 221 sout | "Closing splice fds..." | nonl; flush( sout ); 216 222 for(i; pipe_cnt) { 217 223 ret = close( fds[pipe_off + i] ); … … 223 229 sout | "done"; 224 230 225 sout | "Stopping processors..." | nonl; 231 sout | "Stopping processors..." | nonl; flush( sout ); 226 232 } 227 233 sout | "done"; … … 229 235 //=================== 230 236 // Close Files 231 sout | "Closing open files..." | nonl; 232 close_cache(); 233 sout | "done"; 234 } 237 if( options.file_cache.path ) { 238 sout | "Closing open files..." | nonl; flush( sout ); 239 close_cache(); 240 sout | "done"; 241 } 242 }
Note: See TracChangeset
for help on using the changeset viewer.