Lines Matching refs:svc
64 service_connect(service_t *svc, char *service_name)
69 if (svc == NULL)
72 if (svc->connection != NULL) /* alread connected ? */
75 if (svc->uri == NULL)
76 uri_from_string(service_name, &svc->uri);
78 if ((service_name != NULL) && (svc->uri == NULL)) {
100 uri_from_string(service_name, &svc->uri);
103 if (svc->uri == NULL)
106 if (svc->uri->port != NULL)
107 port = strtol(svc->uri->port, NULL, 10);
109 svc->connection = httpConnectEncrypt(svc->uri->host, port,
110 http_encryption_type(svc->encryption));
111 if (svc->connection == NULL) {
112 if (svc->uri != NULL) {
113 uri_free(svc->uri);
114 svc->uri = NULL;
118 svc->name = strdup(service_name);
126 int (*authCB)(papi_service_t svc, void *app_data),
130 service_t *svc = NULL;
136 if ((*handle = svc = calloc(1, sizeof (*svc))) == NULL)
140 svc->user = strdup(user_name);
143 svc->password = strdup(password);
145 svc->encryption = encryption;
148 svc->authCB = authCB;
151 svc->app_data = app_data;
154 svc->transfer_encoding = TRANSFER_ENCODING_LENGTH;
156 svc->transfer_encoding = TRANSFER_ENCODING_CHUNKED;
159 result = service_connect(svc, service_name);
170 service_t *svc = handle;
172 if (svc->attributes != NULL)
173 papiAttributeListFree(svc->attributes);
174 if (svc->name != NULL)
175 free(svc->name);
176 if (svc->user != NULL)
177 free(svc->user);
178 if (svc->password != NULL)
179 free(svc->password);
180 if (svc->uri != NULL)
181 uri_free(svc->uri);
182 if (svc->post != NULL)
183 free(svc->post);
184 if (svc->connection != NULL)
185 httpClose(svc->connection);
197 service_t *svc = handle;
199 if (svc->user != NULL)
200 free(svc->user);
201 svc->user = NULL;
203 svc->user = strdup(user_name);
216 service_t *svc = handle;
218 if (svc->password != NULL)
219 free(svc->password);
220 svc->password = NULL;
222 svc->password = strdup(password);
236 service_t *svc = handle;
238 svc->encryption = encryption;
239 httpEncryption(svc->connection,
240 (http_encryption_t)svc->encryption);
249 int (*authCB)(papi_service_t svc, void *app_data))
254 service_t *svc = handle;
256 svc->authCB = authCB;
270 service_t *svc = handle;
272 svc->app_data = (void *)app_data;
285 service_t *svc = handle;
287 result = svc->name;
299 service_t *svc = handle;
301 result = svc->user;
313 service_t *svc = handle;
315 result = svc->password;
327 service_t *svc = handle;
329 result = svc->encryption;
341 service_t *svc = handle;
343 result = svc->app_data;
353 service_t *svc = handle;
356 result = svc->attributes;
365 service_t *svc = handle;
367 papiAttributeListGetString(svc->attributes, NULL,
374 detailed_error(service_t *svc, char *fmt, ...)
376 if ((svc != NULL) && (fmt != NULL)) {
391 papiAttributeListAddString(&svc->attributes, PAPI_ATTR_APPEND,