buff.c小结

struct buff_struct {
    int flags;   /* flags */
    unsigned char *inptr; /* pointer to next location to read */
    int incnt;   /* number of bytes left to read from input buffer;
     * always 0 if had a read error  */
    int outchunk;  /* location of chunk header when chunking */
    int outcnt;   /* number of byte put in output buffer */
    unsigned char *inbase; ///???
    unsigned char *outbase;
    int bufsiz;
    void (*error) (BUFF *fb, int op, void *data);
    void *error_data;
    long int bytes_sent; /* number of bytes actually written */

    ap_pool *pool;

/* could also put pointers to the basic I/O routines here */
    int fd;   /* the file descriptor */
    int fd_in;   /* input file descriptor, if different */
#ifdef WIN32
    HANDLE hFH;   /* Windows filehandle */
#endif

    /* transport handle, for RPC binding handle or some such */
    void *t_handle;

#ifdef B_SFIO
    Sfio_t *sf_in;
    Sfio_t *sf_out;
#endif

    void *callback_data;
    void (*filter_callback)(BUFF *, const void *, int );
 
};

#ifdef B_SFIO
typedef struct {
    Sfdisc_t disc;
    BUFF *buff;
} apache_sfio;

这个结构蛮复杂的,涉及文件读写,Socket读写,apache 里的chunk具体含义还不是很明白,还有ebcdic编码等内容,不过windows和linux都不会用到这种编码了,呵呵,写这些东西主要是让自己能够继续分析下去,现在多少就有点想

退缩了,毕竟是第一次分析开源的代码,业余时间也不够,看代码很辛苦的,希望有此爱好的朋友能够大家多交流

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值