Changeset 16711 for gsdl/trunk/runtime-src/src
- Timestamp:
- 2008-08-12T12:04:01+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/runtime-src/src/oaiservr/identifyaction.cpp
r15844 r16711 3 3 bool identifyaction::validateAction(recptproto *protocol, oaiargs ¶ms) 4 4 { 5 int params_size = params.getSize(); 6 7 // Remove any parameters that aren't valid for this action 5 // ---------------------------------------------------------------------------- 6 // 1. Check for invalid arguments 7 // ---------------------------------------------------------------------------- 8 bool invalid_argument_supplied = false; 8 9 text_tmap::const_iterator param_iterator = params.begin(); 9 10 while (param_iterator != params.end()) 10 11 { 12 // Check for arguments that aren't valid for this action 11 13 if (param_iterator->first != "verb") 12 14 { 15 // We've found an invalid argument 16 invalid_argument_supplied = true; 17 18 // Delete the invalid argument from the list so it doesn't end up in the <request> tag that is returned 13 19 params.erase(param_iterator->first); 14 20 } … … 16 22 param_iterator++; 17 23 } 18 19 // "Verb=Identify" should be the only parameter - if there are others, throw an error.20 // Don't need to check that the param we have is "Verb=Identify", as it has to be to get to here.21 if(params_size != 1){24 25 // If we found an invalid argument it's an error, so don't go any further 26 if (invalid_argument_supplied) 27 { 22 28 this->errorType = "badArgument"; 23 29 return false; 24 30 } 25 31 32 // ---------------------------------------------------------------------------- 33 // 2. Handle any exclusive arguments 34 // ---------------------------------------------------------------------------- 35 36 // None! 37 38 // ---------------------------------------------------------------------------- 39 // 3. Handle any required arguments 40 // ---------------------------------------------------------------------------- 41 42 // None! 43 44 // ---------------------------------------------------------------------------- 45 // 4. Check any remaining arguments 46 // ---------------------------------------------------------------------------- 47 48 // None! 49 50 // If we've reached here everything must be fine 51 this->errorType = ""; 26 52 return true; 27 53 }
Note:
See TracChangeset
for help on using the changeset viewer.