@@ -305,7 +305,7 @@ static ngx_command_t ngx_http_link_func_commands[] = {
305
305
offsetof(ngx_http_link_func_loc_conf_t , _method_name ), /* No offset when storing the module configuration on struct. */
306
306
NULL
307
307
},
308
- { ngx_string ("ngx_link_func_add_prop" ),
308
+ { ngx_string ("ngx_link_func_add_prop" ),
309
309
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE2 ,
310
310
ngx_conf_set_keyval_slot ,
311
311
NGX_HTTP_SRV_CONF_OFFSET ,
@@ -630,7 +630,7 @@ ngx_http_link_func_init_method(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) {
630
630
if (scf && scf -> _libname .len > 0 ) {
631
631
return ngx_conf_set_str_slot (cf , cmd , conf );
632
632
}
633
-
633
+
634
634
return "No application linking in server block" ;
635
635
} /* ngx_http_link_func_init_method */
636
636
@@ -653,7 +653,7 @@ ngx_http_link_func_proceed_init_calls(ngx_cycle_t* cycle, ngx_http_link_func_sr
653
653
appcyc .__log__ = cycle -> log ;
654
654
appcyc .shared_mem = (void * )mcf -> shm_ctx -> shared_mem ;
655
655
func (& appcyc );
656
- if (appcyc .has_error ) {
656
+ if (appcyc .has_error ) {
657
657
ngx_log_error (NGX_LOG_EMERG , cycle -> log , 0 , "%s" , "link function worker Initialize unsuccessfully" );
658
658
return NGX_ERROR ;
659
659
}
@@ -673,11 +673,11 @@ ngx_http_link_func_post_configuration(ngx_conf_t *cf) {
673
673
674
674
cmcf = ngx_http_conf_get_module_main_conf (cf , ngx_http_core_module );
675
675
676
- if ( cmcf == NULL ) {
676
+ if ( cmcf == NULL ) {
677
677
return NGX_ERROR ;
678
678
}
679
679
680
- if ( ngx_http_link_func_application_compatibility_check (cf , cmcf ) == NGX_ERROR ) {
680
+ if ( ngx_http_link_func_application_compatibility_check (cf , cmcf ) == NGX_ERROR ) {
681
681
return NGX_ERROR ;
682
682
}
683
683
@@ -811,16 +811,16 @@ ngx_http_link_func_application_compatibility_check(ngx_conf_t *cf, ngx_http_core
811
811
ngx_http_link_func_app_cycle_handler func ;
812
812
* (void * * )(& func ) = dlsym (scf -> _app , (const char * )"ngx_link_func_init_cycle" );
813
813
if ((error = dlerror ()) != NULL ) {
814
- ngx_conf_log_error (NGX_LOG_ERR , cf , 0 ,
815
- "function ngx_link_func_init_cycle(ngx_link_func_cycle_t *cycle) not found in \"%V\", at least create an empty init function block \n %s" ,
816
- & scf -> _libname , error );
814
+ ngx_conf_log_error (NGX_LOG_ERR , cf , 0 ,
815
+ "function ngx_link_func_init_cycle(ngx_link_func_cycle_t *cycle) not found in \"%V\", at least create an empty init function block \n %s" ,
816
+ & scf -> _libname , error );
817
817
return NGX_ERROR ;
818
818
}
819
819
* (void * * )(& func ) = dlsym (scf -> _app , (const char * )"ngx_link_func_exit_cycle" );
820
820
if ((error = dlerror ()) != NULL ) {
821
- ngx_conf_log_error (NGX_LOG_ERR , cf , 0 ,
822
- "function ngx_link_func_exit_cycle(ngx_link_func_cycle_t *cycle) not found in \"%V\", at least create an empty exit function block \n %s" ,
823
- & scf -> _libname , error );
821
+ ngx_conf_log_error (NGX_LOG_ERR , cf , 0 ,
822
+ "function ngx_link_func_exit_cycle(ngx_link_func_cycle_t *cycle) not found in \"%V\", at least create an empty exit function block \n %s" ,
823
+ & scf -> _libname , error );
824
824
}
825
825
826
826
@@ -932,7 +932,7 @@ ngx_http_link_func_module_init(ngx_cycle_t *cycle) {
932
932
// return NGX_ERROR;
933
933
// }
934
934
ngx_queue_remove (q );
935
- }
935
+ }
936
936
} else {
937
937
continue ;
938
938
}
@@ -1013,7 +1013,7 @@ ngx_http_link_func_process_exit(ngx_cycle_t *cycle) {
1013
1013
appcyc .__log__ = cycle -> log ;
1014
1014
appcyc .shared_mem = (void * )mcf -> shm_ctx -> shared_mem ;
1015
1015
func (& appcyc );
1016
- if (appcyc .has_error ) {
1016
+ if (appcyc .has_error ) {
1017
1017
ngx_log_error (NGX_LOG_ERR , cycle -> log , 0 , "%s" , "link function worker exit error" );
1018
1018
}
1019
1019
}
@@ -1872,24 +1872,24 @@ ngx_link_func_get_prop(ngx_link_func_ctx_t *ctx, const char *key, size_t keylen)
1872
1872
1873
1873
scf = ngx_http_get_module_srv_conf (r , ngx_http_link_func_module );
1874
1874
1875
- if ( scf == NULL ) {
1875
+ if ( scf == NULL ) {
1876
1876
ngx_log_error (NGX_LOG_EMERG , r -> connection -> log , 0 , "Invalid link function server config" );
1877
1877
return NULL ;
1878
1878
}
1879
1879
1880
- if (scf -> _props == NULL ) {
1880
+ if (scf -> _props == NULL ) {
1881
1881
return NULL ;
1882
1882
}
1883
1883
1884
1884
nelts = scf -> _props -> nelts ;
1885
1885
keyval = scf -> _props -> elts ;
1886
1886
1887
1887
for (i = 0 ; i < nelts ; i ++ ) {
1888
- if ( keyval -> key .len == keylen && ngx_strncasecmp (keyval -> key .data , (u_char * ) key , keylen ) == 0 ) {
1889
- /** it is config memory pool, should not reallocate or overwrite **/
1890
- return keyval -> value .data ;
1891
- }
1892
- keyval ++ ;
1888
+ if ( keyval -> key .len == keylen && ngx_strncasecmp (keyval -> key .data , (u_char * ) key , keylen ) == 0 ) {
1889
+ /** it is config memory pool, should not reallocate or overwrite **/
1890
+ return keyval -> value .data ;
1891
+ }
1892
+ keyval ++ ;
1893
1893
}
1894
1894
return NULL ;
1895
1895
}
@@ -1906,26 +1906,26 @@ ngx_link_func_cyc_get_prop(ngx_link_func_cycle_t *cyc, const char *key, size_t k
1906
1906
}
1907
1907
1908
1908
log = (ngx_log_t * ) cyc -> __log__ ;
1909
- scf = (ngx_http_link_func_srv_conf_t * ) cyc -> __srv_cf__ ;
1909
+ scf = (ngx_http_link_func_srv_conf_t * ) cyc -> __srv_cf__ ;
1910
1910
1911
- if ( scf == NULL || log == NULL ) {
1911
+ if ( scf == NULL || log == NULL ) {
1912
1912
ngx_log_error (NGX_LOG_EMERG , log , 0 , "Invalid link function server config" );
1913
1913
return NULL ;
1914
1914
}
1915
1915
1916
- if (scf -> _props == NULL ) {
1916
+ if (scf -> _props == NULL ) {
1917
1917
return NULL ;
1918
1918
}
1919
1919
1920
1920
nelts = scf -> _props -> nelts ;
1921
1921
keyval = scf -> _props -> elts ;
1922
1922
1923
1923
for (i = 0 ; i < nelts ; i ++ ) {
1924
- if ( keyval -> key .len == keylen && ngx_strncasecmp (keyval -> key .data , (u_char * ) key , keylen ) == 0 ) {
1925
- /** it is config memory pool, should not reallocate or overwrite **/
1926
- return keyval -> value .data ;
1927
- }
1928
- keyval ++ ;
1924
+ if ( keyval -> key .len == keylen && ngx_strncasecmp (keyval -> key .data , (u_char * ) key , keylen ) == 0 ) {
1925
+ /** it is config memory pool, should not reallocate or overwrite **/
1926
+ return keyval -> value .data ;
1927
+ }
1928
+ keyval ++ ;
1929
1929
}
1930
1930
return NULL ;
1931
1931
}
@@ -2327,7 +2327,7 @@ ngx_http_link_func_connect_and_request(int *sockfd, ngx_http_link_func_srv_conf_
2327
2327
if ( connect (* sockfd , (struct sockaddr * ) & dest_addr ,
2328
2328
sizeof (struct sockaddr )) == -1 ) {
2329
2329
ngx_conf_log_error (NGX_LOG_EMERG , cf , 0 , "Unable connect to host %s - %s on port %d.\n" ,
2330
- hostname , inet_ntoa (dest_addr .sin_addr ), port );
2330
+ hostname , inet_ntoa (dest_addr .sin_addr ), port );
2331
2331
rc = 0 ;
2332
2332
}
2333
2333
rc = 1 ;
@@ -2498,7 +2498,7 @@ ngx_http_link_func_connect_and_request_via_ssl(int *sockfd, ngx_http_link_func_s
2498
2498
if ( connect (* sockfd , (struct sockaddr * ) & dest_addr ,
2499
2499
sizeof (struct sockaddr )) == -1 ) {
2500
2500
ngx_conf_log_error (NGX_LOG_EMERG , cf , 0 , "Unable connect to host %s - %s on port %d.\n" ,
2501
- hostname , inet_ntoa (dest_addr .sin_addr ), port );
2501
+ hostname , inet_ntoa (dest_addr .sin_addr ), port );
2502
2502
rc = 0 ;
2503
2503
goto DONE ;
2504
2504
}
0 commit comments