@@ -886,7 +886,7 @@ ngx_http_lua_socket_tcp_receive(lua_State *L)
886886
887887 if (u == NULL || u -> peer .connection == NULL || u -> ft_type || u -> eof ) {
888888 ngx_log_error (NGX_LOG_ERR , r -> connection -> log , 0 ,
889- "attemp to receive data on a closed socket: u:%p, c:%p, "
889+ "attempt to receive data on a closed socket: u:%p, c:%p, "
890890 "ft:%ui eof:%ud" ,
891891 u , u ? u -> peer .connection : NULL , u ? u -> ft_type : 0 ,
892892 u ? u -> eof : 0 );
@@ -1402,7 +1402,7 @@ ngx_http_lua_socket_tcp_send(lua_State *L)
14021402
14031403 if (u == NULL || u -> peer .connection == NULL || u -> ft_type || u -> eof ) {
14041404 ngx_log_error (NGX_LOG_ERR , r -> connection -> log , 0 ,
1405- "attemp to send data on a closed socket: u:%p, c:%p, "
1405+ "attempt to send data on a closed socket: u:%p, c:%p, "
14061406 "ft:%ui eof:%ud" ,
14071407 u , u ? u -> peer .connection : NULL , u ? u -> ft_type : 0 ,
14081408 u ? u -> eof : 0 );
@@ -1709,6 +1709,9 @@ ngx_http_lua_socket_read_handler(ngx_http_request_t *r,
17091709 "lua socket read handler" );
17101710
17111711 if (c -> read -> timedout ) {
1712+ ngx_log_error (NGX_LOG_ERR , r -> connection -> log , 0 ,
1713+ "lua socket read timed out" );
1714+
17121715 ngx_http_lua_socket_handle_error (r , u , NGX_HTTP_LUA_SOCKET_FT_TIMEOUT );
17131716 return ;
17141717 }
@@ -1731,6 +1734,9 @@ ngx_http_lua_socket_send_handler(ngx_http_request_t *r,
17311734 "lua socket send handler" );
17321735
17331736 if (c -> write -> timedout ) {
1737+ ngx_log_error (NGX_LOG_ERR , r -> connection -> log , 0 ,
1738+ "lua socket write timed out" );
1739+
17341740 ngx_http_lua_socket_handle_error (r , u , NGX_HTTP_LUA_SOCKET_FT_TIMEOUT );
17351741 return ;
17361742 }
@@ -1895,6 +1901,19 @@ ngx_http_lua_socket_connected_handler(ngx_http_request_t *r,
18951901 c = u -> peer .connection ;
18961902
18971903 if (c -> write -> timedout ) {
1904+
1905+ ngx_log_error (NGX_LOG_ERR , r -> connection -> log , 0 ,
1906+ "lua socket connect timed out" );
1907+
1908+ ngx_http_lua_socket_handle_error (r , u , NGX_HTTP_LUA_SOCKET_FT_TIMEOUT );
1909+ return ;
1910+ }
1911+
1912+ if (c -> read -> timedout ) {
1913+
1914+ ngx_log_error (NGX_LOG_ERR , r -> connection -> log , 0 ,
1915+ "lua socket connect timed out" );
1916+
18981917 ngx_http_lua_socket_handle_error (r , u , NGX_HTTP_LUA_SOCKET_FT_TIMEOUT );
18991918 return ;
19001919 }
0 commit comments