@@ -97,13 +97,17 @@ void ngx_http_redirectionio_protocol_send_match(ngx_connection_t *c, ngx_http_re
97
97
rv = ngx_http_redirectionio_send_protocol_header (c , project_key , REDIRECTIONIO_PROTOCOL_COMMAND_MATCH_ACTION );
98
98
99
99
if (rv != NGX_OK ) {
100
+ ctx -> connection_error = 1 ;
101
+
100
102
return ;
101
103
}
102
104
103
105
// Send serialized request length
104
106
rv = ngx_http_redirectionio_send_uint32 (c , strlen (request_serialized ));
105
107
106
108
if (rv != NGX_OK ) {
109
+ ctx -> connection_error = 1 ;
110
+
107
111
return ;
108
112
}
109
113
@@ -113,33 +117,31 @@ void ngx_http_redirectionio_protocol_send_match(ngx_connection_t *c, ngx_http_re
113
117
free ((void * )request_serialized );
114
118
115
119
if (rv != NGX_OK ) {
120
+ ctx -> connection_error = 1 ;
121
+
116
122
return ;
117
123
}
118
124
}
119
125
120
- void ngx_http_redirectionio_protocol_send_log (ngx_connection_t * c , ngx_http_redirectionio_log_t * log ) {
126
+ ngx_int_t ngx_http_redirectionio_protocol_send_log (ngx_connection_t * c , ngx_http_redirectionio_log_t * log ) {
121
127
ssize_t wlen = strlen (log -> log_serialized );
122
128
ngx_int_t rv ;
123
129
124
130
// Send protocol header
125
131
rv = ngx_http_redirectionio_send_protocol_header (c , & log -> project_key , REDIRECTIONIO_PROTOCOL_COMMAND_LOG );
126
132
127
133
if (rv != NGX_OK ) {
128
- return ;
134
+ return rv ;
129
135
}
130
136
131
137
// Send log length
132
138
rv = ngx_http_redirectionio_send_uint32 (c , wlen );
133
139
134
140
if (rv != NGX_OK ) {
135
- return ;
141
+ return rv ;
136
142
}
137
143
138
- rv = ngx_http_redirectionio_send_string (c , log -> log_serialized , wlen );
139
-
140
- if (rv != NGX_OK ) {
141
- return ;
142
- }
144
+ return ngx_http_redirectionio_send_string (c , log -> log_serialized , wlen );
143
145
}
144
146
145
147
ngx_http_redirectionio_log_t * ngx_http_redirectionio_protocol_create_log (ngx_http_request_t * r , ngx_http_redirectionio_ctx_t * ctx , ngx_str_t * project_key ) {
0 commit comments