Revision: 1097
Author: phrakt
Date: Tue May 11 19:59:01 2010
Log: add the function http_entity_getsize() to get the size of an entity
http://code.google.com/p/canopy-httpd/source/detail?r=1097
Modified:
/trunk/src/lib/http/entity.c
/trunk/src/lib/http/entity.h
=======================================
--- /trunk/src/lib/http/entity.c Tue May 11 18:40:03 2010
+++ /trunk/src/lib/http/entity.c Tue May 11 19:59:01 2010
@@ -221,6 +221,22 @@
return (buf);
}
+
+/*
+ * http_entity_getsize()
+ *
+ * Stores the size in bytes of the entity <ent> in the area pointed to by
the
+ * argument <sizep>.
+ *
+ * Returns 0 on success, or -1 on failure.
+ */
+int
+http_entity_getsize(http_ent_t *ent, uint64_t *sizep)
+{
+ *sizep = ent->ent_size;
+
+ return (0);
+}
/*
* http_entity_gettype()
=======================================
--- /trunk/src/lib/http/entity.h Tue May 11 18:40:03 2010
+++ /trunk/src/lib/http/entity.h Tue May 11 19:59:01 2010
@@ -76,6 +76,7 @@
ssize_t http_entity_read (http_ent_t *, off_t, void *,
size_t);
void http_entity_free (http_ent_t *);
char* http_entity_tag (http_ent_t *, char *, size_t);
+int http_entity_getsize (http_ent_t *, uint64_t *);
enum http_ent_type http_entity_gettype (http_ent_t *);
#endif /* _HTTP_ENTITY_H_ */
--
You received this message because you are subscribed to the Google Groups "Canopy Web Server Source Changes" group.
To post to this group, send email to
canopy-s...@googlegroups.com.
To unsubscribe from this group, send email to
canopy-srcchan...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/canopy-srcchanges?hl=en.