Lines Matching refs:http
11 * missing or damaged, see the license at "http://www.cups.org/".
38 http_status_t /* O - HTTP status */
39 cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
45 http_status_t status; /* HTTP status from server */
54 DEBUG_printf(("cupsGetFd(http=%p, resource=\"%s\", fd=%d)", (void *)http, resource, fd));
58 if (http)
59 http->error = EINVAL;
64 if (!http)
65 if ((http = _cupsConnect()) == NULL)
69 * Then send GET requests to the HTTP server...
72 strlcpy(if_modified_since, httpGetField(http, HTTP_FIELD_IF_MODIFIED_SINCE),
77 if (!_cups_strcasecmp(httpGetField(http, HTTP_FIELD_CONNECTION), "close"))
79 httpClearFields(http);
80 if (httpReconnect2(http, 30000, NULL))
87 httpClearFields(http);
88 httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
89 httpSetField(http, HTTP_FIELD_IF_MODIFIED_SINCE, if_modified_since);
91 if (httpGet(http, resource))
93 if (httpReconnect2(http, 30000, NULL))
105 while ((status = httpUpdate(http)) == HTTP_STATUS_CONTINUE);
113 httpFlush(http);
119 if (cupsDoAuthentication(http, "GET", resource))
125 if (httpReconnect2(http, 30000, NULL))
137 httpFlush(http);
140 if (httpReconnect2(http, 30000, NULL))
147 httpEncryption(http, HTTP_ENCRYPTION_REQUIRED);
166 while ((bytes = httpRead2(http, buffer, sizeof(buffer))) > 0)
172 httpFlush(http);
193 http_status_t /* O - HTTP status */
194 cupsGetFile(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
206 if (!http || !resource || !filename)
208 if (http)
209 http->error = EINVAL;
224 http->error = errno;
233 status = cupsGetFd(http, resource, fd);
245 * Return the HTTP status code...
261 http_status_t /* O - HTTP status */
262 cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
269 http_status_t status; /* HTTP status from server */
276 DEBUG_printf(("cupsPutFd(http=%p, resource=\"%s\", fd=%d)", (void *)http, resource, fd));
280 if (http)
281 http->error = EINVAL;
286 if (!http)
287 if ((http = _cupsConnect()) == NULL)
291 * Then send PUT requests to the HTTP server...
298 if (!_cups_strcasecmp(httpGetField(http, HTTP_FIELD_CONNECTION), "close"))
300 httpClearFields(http);
301 if (httpReconnect2(http, 30000, NULL))
309 http->authstring));
311 httpClearFields(http);
312 httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
313 httpSetField(http, HTTP_FIELD_TRANSFER_ENCODING, "chunked");
314 httpSetExpect(http, HTTP_STATUS_CONTINUE);
316 if (httpPut(http, resource))
318 if (httpReconnect2(http, 30000, NULL))
334 if (httpWait(http, 1000))
335 status = httpUpdate(http);
348 if (httpCheck(http))
350 if ((status = httpUpdate(http)) != HTTP_STATUS_CONTINUE)
354 httpWrite2(http, buffer, (size_t)bytes);
359 httpWrite2(http, buffer, 0);
361 while ((status = httpUpdate(http)) == HTTP_STATUS_CONTINUE);
371 httpFlush(http);
374 if (httpReconnect2(http, 30000, NULL))
392 httpFlush(http);
398 if (cupsDoAuthentication(http, "PUT", resource))
404 if (httpReconnect2(http, 30000, NULL))
416 httpFlush(http);
419 if (httpReconnect2(http, 30000, NULL))
426 httpEncryption(http, HTTP_ENCRYPTION_REQUIRED);
443 httpFlush(http);
461 http_status_t /* O - HTTP status */
462 cupsPutFile(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
474 if (!http || !resource || !filename)
476 if (http)
477 http->error = EINVAL;
492 http->error = errno;
501 status = cupsPutFd(http, resource, fd);