Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void* Dispatcher::Dispatch(void* raw) {
- AuthenticationRequest request = ser_des_->Deserialize(raw);
- RequestMethod method = request.GetRequestMethod();
- AuthenticationResponse response;
- if (method == RequestMethod::AUTHENTICATE) {
- printf("'authentication' dispatched!\n");
- response = AuthenticationApi::GetInstance()->Authenticate(request);
- } else if (method == RequestMethod::INFO) {
- printf("'info' dispatched!\n");
- printf(AuthenticationApi::GetInstance()->Info().c_str());
- } else {
- char* error_message;
- sprintf(error_message, "mod_auth with invalid method called: %s", &method);
- throw std::invalid_argument(error_message);
- }
- return ser_des_->Serialize(&response);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement