> -----Original Message-----
> Not exacly. There has been a quite big change in how to use cbdata.
I have attached a brief patch at the end of this message to see if I've got
this figured out. Please let me know if that's moving in the right
direction. If so I will try to finish the rest this weekend.
> This tag indicates the version of HEAD the
> rproxy branch is currently based on. Changes each time rproxy is
> updated to match HEAD using a almost automatic procedure. see
> http://devel.squid-cahce.org/
Would it be possible to create a new tag? I'm not sure of the right name:
maybe "rproxy-beta" or "rproxy-stable".. something that is designed to
represent a version of the rproxy patch that is intended to be more
compilable/runnable than the main version which obviously needs to stay
close to HEAD even at the cost of being occasionally broken. Then, the beta
tag could updated to follow the main rproxy changes once they are
integrated. I think it might get more people to try it and help find bugs.
Thanks,
Jeff
-- NearlyFreeSpeech.NET Support Team support@nearlyfreespeech.net http://www.nearlyfreespeech.net This rproxy patch is just an example cbdata update to see if I'm understanding the changes properly. retrieving revision 1.1.2.6.4.2 diff -c -r1.1.2.6.4.2 errormap.c *** errormap.c 5 Jun 2002 16:20:53 -0000 1.1.2.6.4.2 --- errormap.c 15 Jun 2002 01:09:59 -0000 *************** *** 98,112 **** requestUnlink(state->req); state->req = NULL; memFreeBuf(state->size, state->buf); ! cbdataUnlock(state->callback_data); ! state->callback_data = NULL; cbdataFree(state); } static void errorMapFetchAbort(ErrorMapState * state) { ! if (cbdataValid(state->callback_data)) state->callback(NULL, -1, -1, state->callback_data); errorMapFetchComplete(state); } --- 98,111 ---- requestUnlink(state->req); state->req = NULL; memFreeBuf(state->size, state->buf); ! cbdataReferenceDone(state->callback_data); cbdataFree(state); } static void errorMapFetchAbort(ErrorMapState * state) { ! if (cbdataReferenceValid(state->callback_data)) state->callback(NULL, -1, -1, state->callback_data); errorMapFetchComplete(state); } *************** *** 121,127 **** goto abort; if (size == 0) goto abort; ! if (!cbdataValid(state->callback_data)) goto abort; state->offset += size; --- 120,126 ---- goto abort; if (size == 0) goto abort; ! if (!cbdataReferenceValid(state->callback_data)) goto abort; state->offset += size; *************** *** 133,139 **** status = reply->sline.status; if (status != HTTP_OK) goto abort; ! /* Send object to caller (cbdataValid verified above) */ /* XXX/HNO Needs to send initial body content, etc */ state->callback(state->e, hdr_size, httpHeaderGetInt(&reply->header, HDR_CONTENT_LENGTH), state->callback_data); errorMapFetchComplete(state); --- 132,138 ---- status = reply->sline.status; if (status != HTTP_OK) goto abort; ! /* Send object to caller (cbdataReferenceValid verified above) */ /* XXX/HNO Needs to send initial body content, etc */ state->callback(state->e, hdr_size, httpHeaderGetInt(&reply->header, HDR_CONTENT_LENGTH), state->callback_data); errorMapFetchComplete(state); *************** *** 192,199 **** state->e = storeCreateEntry(errorUrl, errorUrl, req->flags, req->method); state->sc = storeClientListAdd(state->e, state); state->callback = callback; ! state->callback_data = callback_data; ! cbdataLock(callback_data); hdrpos = HttpHeaderInitPos; while ((hdr = httpHeaderGetEntry(&client_req->header, &hdrpos)) != NULL) { --- 191,197 ---- state->e = storeCreateEntry(errorUrl, errorUrl, req->flags, req->method); state->sc = storeClientListAdd(state->e, state); state->callback = callback; ! state->callback_data = cbdataReference(callback_data); hdrpos = HttpHeaderInitPos; while ((hdr = httpHeaderGetEntry(&client_req->header, &hdrpos)) != NULL) { Index: peer_userhash.c =================================================================== RCS file: /cvsroot/squid/squid/src/Attic/peer_userhash.c,v retrieving revision 1.1.2.10 diff -c -r1.1.2.10 peer_userhash.c *** peer_userhash.c 31 Jan 2002 13:58:00 -0000 1.1.2.10 --- peer_userhash.c 15 Jun 2002 01:09:59 -0000 *************** *** 60,66 **** char *t; /* Clean up */ for (k = 0; k < n_userhash_peers; k++) { ! cbdataUnlock(userhash_peers[k]); } safe_free(userhash_peers); n_userhash_peers = 0; --- 60,66 ---- char *t; /* Clean up */ for (k = 0; k < n_userhash_peers; k++) { ! cbdataReferenceDone(userhash_peers[k]); } safe_free(userhash_peers); n_userhash_peers = 0; *************** *** 94,101 **** if (floor(p->userhash.load_factor * 1000.0) == 0.0) p->userhash.load_factor = 0.0; /* add it to our list of peers */ ! *P++ = p; ! cbdataLock(p); } /* Sort our list on weight */ qsort(userhash_peers, n_userhash_peers, sizeof(*userhash_peers), peerSortWeight); --- 94,100 ---- if (floor(p->userhash.load_factor * 1000.0) == 0.0) p->userhash.load_factor = 0.0; /* add it to our list of peers */ ! *P++ = cbdataReference(p); } /* Sort our list on weight */ qsort(userhash_peers, n_userhash_peers, sizeof(*userhash_peers), peerSortWeight);
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:40 MST