Revision: 14605
Author: adrian.chadd
Date: Sat Apr 17 18:14:03 2010
Log: Issue #108 - change this function to return the entry offset rather
than the entry pointer.
This makes it easier to remove the item from the entries list at a later
date.
http://code.google.com/p/lusca-cache/source/detail?r=14605
Modified:
/branches/LUSCA_HEAD/libhttp/HttpHeader.c
/branches/LUSCA_HEAD/libhttp/HttpHeader.h
=======================================
--- /branches/LUSCA_HEAD/libhttp/HttpHeader.c Tue Apr 13 20:49:57 2010
+++ /branches/LUSCA_HEAD/libhttp/HttpHeader.c Sat Apr 17 18:14:03 2010
@@ -312,13 +312,13 @@
/*
* -1 means "don't know length, call strlen()
*/
-HttpHeaderEntry *
+int
httpHeaderAddEntryStr2(HttpHeader *hdr, http_hdr_type id, const char *a,
int al, const char *v, int vl)
{
HttpHeaderEntry *e = memPoolAlloc(pool_http_header_entry);
httpHeaderEntryCreate(e, id, a, al, v, vl);
httpHeaderAddEntry(hdr, e);
- return e;
+ return(hdr->entries.count - 1);
}
void
=======================================
--- /branches/LUSCA_HEAD/libhttp/HttpHeader.h Tue Apr 13 20:38:00 2010
+++ /branches/LUSCA_HEAD/libhttp/HttpHeader.h Sat Apr 17 18:14:03 2010
@@ -56,7 +56,7 @@
extern HttpHeaderEntry *httpHeaderFindLastEntry(const HttpHeader * hdr,
http_hdr_type id);
extern void httpHeaderAddEntryStr(HttpHeader *hdr, http_hdr_type id, const
char *attrib, const char *value);
-extern HttpHeaderEntry * httpHeaderAddEntryStr2(HttpHeader *hdr,
http_hdr_type id, const char *attrib, int attrib_len, const char *value,
int value_len);
+extern int httpHeaderAddEntryStr2(HttpHeader *hdr, http_hdr_type id, const
char *attrib, int attrib_len, const char *value, int value_len);
extern void httpHeaderAddEntryString(HttpHeader *hdr, http_hdr_type id,
const String *a, const String *v);
extern void httpHeaderInsertEntryStr(HttpHeader *hdr, int pos,
http_hdr_type id, const char *attrib, const char *value);
--
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en.