Mercurial > hg > audiodb
comparison audioDB.cpp @ 338:cdb31e8b94e3
fixed startServer() reporting of non-locatable database or index. Achieved by setting isServer=1 AFTER checking database and loading INDEX.
author | mas01mc |
---|---|
date | Fri, 05 Sep 2008 16:40:41 +0000 |
parents | ccf15a8c3e46 |
children | da901c62e569 |
comparison
equal
deleted
inserted
replaced
337:ccf15a8c3e46 | 338:cdb31e8b94e3 |
---|---|
101 } | 101 } |
102 | 102 |
103 audioDB::audioDB(const unsigned argc, char* const argv[], adb__queryResponse *adbQueryResponse): O2_AUDIODB_INITIALIZERS | 103 audioDB::audioDB(const unsigned argc, char* const argv[], adb__queryResponse *adbQueryResponse): O2_AUDIODB_INITIALIZERS |
104 { | 104 { |
105 try { | 105 try { |
106 isServer = 1; // FIXME: Hack | 106 isServer = 1; // Set to make errors report over SOAP |
107 processArgs(argc, argv); | 107 processArgs(argc, argv); |
108 // Perform database prefix substitution | 108 // Perform database prefix substitution |
109 if(dbName && adb_root) | 109 if(dbName && adb_root) |
110 prefix_name((char** const)&dbName, adb_root); | 110 prefix_name((char** const)&dbName, adb_root); |
111 if(inFile && adb_feature_root) | 111 if(inFile && adb_feature_root) |
119 } | 119 } |
120 | 120 |
121 audioDB::audioDB(const unsigned argc, char* const argv[], adb__statusResponse *adbStatusResponse): O2_AUDIODB_INITIALIZERS | 121 audioDB::audioDB(const unsigned argc, char* const argv[], adb__statusResponse *adbStatusResponse): O2_AUDIODB_INITIALIZERS |
122 { | 122 { |
123 try { | 123 try { |
124 isServer = 1; // FIXME: Hack | 124 isServer = 1; // Set to make errors report over SOAP |
125 processArgs(argc, argv); | 125 processArgs(argc, argv); |
126 // Perform database prefix substitution | 126 // Perform database prefix substitution |
127 if(dbName && adb_root) | 127 if(dbName && adb_root) |
128 prefix_name((char** const)&dbName, adb_root); | 128 prefix_name((char** const)&dbName, adb_root); |
129 if(inFile && adb_feature_root) | 129 if(inFile && adb_feature_root) |
137 } | 137 } |
138 | 138 |
139 audioDB::audioDB(const unsigned argc, char* const argv[], adb__lisztResponse *adbLisztResponse): O2_AUDIODB_INITIALIZERS | 139 audioDB::audioDB(const unsigned argc, char* const argv[], adb__lisztResponse *adbLisztResponse): O2_AUDIODB_INITIALIZERS |
140 { | 140 { |
141 try { | 141 try { |
142 isServer = 1; // FIXME: Hack | 142 isServer = 1; // Set to make errors report over SOAP |
143 processArgs(argc, argv); | 143 processArgs(argc, argv); |
144 // Perform database prefix substitution | 144 // Perform database prefix substitution |
145 if(dbName && adb_root) | 145 if(dbName && adb_root) |
146 prefix_name((char** const)&dbName, adb_root); | 146 prefix_name((char** const)&dbName, adb_root); |
147 assert(O2_ACTION(COM_LISZT)); | 147 assert(O2_ACTION(COM_LISZT)); |
148 liszt(dbName, lisztOffset, lisztLength, adbLisztResponse); | 148 liszt(dbName, lisztOffset, lisztLength, adbLisztResponse); |
305 if(args_info.SERVER_given){ | 305 if(args_info.SERVER_given){ |
306 command=COM_SERVER; | 306 command=COM_SERVER; |
307 port=args_info.SERVER_arg; | 307 port=args_info.SERVER_arg; |
308 if(port<100 || port > 100000) | 308 if(port<100 || port > 100000) |
309 error("port out of range"); | 309 error("port out of range"); |
310 isServer = 1; | |
311 #if defined(O2_DEBUG) | 310 #if defined(O2_DEBUG) |
312 struct sigaction sa; | 311 struct sigaction sa; |
313 sa.sa_sigaction = sigterm_action; | 312 sa.sa_sigaction = sigterm_action; |
314 sa.sa_flags = SA_SIGINFO | SA_RESTART | SA_NODEFER; | 313 sa.sa_flags = SA_SIGINFO | SA_RESTART | SA_NODEFER; |
315 sigaction(SIGTERM, &sa, NULL); | 314 sigaction(SIGTERM, &sa, NULL); |