| 5871 | */ |
| 5872 | |
| 5873 | static void |
| 5874 | create_subscriptions( |
| 5875 | cupsd_client_t *con, /* I - Client connection */ |
| 5876 | ipp_attribute_t *uri) /* I - Printer URI */ |
| 5877 | { |
| 5878 | http_status_t status; /* Policy status */ |
| 5879 | int i; /* Looping var */ |
| 5880 | ipp_attribute_t *attr; /* Current attribute */ |
| 5881 | cups_ptype_t dtype; /* Destination type (printer/class) */ |
| 5882 | char scheme[HTTP_MAX_URI], |
| 5883 | /* Scheme portion of URI */ |
| 5884 | userpass[HTTP_MAX_URI], |
| 5885 | /* Username portion of URI */ |
| 5886 | host[HTTP_MAX_URI], |
| 5887 | /* Host portion of URI */ |
| 5888 | resource[HTTP_MAX_URI]; |
| 5889 | /* Resource portion of URI */ |
| 5890 | int port; /* Port portion of URI */ |
| 5891 | cupsd_printer_t *printer; /* Printer/class */ |
| 5892 | cupsd_job_t *job; /* Job */ |
| 5893 | int jobid; /* Job ID */ |
| 5894 | cupsd_subscription_t *sub; /* Subscription object */ |
| 5895 | const char *username, /* requesting-user-name or |
| 5896 | authenticated username */ |
| 5897 | *recipient, /* notify-recipient-uri */ |
| 5898 | *pullmethod; /* notify-pull-method */ |
| 5899 | ipp_attribute_t *user_data; /* notify-user-data */ |
| 5900 | int interval, /* notify-time-interval */ |
| 5901 | lease; /* notify-lease-duration */ |
| 5902 | unsigned mask; /* notify-events */ |
| 5903 | ipp_attribute_t *notify_events,/* notify-events(-default) */ |
| 5904 | *notify_lease; /* notify-lease-duration(-default) */ |
| 5905 | |
| 5906 | |
| 5907 | #ifdef DEBUG |
| 5908 | for (attr = con->request->attrs; attr; attr = attr->next) |
| 5909 | { |
| 5910 | if (attr->group_tag != IPP_TAG_ZERO) |
| 5911 | cupsdLogMessage(CUPSD_LOG_DEBUG2, "g%04x v%04x %s", attr->group_tag, |
| 5912 | attr->value_tag, attr->name); |
| 5913 | else |
| 5914 | cupsdLogMessage(CUPSD_LOG_DEBUG2, "----SEP----"); |
| 5915 | } |
| 5916 | #endif /* DEBUG */ |
| 5917 | |
| 5918 | /* |
| 5919 | * Is the destination valid? |
| 5920 | */ |
| 5921 | |
| 5922 | cupsdLogMessage(CUPSD_LOG_DEBUG, "create_subscriptions(con=%p(%d), uri=\"%s\")", (void *)con, con->number, uri->values[0].string.text); |
| 5923 | |
| 5924 | httpSeparateURI(HTTP_URI_CODING_ALL, uri->values[0].string.text, scheme, |
| 5925 | sizeof(scheme), userpass, sizeof(userpass), host, |
| 5926 | sizeof(host), &port, resource, sizeof(resource)); |
| 5927 | |
| 5928 | if (!strcmp(resource, "/")) |
| 5929 | { |
| 5930 | dtype = (cups_ptype_t)0; |
no test coverage detected