aboutsummaryrefslogtreecommitdiff
path: root/fastcgi.h
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2009-04-05 20:45:49 +0200
committerStefan Bühler <stbuehler@web.de>2009-04-05 20:45:49 +0200
commit2912f13047d92d9a2171e906d7a1735311365267 (patch)
tree1ca61da55a61ddd7c0ba92e3929636b83efd1b74 /fastcgi.h
parentf06a31313aac9e621954398483bd0e102ea4587b (diff)
downloadfcgi-cgi-2912f13047d92d9a2171e906d7a1735311365267.tar.gz
fcgi-cgi-2912f13047d92d9a2171e906d7a1735311365267.zip
Add GByteArray as queue typev0.1.0
Diffstat (limited to 'fastcgi.h')
-rw-r--r--fastcgi.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/fastcgi.h b/fastcgi.h
index 7846675..a1851bd 100644
--- a/fastcgi.h
+++ b/fastcgi.h
@@ -56,8 +56,8 @@ typedef struct fastcgi_callbacks fastcgi_callbacks;
struct fastcgi_connection;
typedef struct fastcgi_connection fastcgi_connection;
-struct fastcgi_gstring_queue;
-typedef struct fastcgi_gstring_queue fastcgi_gstring_queue;
+struct fastcgi_queue;
+typedef struct fastcgi_queue fastcgi_queue;
struct fastcgi_server {
/* custom user data */
@@ -88,7 +88,7 @@ struct fastcgi_callbacks {
void (*cb_reset_connection)(fastcgi_connection *fcon); /* cleanup custom data before fcon is freed, not for keep-alive */
};
-struct fastcgi_gstring_queue {
+struct fastcgi_queue {
GQueue queue;
gsize offset; /* offset in first chunk */
gsize length;
@@ -135,7 +135,7 @@ struct fastcgi_connection {
gboolean read_suspended;
/* write queue */
- fastcgi_gstring_queue write_queue;
+ fastcgi_queue write_queue;
};
fastcgi_server *fastcgi_server_create(struct ev_loop *loop, gint socketfd, const fastcgi_callbacks *callbacks, guint max_connections);
@@ -154,7 +154,11 @@ void fastcgi_connection_close(fastcgi_connection *fcon); /* shouldn't be needed
void fastcgi_connection_environ_clear(fastcgi_connection *fcon);
const gchar* fastcgi_connection_environ_lookup(fastcgi_connection *fcon, const gchar* key, gsize keylen);
-void fastcgi_gstring_queue_append(fastcgi_gstring_queue *queue, GString *buf);
-void fastcgi_gstring_queue_clear(fastcgi_gstring_queue *queue);
+void fastcgi_queue_append_string(fastcgi_queue *queue, GString *buf);
+void fastcgi_queue_append_bytearray(fastcgi_queue *queue, GByteArray *buf);
+void fastcgi_queue_clear(fastcgi_queue *queue);
+
+/* return values: 0 ok, -1 error, -2 con closed */
+gint fastcgi_queue_write(int fd, fastcgi_queue *queue, gsize max_write);
#endif