Author: adrian.chadd
Date: Tue Apr 28 16:34:35 2009
New Revision: 14009
Modified:
branches/LUSCA_HEAD/libhttp/HttpHeaderEntry.c
branches/LUSCA_HEAD/libhttp/HttpHeaderEntry.h
Log:
Bring on board some new http header functions from the http_work playpen
branch.
Modified: branches/LUSCA_HEAD/libhttp/HttpHeaderEntry.c
==============================================================================
--- branches/LUSCA_HEAD/libhttp/HttpHeaderEntry.c (original)
+++ branches/LUSCA_HEAD/libhttp/HttpHeaderEntry.c Tue Apr 28 16:34:35 2009
@@ -74,11 +74,39 @@
* HttpHeaderEntry
*/
+/* XXX new functions */
+void
+httpHeaderEntryInitString(HttpHeaderEntry *e, http_hdr_type id, String
name, String value)
+{
+ assert(e->active == 0);
+
+ e->id = id;
+ if (id != HDR_OTHER)
+ e->name = Headers[id].name;
+ else
+ e->name = stringDup(&name);
+ e->value = stringDup(&value);
+ Headers[id].stat.aliveCount++;
+ e->active = 1;
+
+ debug(55, 9) ("httpHeaderEntryInitString: entry %p: '%s: %s'\n", e,
+ strBuf(e->name), strBuf(e->value));
+}
+
+void
+httpHeaderEntryCopy(HttpHeaderEntry *dst, HttpHeaderEntry *src)
+{
+ httpHeaderEntryInitString(dst, src->id, src->name, src->value);
+}
+
+/* XXX old functions */
+
/*
* A length of -1 means "unknown; call strlen()
*/
void
httpHeaderEntryCreate(HttpHeaderEntry *e, http_hdr_type id, const char
*name, int al, const char *value, int vl)
+
{
assert_eid(id);
assert(! e->active);
Modified: branches/LUSCA_HEAD/libhttp/HttpHeaderEntry.h
==============================================================================
--- branches/LUSCA_HEAD/libhttp/HttpHeaderEntry.h (original)
+++ branches/LUSCA_HEAD/libhttp/HttpHeaderEntry.h Tue Apr 28 16:34:35 2009
@@ -21,4 +21,9 @@
extern void httpHeaderEntryDestroy(HttpHeaderEntry * e);
extern void httpHeaderEntryClone(HttpHeaderEntry *new_e, const
HttpHeaderEntry * e);
+/* new low-level routines */
+extern void httpHeaderEntryInitString(HttpHeaderEntry *e, http_hdr_type
id, String name, String value);
+extern void httpHeaderEntryCopy(HttpHeaderEntry *dst, HttpHeaderEntry
*src);
+/* Destroy, Clone, Create/Create2 now belong here */
+
#endif
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---