@@ -216,6 +216,7 @@ void ngx_link_func_log_info(ngx_link_func_ctx_t *ctx, const char* msg);
216
216
void ngx_link_func_log_warn (ngx_link_func_ctx_t * ctx , const char * msg );
217
217
void ngx_link_func_log_err (ngx_link_func_ctx_t * ctx , const char * msg );
218
218
char * 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 );
219
220
u_char * ngx_link_func_get_header (ngx_link_func_ctx_t * ctx , const char * key , size_t keylen );
220
221
u_char * ngx_link_func_get_prop (ngx_link_func_ctx_t * ctx , const char * key , size_t keylen );
221
222
int 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
641
642
ngx_http_link_func_app_cycle_handler func ;
642
643
643
644
#if __FreeBSD__
644
- (void ) dlerror ();
645
+ (void ) dlerror ();
645
646
#endif
646
647
647
648
* (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) {
745
746
return NGX_ERROR ;
746
747
#endif
747
748
748
- #ifndef ngx_link_func_module_version_33
749
+ #ifndef ngx_link_func_module_version_34
749
750
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, \
750
751
please copy latest ngx_http_link_func_module.h to your /usr/include or /usr/local/include or relavent header search path \
751
752
with read and write permission." );
@@ -813,7 +814,7 @@ ngx_http_link_func_application_compatibility_check(ngx_conf_t *cf, ngx_http_core
813
814
}
814
815
815
816
#if __FreeBSD__
816
- (void ) dlerror ();
817
+ (void ) dlerror ();
817
818
#endif
818
819
/* * check init function block, this version has to be at least init with empty function * */
819
820
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
826
827
}
827
828
828
829
#if __FreeBSD__
829
- (void ) dlerror ();
830
+ (void ) dlerror ();
830
831
#endif
831
832
832
833
* (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
846
847
847
848
ngx_http_link_func_loc_conf_t * lcf = cflq -> _loc_conf ;
848
849
if ( lcf && lcf -> _method_name .len > 0 ) {
849
-
850
+
850
851
#if __FreeBSD__
851
- (void ) dlerror ();
852
+ (void ) dlerror ();
852
853
#endif
853
854
854
855
* (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) {
924
925
if ( ( lcf -> _handler = ngx_http_link_func_get_duplicate_handler (scf , & lcf -> _method_name ) ) == NULL ) {
925
926
926
927
#if __FreeBSD__
927
- (void ) dlerror ();
928
+ (void ) dlerror ();
928
929
#endif
929
-
930
+
930
931
* (void * * )(& lcf -> _handler ) = dlsym (scf -> _app , (const char * )lcf -> _method_name .data );
931
932
if ((error = dlerror ()) != NULL ) {
932
933
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) {
1026
1027
ngx_http_link_func_app_cycle_handler func ;
1027
1028
1028
1029
#if __FreeBSD__
1029
- (void ) dlerror ();
1030
+ (void ) dlerror ();
1030
1031
#endif
1031
1032
1032
1033
* (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) {
1848
1849
return dst ;
1849
1850
}
1850
1851
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
+
1851
1864
static u_char *
1852
1865
ngx_http_link_func_strdup_with_p (ngx_pool_t * pool , const char * src , size_t len ) {
1853
1866
u_char * dst ;
0 commit comments