* _httpFreeCredentials() - Free internal credentials.
* httpFreeCredentials() - Free an array of credentials.
* httpGet() - Send a GET request to the server.
- * httpGetContentEncoding() - Get a common content encoding, if any,
- * between the client and server.
* httpGetAuthString() - Get the current authorization string.
* httpGetBlocking() - Get the blocking/non-block state of a
* connection.
+ * httpGetContentEncoding() - Get a common content encoding, if any,
+ * between the client and server.
* httpGetCookie() - Get any cookie data from the response.
* httpGetExpect() - Get the value of the Expect header, if any.
* httpGetFd() - Get the file descriptor associated with a
}
+/*
+ * 'httpGetAuthString()' - Get the current authorization string.
+ *
+ * The authorization string is set by cupsDoAuthentication() and
+ * httpSetAuthString(). Use httpGetAuthString() to retrieve the
+ * string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
+ * value.
+ *
+ * @since CUPS 1.3/OS X 10.5@
+ */
+
+char * /* O - Authorization string */
+httpGetAuthString(http_t *http) /* I - Connection to server */
+{
+ if (http)
+ return (http->authstring);
+ else
+ return (NULL);
+}
+
+
+/*
+ * 'httpGetBlocking()' - Get the blocking/non-block state of a connection.
+ *
+ * @since CUPS 1.2/OS X 10.5@
+ */
+
+int /* O - 1 if blocking, 0 if non-blocking */
+httpGetBlocking(http_t *http) /* I - Connection to server */
+{
+ return (http ? http->blocking : 0);
+}
+
+
/*
* 'httpGetContentEncoding()' - Get a common content encoding, if any, between
* the client and server.
}
-/*
- * 'httpGetAuthString()' - Get the current authorization string.
- *
- * The authorization string is set by cupsDoAuthentication() and
- * httpSetAuthString(). Use httpGetAuthString() to retrieve the
- * string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
- * value.
- *
- * @since CUPS 1.3/OS X 10.5@
- */
-
-char * /* O - Authorization string */
-httpGetAuthString(http_t *http) /* I - Connection to server */
-{
- if (http)
- return (http->authstring);
- else
- return (NULL);
-}
-
-
-/*
- * 'httpGetBlocking()' - Get the blocking/non-block state of a connection.
- *
- * @since CUPS 1.2/OS X 10.5@
- */
-
-int /* O - 1 if blocking, 0 if non-blocking */
-httpGetBlocking(http_t *http) /* I - Connection to server */
-{
- return (http ? http->blocking : 0);
-}
-
-
/*
* 'httpGetCookie()' - Get any cookie data from the response.
*
if (http->state == HTTP_STATE_POST_RECV)
http->state ++;
+ else if (http->state == HTTP_STATE_GET_SEND ||
+ http->state == HTTP_STATE_POST_SEND)
+ http->state = HTTP_STATE_WAITING;
else
http->state = HTTP_STATE_STATUS;
/*
* 'httpSetDefaultField()' - Set the default value of an HTTP header.
*
- * Currently only HTTP_FIELD_ACCEPT_ENCODING, HTTP_FIELD_SERVER, and
- * HTTP_FIELD_USER_AGENT can be set.
+ * Currently only @code HTTP_FIELD_ACCEPT_ENCODING@, @code HTTP_FIELD_SERVER@,
+ * and @code HTTP_FIELD_USER_AGENT@ can be set.
*
* @since CUPS 1.7@
*/
CUPS_LLCAST bytes));
#ifdef DEBUG
if (bytes > 0)
- http_debug_hex("http_read", http->buffer, (int)bytes);
+ http_debug_hex("http_read", buffer, (int)bytes);
#endif /* DEBUG */
if (bytes < 0)
http->error = EIO;
http->status = HTTP_STATUS_ERROR;
- _cupsSetError(IPP_PKI_ERROR, gnutls_strerror(status), 0);
+ _cupsSetError(IPP_STATUS_ERROR_CUPS_PKI, gnutls_strerror(status), 0);
gnutls_deinit(http->tls);
gnutls_certificate_free_credentials(*credentials);