Lines Matching defs:uri
223 * URI_HASH_UNLINK(cur, new, hp, puri, uri) - unlink the uri_desc_t
224 * *uri which is a member of the uri_hash_t *hp list with a previous
291 #define URI_HASH_UNLINK(cur, new, hp, puri, uri) { \
293 (puri)->hash = (uri)->hash; \
295 (hp)->list = (uri)->hash; \
343 uri_desc_t *uri;
361 for (uri = hp->list; uri != NULL; uri = uri->hash) {
400 uri_desc_t *uri;
414 uri = hp->list;
415 while (uri != NULL) {
416 sc = *(uri->path.ep);
417 *(uri->path.ep) = 0;
419 uri->path.cp, (int)uri->resplen,
420 (int)uri->respclen, (int)uri->count);
421 *(uri->path.ep) = sc;
423 uri = uri->hash;
442 nl7c_uri_inactive(uri_desc_t *uri)
446 if (uri->tail) {
447 uri_rd_t *rdp = &uri->response;
467 if (uri->scheme != NULL) {
468 nl7c_http_free(uri->scheme);
470 if (uri->reqmp) {
471 freeb(uri->reqmp);
525 uri_desc_t *uri;
539 for (uri = hp->list; uri != NULL; uri = uri->hash) {
540 if (uri != del) {
541 puri = uri;
548 URI_HASH_UNLINK(cur, new, hp, puri, uri);
550 REF_RELE(uri);
569 uri_add(uri_desc_t *uri, krw_t rwlock, boolean_t nonblocking)
584 REF_HOLD(uri);
586 hix = uri->hvalue;
603 uri->hash = hp->list;
604 hp->list = uri;
703 hix = uri->hvalue;
707 uri->hash = hp->list;
708 hp->list = uri;
744 uri_desc_t *uri;
761 for (uri = hp->list; uri != NULL; uri = uri->hash) {
762 char *ap = uri->path.cp;
767 while (bp < rep && ap < uri->path.ep) {
770 H2A(ap, uri->path.ep, a);
783 if (bp != rep || ap != uri->path.ep) {
787 ap = uri->auth.cp;
794 while (bp < ruri->auth.ep && ap < uri->auth.ep) {
797 H2A(ap, uri->path.ep, a);
810 if (bp != ruri->auth.ep || ap != uri->auth.ep) {
823 if (uri->expire >= 0 && uri->expire <= ddi_get_lbolt() ||
835 puri->hash = uri->hash;
837 hp->list = uri->hash;
846 REF_RELE(uri);
849 if (uri->scheme != NULL) {
855 ! nl7c_http_cmp(uri->scheme, ruri->scheme))
870 REF_HOLD(uri);
871 mutex_enter(&uri->proclock);
872 if (uri->proc != NULL) {
877 cv_wait_sig(&uri->waiting, &uri->proclock)) {
883 mutex_exit(&uri->proclock);
884 REF_RELE(uri);
891 * uri hash hit uri to complete, in both
894 mutex_exit(&uri->proclock);
895 REF_RELE(uri);
899 mutex_exit(&uri->proclock);
900 uri->hit++;
903 return (uri);
905 puri = uri;
947 uri_desc_t *uri;
963 for (uri = hp->list; uri != NULL; uri = uri->hash) {
964 if (uri->hit != 0) {
968 uri->hit--;
969 puri = uri;
972 if (uri->proc != NULL) {
983 URI_HASH_UNLINK(cur, new, hp, puri, uri);
992 REF_RELE(uri);
1022 uri_desc_t *uri = (uri_desc_t *)sti->sti_nl7c_uri;
1025 if (uri->hash != URI_TEMP) {
1026 uri_delete(uri);
1027 mutex_enter(&uri->proclock);
1028 uri->proc = NULL;
1029 if (CV_HAS_WAITERS(&uri->waiting)) {
1030 cv_broadcast(&uri->waiting);
1032 mutex_exit(&uri->proclock);
1035 /* No proclock as uri exclusively owned by so */
1036 uri->proc = NULL;
1039 REF_RELE(uri);
1057 nl7c_resp_parse(struct sonode *so, uri_desc_t *uri, char *data, int sz)
1059 if (! nl7c_http_response(&data, &data[sz], uri, so)) {
1069 if (uri->hash != URI_TEMP && uri->nocache) {
1075 uri_delete(uri);
1076 mutex_enter(&uri->proclock);
1077 if (CV_HAS_WAITERS(&uri->waiting)) {
1078 cv_broadcast(&uri->waiting);
1080 mutex_exit(&uri->proclock);
1081 uri->hash = URI_TEMP;
1115 uri_desc_t *uri = (uri_desc_t *)sti->sti_nl7c_uri;
1127 if (uri == NULL) {
1142 URI_RD_ADD(uri, rdp, sz, -1);
1148 if (uri->hash != URI_TEMP && uri->count > nca_max_cache_size) {
1149 uri_delete(uri);
1150 uri->hash = URI_TEMP;
1179 perror = nl7c_resp_parse(so, uri, data, sz);
1182 error = uri_rd_response(so, uri, rdp, first);
1188 ((uri->respclen == URI_LEN_NOVALUE &&
1189 uri->resplen == URI_LEN_NOVALUE) ||
1190 uri->count >= uri->resplen)) {
1282 uri_desc_t *uri = (uri_desc_t *)sti->sti_nl7c_uri;
1299 if (uri == NULL) {
1378 URI_RD_ADD(uri, rdp, cnt, -1);
1387 if (uri->hash != URI_TEMP && total_count > nca_max_cache_size) {
1388 uri_delete(uri);
1389 uri->hash = URI_TEMP;
1393 perror = nl7c_resp_parse(so, uri, data, len);
1396 error = uri_rd_response(so, uri, rdp, first);
1407 URI_RD_ADD(uri, rdp, len - cnt, off);
1415 error = uri_rd_response(so, uri, rdp, first);
1433 ((uri->respclen == URI_LEN_NOVALUE &&
1434 uri->resplen == URI_LEN_NOVALUE) ||
1435 uri->count >= uri->resplen)) {
1483 uri_desc_t *uri = (uri_desc_t *)sti->sti_nl7c_uri;
1485 if (uri == NULL) {
1496 if (uri->hash != URI_TEMP) {
1497 mutex_enter(&uri->proclock);
1498 uri->proc = NULL;
1499 if (CV_HAS_WAITERS(&uri->waiting)) {
1500 cv_broadcast(&uri->waiting);
1502 mutex_exit(&uri->proclock);
1505 /* No proclock as uri exclusively owned by so */
1506 uri->proc = NULL;
1509 REF_RELE(uri);
1545 REF_RELE(desb->uri);
1623 REF_HOLD(temp->uri);
1634 REF_RELE(temp->uri);
1700 * Send the URI uri_desc_t *uri response uri_rd_t *rdp out the socket_t *so.
1705 uri_desc_t *uri,
1727 desb.uri = uri;
1755 if (uri->eoh >= rd.data.kmem &&
1756 uri->eoh < &rd.data.kmem[rd.sz]) {
1763 &wsz, &desb, max_mblk, uri->eoh, persist);
1839 * Send the URI uri_desc_t *uri response out the socket_t *so.
1843 uri_response(struct sonode *so, uri_desc_t *uri)
1845 uri_rd_t *rdp = &uri->response;
1850 error = uri_rd_response(so, uri, rdp, first);
1860 if (uri->hash != URI_TEMP)
1861 uri_delete(uri);
1952 uri_desc_t *uri = NULL;
1966 uri = kmem_cache_alloc(nl7c_uri_kmc, KM_SLEEP);
1967 REF_INIT(uri, 1, nl7c_uri_inactive, nl7c_uri_kmc);
1968 uri->hash = NULL;
1969 uri->tail = NULL;
1970 uri->scheme = NULL;
1971 uri->count = 0;
1972 uri->reqmp = reqmp;
2008 uri->hash = URI_TEMP;
2017 uri->hash = URI_TEMP;
2030 uri->path.cp = uris;
2031 uri->path.ep = cp;
2032 uri->hvalue = hv;
2033 if (! nl7c_http_request(&cp, ep, uri, so) || cp == NULL) {
2046 if (uri->nocache) {
2047 uri->hash = URI_TEMP;
2048 (void) uri_lookup(uri, B_FALSE, nonblocking);
2049 } else if (uri->hash == URI_TEMP) {
2050 uri->nocache = B_TRUE;
2051 (void) uri_lookup(uri, B_FALSE, nonblocking);
2054 if (uri->hash == URI_TEMP) {
2067 * uri in case we need it below.
2069 ruri = uri;
2070 if ((uri = uri_lookup(uri, B_TRUE, nonblocking)) == NULL) {
2080 if (uri->response.sz > 0) {
2107 nl7c_logd_log(ruri, uri, sti->sti_nl7c_rtime, faddr);
2112 uri = nl7c_http_cond(ruri, uri);
2117 * the socket, release reference on response uri, set the
2122 (void) uri_response(so, uri);
2123 REF_RELE(uri);
2135 * uri to so and so to uri, set WAITWRITE in the so such that
2141 uri->proc = so;
2142 sti->sti_nl7c_uri = uri;
2158 if (uri) {
2159 REF_RELE(uri);