| 247 | |
| 248 | |
| 249 | void RequiresQueue::UpdateEntry(ClientAttentionType type, |
| 250 | ClientAttentionGroup group, |
| 251 | uint32_t id, |
| 252 | std::string newvalue) |
| 253 | { |
| 254 | if (QueueDone(type, group)) |
| 255 | { |
| 256 | throw RequiresQueueException("User input not required"); |
| 257 | } |
| 258 | |
| 259 | for (auto &e : slots) |
| 260 | { |
| 261 | if (e.type == type |
| 262 | && e.group == group |
| 263 | && e.id == id) |
| 264 | { |
| 265 | if (!e.provided) |
| 266 | { |
| 267 | e.provided = true; |
| 268 | e.value = filter_ctrl_chars(newvalue, true); |
| 269 | |
| 270 | callbacks.RunCallback(CallbackType::PROVIDE_RESPONSE); |
| 271 | return; |
| 272 | } |
| 273 | else |
| 274 | { |
| 275 | throw RequiresQueueException("net.openvpn.v3.error.input-already-provided", |
| 276 | "Request ID " + std::to_string(id) |
| 277 | + " has already been provided"); |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | throw RequiresQueueException("net.openvpn.v3.invalid-input", |
| 282 | "No matching entry found in the request queue"); |
| 283 | } |
| 284 | |
| 285 | |
| 286 | void RequiresQueue::UpdateEntry(GVariant *indata) |