00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00037 #ifndef _core_bh_upload_h_
00038 #define _core_bh_upload_h_
00039 
00040 #include "common.h"
00041 
00042 #include "tx.h"
00043 #include "tx_link.h"
00044 #include "tx_deflate.h"
00045 
00046 #include "if/core/hosts.h"
00047 #include "if/core/wrap.h"
00048 
00052 #define BH_VERSION_MAJOR    1
00053 #define BH_VERSION_MINOR    0
00054 
00058 #define BH_DEFLATE  (1 << 0)        
00059 #define BH_GZIP     (1 << 1)        
00060 #define BH_CHUNKED  (1 << 2)        
00061 #define BH_HTML     (1 << 3)        
00062 #define BH_QHITS    (1 << 4)        
00064 struct gnutella_socket;
00065 struct bio_source;
00066 
00067 typedef void (*bh_closed_t)(gpointer arg);
00068 typedef void (*bh_writable_t)(gpointer arg);
00069 
00070 struct special_ctx {
00071     txdrv_t *tx;
00072     ssize_t (*read)(gpointer ctx, gpointer dest, size_t size);
00073     ssize_t (*write)(gpointer ctx, gpointer data, size_t size);
00074     void (*flush)(gpointer ctx, bh_closed_t cb, gpointer arg);
00075     void (*close)(gpointer ctx, gboolean fully_served);
00076 };
00077 
00078 struct special_ctx *browse_host_open(
00079     gpointer owner, gnet_host_t *host,
00080     bh_writable_t writable,
00081     struct tx_deflate_cb *deflate_cb,
00082     struct tx_link_cb *link_cb,
00083     wrap_io_t *wio,
00084     gint flags);
00085 
00086 #endif 
00087 
00088