| 44 | } |
| 45 | |
| 46 | void NetService::fillWithInfo(HashMap * info) |
| 47 | { |
| 48 | bool ssl = false; |
| 49 | bool starttls = false; |
| 50 | |
| 51 | setHostname((String *) info->objectForKey(MCSTR("hostname"))); |
| 52 | if (info->objectForKey(MCSTR("port")) != NULL) { |
| 53 | setPort(((Value *) info->objectForKey(MCSTR("port")))->intValue()); |
| 54 | } |
| 55 | if (info->objectForKey(MCSTR("ssl")) != NULL) { |
| 56 | ssl = ((Value *) info->objectForKey(MCSTR("ssl")))->boolValue(); |
| 57 | } |
| 58 | if (info->objectForKey(MCSTR("starttls")) != NULL) { |
| 59 | starttls = ((Value *) info->objectForKey(MCSTR("starttls")))->boolValue(); |
| 60 | } |
| 61 | if (ssl) { |
| 62 | mConnectionType = ConnectionTypeTLS; |
| 63 | } |
| 64 | else if (starttls) { |
| 65 | mConnectionType = ConnectionTypeStartTLS; |
| 66 | } |
| 67 | else { |
| 68 | mConnectionType = ConnectionTypeClear; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | void NetService::setHostname(String *hostname) |
| 73 | { |
no test coverage detected