else if (request->type == GTK_CUPS_GET)
get_states[request->state] (request);
+ if (gtk_cups_result_is_error (request->result))
+ request->state = GTK_CUPS_REQUEST_DONE;
+
if (request->attempts > _GTK_CUPS_MAX_ATTEMPTS &&
request->state != GTK_CUPS_REQUEST_DONE)
{
* The callback sets cups_password to NULL to signal that the
* password has been used.
*/
-static char *cups_password;
-static char *cups_username;
+static char *cups_password = NULL;
+static char *cups_username = NULL;
static const char *
passwordCB (const char *prompt)
if (request->password_state == GTK_CUPS_PASSWORD_APPLIED)
{
+ request->poll_state = GTK_CUPS_HTTP_IDLE;
request->password_state = GTK_CUPS_PASSWORD_NOT_VALID;
request->state = GTK_CUPS_POST_AUTH;
request->need_password = TRUE;
{
if (request->password_state == GTK_CUPS_PASSWORD_NONE)
{
- cups_password = g_strdup ("");
cups_username = request->username;
cupsSetPasswordCB (passwordCB);
/* move to AUTH state to let the backend
* ask for a password
*/
+ request->poll_state = GTK_CUPS_HTTP_IDLE;
request->state = GTK_CUPS_POST_AUTH;
request->need_password = TRUE;
if (request->password_state == GTK_CUPS_PASSWORD_APPLIED)
{
+ request->poll_state = GTK_CUPS_HTTP_IDLE;
request->password_state = GTK_CUPS_PASSWORD_NOT_VALID;
request->state = GTK_CUPS_GET_AUTH;
request->need_password = TRUE;
{
if (request->password_state == GTK_CUPS_PASSWORD_NONE)
{
- cups_password = g_strdup ("");
cups_username = request->username;
cupsSetPasswordCB (passwordCB);
/* move to AUTH state to let the backend
* ask for a password
*/
+ request->poll_state = GTK_CUPS_HTTP_IDLE;
request->state = GTK_CUPS_GET_AUTH;
request->need_password = TRUE;
return;
}
- request->state = GTK_CUPS_GET_SEND;
+ request->state = GTK_CUPS_GET_CONNECT;
request->last_status = HTTP_CONTINUE;
return;