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都不會用到這種編碼了,呵呵,寫這些東西主要是讓自己能夠繼續分析下去,現在多少就有點想

退縮了,畢竟是第一次分析開源的代碼,業餘時間也不夠,看代碼很辛苦的,希望有此愛好的朋友能夠大家多交流

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章