Home | History | Annotate | Download | only in cups

Lines Matching refs:http

11  * missing or damaged, see the license at "http://www.cups.org/".
299 http_t *http, /* I - Connection to server */
306 DEBUG_printf(("httpCopyCredentials(http=%p, credentials=%p)", http, credentials));
311 if (!http || !http->tls || !credentials)
315 certs = gnutls_certificate_get_peers(http->tls, &count);
1089 http_t *http; /* HTTP connection */
1095 http = (http_t *)ptr;
1097 if (!http->blocking)
1103 while (!_httpWait(http, http->wait_value, 0))
1105 if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
1108 http->error = ETIMEDOUT;
1113 bytes = recv(http->fd, data, length, 0);
1161 _httpTLSPending(http_t *http) /* I - HTTP connection */
1163 return (gnutls_record_check_pending(http->tls));
1172 _httpTLSRead(http_t *http, /* I - Connection to server */
1179 result = gnutls_record_recv(http->tls, buf, (size_t)len);
1214 _httpTLSSetCredentials(http_t *http) /* I - Connection to server */
1216 (void)http;
1239 _httpTLSStart(http_t *http) /* I - Connection to server */
1250 DEBUG_printf(("3_httpTLSStart(http=%p)", http));
1259 if (http->mode == _HTTP_MODE_SERVER && !tls_keypath)
1262 http->error = errno = EINVAL;
1263 http->status = HTTP_STATUS_ERROR;
1275 http->error = errno;
1276 http->status = HTTP_STATUS_ERROR;
1283 status = gnutls_init(&http->tls, http->mode == _HTTP_MODE_CLIENT ? GNUTLS_CLIENT : GNUTLS_SERVER);
1285 status = gnutls_set_default_priority(http->tls);
1289 http->error = EIO;
1290 http->status = HTTP_STATUS_ERROR;
1295 gnutls_deinit(http->tls);
1298 http->tls = NULL;
1303 if (http->mode == _HTTP_MODE_CLIENT)
1309 if (httpAddrLocalhost(http->hostaddr))
1319 strlcpy(hostname, http->hostname, sizeof(hostname));
1325 status = gnutls_server_name_set(http->tls, GNUTLS_NAME_DNS, hostname, strlen(hostname));
1337 if (http->fields[HTTP_FIELD_HOST][0])
1343 strlcpy(hostname, http->fields[HTTP_FIELD_HOST], sizeof(hostname));
1355 if (getsockname(http->fd, (struct sockaddr *)&addr, &addrlen))
1474 http->error = errno = EINVAL;
1475 http->status = HTTP_STATUS_ERROR;
1489 status = gnutls_credentials_set(http->tls, GNUTLS_CRD_CERTIFICATE, *credentials);
1493 http->error = EIO;
1494 http->status = HTTP_STATUS_ERROR;
1499 gnutls_deinit(http->tls);
1502 http->tls = NULL;
1529 gnutls_priority_set_direct(http->tls, priority_string, NULL);
1535 gnutls_priority_set(http->tls, priority);
1539 gnutls_transport_set_ptr(http->tls, (gnutls_transport_ptr_t)http);
1540 gnutls_transport_set_pull_function(http->tls, http_gnutls_read);
1542 gnutls_transport_set_pull_timeout_function(http->tls, (gnutls_pull_timeout_func)httpWait);
1544 gnutls_transport_set_push_function(http->tls, http_gnutls_write);
1546 while ((status = gnutls_handshake(http->tls)) != GNUTLS_E_SUCCESS)
1553 http->error = EIO;
1554 http->status = HTTP_STATUS_ERROR;
1558 gnutls_deinit(http->tls);
1561 http->tls = NULL;
1567 http->tls_credentials = credentials;
1578 _httpTLSStop(http_t *http) /* I - Connection to server */
1583 error = gnutls_bye(http->tls, http->mode == _HTTP_MODE_CLIENT ? GNUTLS_SHUT_RDWR : GNUTLS_SHUT_WR);
1587 gnutls_deinit(http->tls);
1588 http->tls = NULL;
1590 if (http->tls_credentials)
1592 gnutls_certificate_free_credentials(*(http->tls_credentials));
1593 free(http->tls_credentials);
1594 http->tls_credentials = NULL;
1604 _httpTLSWrite(http_t *http, /* I - Connection to server */
1611 DEBUG_printf(("2http_write_ssl(http=%p, buf=%p, len=%d)", http, buf, len));
1613 result = gnutls_record_send(http->tls, buf, (size_t)len);