Mercurial > hg > orthanc
comparison OrthancServer/OrthancInitialization.cpp @ 485:bdbde1fbfab3
send resources through HTTP
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 16 Jul 2013 13:48:33 +0200 |
parents | b8ace6fc1d1f |
children | 1b2cdc855bd3 |
comparison
equal
deleted
inserted
replaced
484:b8ace6fc1d1f | 485:bdbde1fbfab3 |
---|---|
280 } | 280 } |
281 | 281 |
282 try | 282 try |
283 { | 283 { |
284 url = modalities[name].get(0u, "").asString(); | 284 url = modalities[name].get(0u, "").asString(); |
285 username = modalities[name].get(1u, "").asString(); | 285 |
286 password = modalities[name].get(2u, "").asString(); | 286 if (modalities[name].size() == 1) |
287 { | |
288 username = ""; | |
289 password = ""; | |
290 } | |
291 else if (modalities[name].size() == 3) | |
292 { | |
293 username = modalities[name].get(1u, "").asString(); | |
294 password = modalities[name].get(2u, "").asString(); | |
295 } | |
296 else | |
297 { | |
298 throw OrthancException(ErrorCode_BadFileFormat); | |
299 } | |
287 } | 300 } |
288 catch (...) | 301 catch (...) |
289 { | 302 { |
290 throw OrthancException("Badly formatted Orthanc peer"); | 303 throw OrthancException(ErrorCode_BadFileFormat); |
304 } | |
305 | |
306 if (url.size() != 0 && url[url.size() - 1] != '/') | |
307 { | |
308 url += '/'; | |
291 } | 309 } |
292 } | 310 } |
293 | 311 |
294 | 312 |
295 static bool ReadKeys(std::set<std::string>& target, | 313 static bool ReadKeys(std::set<std::string>& target, |