@@ -216,6 +216,7 @@ void ngx_link_func_log_info(ngx_link_func_ctx_t *ctx, const char* msg);
216216void ngx_link_func_log_warn (ngx_link_func_ctx_t * ctx , const char * msg );
217217void ngx_link_func_log_err (ngx_link_func_ctx_t * ctx , const char * msg );
218218char * ngx_link_func_strdup (ngx_link_func_ctx_t * ctx , const char * src );
219+ int ngx_link_func_get_uri (ngx_link_func_ctx_t * ctx , ngx_link_func_str_t * str );
219220u_char * ngx_link_func_get_header (ngx_link_func_ctx_t * ctx , const char * key , size_t keylen );
220221u_char * ngx_link_func_get_prop (ngx_link_func_ctx_t * ctx , const char * key , size_t keylen );
221222int ngx_link_func_add_header_in (ngx_link_func_ctx_t * ctx , const char * key , size_t keylen , const char * value , size_t val_len );
@@ -641,7 +642,7 @@ ngx_http_link_func_proceed_init_calls(ngx_cycle_t* cycle, ngx_http_link_func_sr
641642 ngx_http_link_func_app_cycle_handler func ;
642643
643644#if __FreeBSD__
644- (void ) dlerror ();
645+ (void ) dlerror ();
645646#endif
646647
647648 * (void * * )(& func ) = dlsym (scf -> _app , (const char * )"ngx_link_func_init_cycle" );
@@ -745,7 +746,7 @@ ngx_http_link_func_pre_configuration(ngx_conf_t *cf) {
745746 return NGX_ERROR ;
746747#endif
747748
748- #ifndef ngx_link_func_module_version_33
749+ #ifndef ngx_link_func_module_version_34
749750 ngx_conf_log_error (NGX_LOG_EMERG , cf , 0 , "%s" , "the ngx_http_link_func_module.h might not be latest or not found in the c header path, \
750751 please copy latest ngx_http_link_func_module.h to your /usr/include or /usr/local/include or relavent header search path \
751752 with read and write permission." );
@@ -813,7 +814,7 @@ ngx_http_link_func_application_compatibility_check(ngx_conf_t *cf, ngx_http_core
813814 }
814815
815816#if __FreeBSD__
816- (void ) dlerror ();
817+ (void ) dlerror ();
817818#endif
818819 /* * check init function block, this version has to be at least init with empty function * */
819820 ngx_http_link_func_app_cycle_handler func ;
@@ -826,7 +827,7 @@ ngx_http_link_func_application_compatibility_check(ngx_conf_t *cf, ngx_http_core
826827 }
827828
828829#if __FreeBSD__
829- (void ) dlerror ();
830+ (void ) dlerror ();
830831#endif
831832
832833 * (void * * )(& func ) = dlsym (scf -> _app , (const char * )"ngx_link_func_exit_cycle" );
@@ -846,9 +847,9 @@ ngx_http_link_func_application_compatibility_check(ngx_conf_t *cf, ngx_http_core
846847
847848 ngx_http_link_func_loc_conf_t * lcf = cflq -> _loc_conf ;
848849 if ( lcf && lcf -> _method_name .len > 0 ) {
849-
850+
850851#if __FreeBSD__
851- (void ) dlerror ();
852+ (void ) dlerror ();
852853#endif
853854
854855 * (void * * )(& lcf -> _handler ) = dlsym (scf -> _app , (const char * )lcf -> _method_name .data );
@@ -924,9 +925,9 @@ ngx_http_link_func_module_init(ngx_cycle_t *cycle) {
924925 if ( ( lcf -> _handler = ngx_http_link_func_get_duplicate_handler (scf , & lcf -> _method_name ) ) == NULL ) {
925926
926927#if __FreeBSD__
927- (void ) dlerror ();
928+ (void ) dlerror ();
928929#endif
929-
930+
930931 * (void * * )(& lcf -> _handler ) = dlsym (scf -> _app , (const char * )lcf -> _method_name .data );
931932 if ((error = dlerror ()) != NULL ) {
932933 ngx_log_error (NGX_LOG_EMERG , cycle -> log , 0 , "Error function load: %s" , error );
@@ -1026,7 +1027,7 @@ ngx_http_link_func_process_exit(ngx_cycle_t *cycle) {
10261027 ngx_http_link_func_app_cycle_handler func ;
10271028
10281029#if __FreeBSD__
1029- (void ) dlerror ();
1030+ (void ) dlerror ();
10301031#endif
10311032
10321033 * (void * * )(& func ) = dlsym (scf -> _app , (const char * )"ngx_link_func_exit_cycle" );
@@ -1848,6 +1849,18 @@ ngx_link_func_strdup(ngx_link_func_ctx_t *ctx, const char *src) {
18481849 return dst ;
18491850}
18501851
1852+ int
1853+ ngx_link_func_get_uri (ngx_link_func_ctx_t * ctx , ngx_link_func_str_t * str ) {
1854+ ngx_http_request_t * r = (ngx_http_request_t * )ctx -> __r__ ;
1855+ size_t len = r -> uri .len ;
1856+ if (len > 0 ) {
1857+ str -> len = len ;
1858+ str -> data = r -> uri .data ;
1859+ return 0 ; // NGX_OK
1860+ }
1861+ return -1 ; // NGX_ERROR
1862+ }
1863+
18511864static u_char *
18521865ngx_http_link_func_strdup_with_p (ngx_pool_t * pool , const char * src , size_t len ) {
18531866 u_char * dst ;
0 commit comments