/*
- * "$Id: http.c 12034 2014-07-16 19:37:34Z msweet $"
+ * "$Id: http.c 12125 2014-08-28 15:49:29Z msweet $"
*
* HTTP routines for CUPS.
*
/*
* 'httpCompareCredentials()' - Compare two sets of X.509 credentials.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
int /* O - 1 if they match, 0 if they do not */
*
* The return value is the UNIX time of the last read or write.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
time_t /* O - Time of last read or write */
* @link httpIsEncrypted@ function to determine whether a TLS session has
* been established.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
http_encryption_t /* O - Current encryption mode */
/*
* 'httpGetKeepAlive()' - Get the current Keep-Alive state of the connection.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
http_keepalive_t /* O - Keep-Alive state */
/*
* 'httpGetPending()' - Get the number of bytes that are buffered for writing.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
size_t /* O - Number of bytes buffered */
/*
* 'httpGetReady()' - Get the number of bytes that can be read without blocking.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
size_t /* O - Number of bytes available */
* The @link httpIsChunked@ function can be used to determine whether the
* message body is chunked or fixed-length.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
size_t /* O - Remaining bytes */
* This function returns non-zero if the message body is composed of
* variable-length chunks.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
int /* O - 1 if chunked, 0 if not */
*
* This function returns non-zero if the connection is currently encrypted.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
int /* O - 1 if encrypted, 0 if not */
memcpy(http->sbuffer + http->stream.avail_in, http->buffer, buflen);
http->stream.avail_in += buflen;
- http->used -= buflen;
- http->data_remaining -= buflen;
+ http->used -= (int)buflen;
+ http->data_remaining -= (off_t)buflen;
if (http->used > 0)
memmove(http->buffer, http->buffer + buflen, (size_t)http->used);
if (!http || cupsArrayCount(credentials) < 1)
return (-1);
+#ifdef HAVE_SSL
_httpFreeCredentials(http->tls_credentials);
http->tls_credentials = _httpCreateCredentials(credentials);
+#endif /* HAVE_SSL */
return (http->tls_credentials ? 0 : -1);
}
/*
* 'httpSetKeepAlive()' - Set the current Keep-Alive state of a connection.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
void
/*
* 'httpShutdown()' - Shutdown one side of an HTTP connection.
*
- * @since CUPS 2.0@
+ * @since CUPS 2.0/OS 10.10@
*/
void
if (!http || http->fd < 0)
return;
+#ifdef HAVE_SSL
if (http->tls)
_httpTLSStop(http);
+#endif /* HAVE_SSL */
#ifdef WIN32
shutdown(http->fd, SD_RECEIVE); /* Microsoft-ism... */
/*
- * End of "$Id: http.c 12034 2014-07-16 19:37:34Z msweet $".
+ * End of "$Id: http.c 12125 2014-08-28 15:49:29Z msweet $".
*/