i have created my module configuration with "create location configure" handler. then i want to have something to initiate wiht callback "postconfiguration". my function likes this: /////////////////////////////////////////// typedef struct{ ngx_int_t var; } gdrive_test_module_loc_conf_t; ngx_int_t gdrive_gfs_proxy_init(ngx_conf_t* cf) { gdrive_test_modulby supergui - Nginx Mailing List - English
2009/07/30 15:55:53 3989#0: *2 fd: -1476393696, r: 00002B25A80009D0 this is the debug message i log before ngx_http_output_filter, the address of r is 00002B25A80009D0, but the r->connection->fd change to be nagative??by supergui - Nginx Mailing List - English
below codes are main illustration to my meaning, that is i set a timer(just 1000ms) to output body , but this doesn't work? is this something do with the return value or i need to do more things? //////////////////////////////////////////////////////////////////////////////// char* out_buf[1024]={0} static ngx_int_t ngx_http_gdrive_handler(ngx_http_request_t *r) { //set myby supergui - Nginx Mailing List - English
my module need to write data to the client, for some reason i can not get the whole buffer at once. that is i get a trunk buffer to output now, and i must wait the next trunk buffer and output it. so i have to call ngx_output_http_filter from time to time until the whole data is output?? but i found the first time call ngx_output_http_filter is ok, later(after a timer) i call ngx_output_http_filtby supergui - Nginx Mailing List - English
the situation is that the fd is close by the client, the nginx will close the connection. my module need to know the close event, and do some my customized close action before that(e.g release my resource).by supergui - Nginx Mailing List - English
Thank your Brice Figureau, i have solved it now with your help~~by supergui - Nginx Mailing List - English
i just call ngx_output_http_filter to write my stream to the client, but i need to know exactly when and how much bytes is written to the client, and i need to record the moment, is there any method?by supergui - Nginx Mailing List - English
//////////////////////////////////////////////////////////////////////////////////////////////////////////// static ngx_event_t gdrive_timer_wev; static ngx_connection_t dumb; ngx_int_t ngx_http_gdrive_init_process(ngx_cycle_t *cycle) { ngx_log_error(NGX_LOG_DEBUG, cycle->log, 0, "set gdrive timer"); gdrive_timer_wev.handler=test_timer; gdrive_timer_wev.log=cycle-&by supergui - Nginx Mailing List - English
//////////////////////////////////////////////////////////////////////////////////////////////////////////// static ngx_event_t gdrive_timer_wev; static ngx_connection_t dumb; ngx_int_t ngx_http_gdrive_init_process(ngx_cycle_t *cycle) { ngx_log_error(NGX_LOG_DEBUG, cycle->log, 0, "set gdrive timer"); gdrive_timer_wev.handler=test_timer; gdrive_timer_wev.log=cycle-&by supergui - Nginx Mailing List - English
Thanks very much Grzegorz Sienko. But perhaps there is some differences of my case, i have to change the rate at running time, that is i have to control the rate in my own module code. And i have my own file system to read file, so i have to do every thing from reading file from my file system to write stream at controled rate to the client. I have just found there is a timer in nginx that maybeby supergui - Nginx Mailing List - English
////////////////////////////////////////////////////////////////////////////////////////////////////////// gdrive_timer_wev.handler=test_timer; ngx_add_timer(&gdrive_timer_wev, 5); static void test_timer(ngx_event_t *wev) { ngx_log_error(NGX_LOG_DEBUG, wev->log, 0, "timer out"); } //////////////////////////////////////////////////////////////////////////////////by supergui - Nginx Mailing List - English
I want to write a module to transfer files to client, but it need to limit the speed of transfer. how can i implement it ? it is likely that i should output one buffer per time, and then check the avg speed before, if expire the setting speed what should i do then?by supergui - Nginx Mailing List - English