Software /
code /
prosody
Comparison
core/portmanager.lua @ 4743:70d68e789d93
portmanager: Rename activate_service() to activate() (to match deactivate())
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 28 Apr 2012 01:27:46 +0100 |
parent | 4742:23c2ece2c8bc |
child | 4744:3be37768720d |
comparison
equal
deleted
inserted
replaced
4742:23c2ece2c8bc | 4743:70d68e789d93 |
---|---|
69 unregister_service(item.name, item); | 69 unregister_service(item.name, item); |
70 end); | 70 end); |
71 | 71 |
72 --- Public API | 72 --- Public API |
73 | 73 |
74 function activate_service(service_name) | 74 function activate(service_name) |
75 local service_info = services[service_name][1]; | 75 local service_info = services[service_name][1]; |
76 if not service_info then | 76 if not service_info then |
77 return nil, "Unknown service: "..service_name; | 77 return nil, "Unknown service: "..service_name; |
78 end | 78 end |
79 | 79 |
144 function register_service(service_name, service_info) | 144 function register_service(service_name, service_info) |
145 table.insert(services[service_name], service_info); | 145 table.insert(services[service_name], service_info); |
146 | 146 |
147 if not active_services:get(service_name) then | 147 if not active_services:get(service_name) then |
148 log("debug", "No active service for %s, activating...", service_name); | 148 log("debug", "No active service for %s, activating...", service_name); |
149 local ok, err = activate_service(service_name); | 149 local ok, err = activate(service_name); |
150 if not ok then | 150 if not ok then |
151 log("error", "Failed to activate service '%s': %s", service_name, err or "unknown error"); | 151 log("error", "Failed to activate service '%s': %s", service_name, err or "unknown error"); |
152 end | 152 end |
153 end | 153 end |
154 | 154 |