@@ -937,7 +937,7 @@ tfw_h2_resp_fwd(TfwHttpResp *resp)
937
937
}
938
938
939
939
static void
940
- tfw_h2_send_resp (TfwHttpReq * req , int status , unsigned int stream_id )
940
+ tfw_h2_send_err_resp (TfwHttpReq * req , int status , unsigned int stream_id )
941
941
{
942
942
TfwStr * msg ;
943
943
resp_code_t code ;
@@ -1055,7 +1055,7 @@ tfw_h2_send_resp(TfwHttpReq *req, int status, unsigned int stream_id)
1055
1055
* the fourth chunk must be CRLF.
1056
1056
*/
1057
1057
static void
1058
- tfw_h1_send_resp (TfwHttpReq * req , int status )
1058
+ tfw_h1_send_err_resp (TfwHttpReq * req , int status )
1059
1059
{
1060
1060
TfwMsgIter it ;
1061
1061
resp_code_t code ;
@@ -1131,7 +1131,7 @@ tfw_h1_send_resp(TfwHttpReq *req, int status)
1131
1131
* a value.
1132
1132
*/
1133
1133
static void
1134
- tfw_h2_send_resp2 (TfwHttpReq * req , TfwStr * msg , int status ,
1134
+ tfw_h2_send_resp (TfwHttpReq * req , TfwStr * msg , int status ,
1135
1135
unsigned int stream_id )
1136
1136
{
1137
1137
TfwHttpResp * resp ;
@@ -1215,7 +1215,7 @@ tfw_h2_send_resp2(TfwHttpReq *req, TfwStr *msg, int status,
1215
1215
* a value.
1216
1216
*/
1217
1217
static void
1218
- tfw_h1_send_resp2 (TfwHttpReq * req , TfwStr * msg , int status )
1218
+ tfw_h1_send_resp (TfwHttpReq * req , TfwStr * msg , int status )
1219
1219
{
1220
1220
TfwMsgIter it ;
1221
1221
TfwHttpResp * resp ;
@@ -1489,24 +1489,24 @@ tfw_http_nip_req_resched_err(TfwSrvConn *srv_conn, TfwHttpReq *req,
1489
1489
1490
1490
/* Common interface for sending error responses. */
1491
1491
void
1492
- tfw_http_send_resp (TfwHttpReq * req , int status , const char * reason )
1492
+ tfw_http_send_err_resp (TfwHttpReq * req , int status , const char * reason )
1493
1493
{
1494
1494
if (!(tfw_blk_flags & TFW_BLK_ERR_NOLOG )) {
1495
1495
T_WARN_ADDR_STATUS (reason , & req -> conn -> peer -> addr ,
1496
1496
TFW_NO_PORT , status );
1497
1497
}
1498
1498
1499
1499
if (TFW_MSG_H2 (req ))
1500
- tfw_h2_send_resp (req , status , 0 );
1500
+ tfw_h2_send_err_resp (req , status , 0 );
1501
1501
else
1502
- tfw_h1_send_resp (req , status );
1502
+ tfw_h1_send_err_resp (req , status );
1503
1503
}
1504
1504
1505
1505
static void
1506
- tfw_http_send_resp2 (TfwHttpReq * req , TfwStr * msg , int status )
1506
+ tfw_http_send_resp (TfwHttpReq * req , TfwStr * msg , int status )
1507
1507
{
1508
1508
if (TFW_MSG_H2 (req )) {
1509
- tfw_h2_send_resp2 (req , msg , status , 0 );
1509
+ tfw_h2_send_resp (req , msg , status , 0 );
1510
1510
} else {
1511
1511
TfwCliConn * cli_conn = (TfwCliConn * )req -> conn ;
1512
1512
@@ -1517,7 +1517,7 @@ tfw_http_send_resp2(TfwHttpReq *req, TfwStr *msg, int status)
1517
1517
list_add_tail (& req -> msg .seq_list , & cli_conn -> seq_queue );
1518
1518
spin_unlock (& cli_conn -> seq_qlock );
1519
1519
1520
- tfw_h1_send_resp2 (req , msg , status );
1520
+ tfw_h1_send_resp (req , msg , status );
1521
1521
}
1522
1522
}
1523
1523
@@ -1614,7 +1614,7 @@ do { \
1614
1614
S_CRLF S_CRLF ) + (url_p - url ),
1615
1615
.nchunks = 10
1616
1616
};
1617
- tfw_http_send_resp2 (req , & msg , status );
1617
+ tfw_http_send_resp (req , & msg , status );
1618
1618
}
1619
1619
}
1620
1620
@@ -1717,7 +1717,7 @@ tfw_http_req_zap_error(struct list_head *eq)
1717
1717
|| (!TFW_MSG_H2 (req )
1718
1718
&& !test_bit (TFW_HTTP_B_REQ_DROP , req -> flags )))
1719
1719
{
1720
- tfw_http_send_resp (req , req -> httperr .status ,
1720
+ tfw_http_send_err_resp (req , req -> httperr .status ,
1721
1721
req -> httperr .reason );
1722
1722
}
1723
1723
else
@@ -2237,7 +2237,7 @@ tfw_http_req_resched(TfwHttpReq *req, TfwServer *srv, struct list_head *eq)
2237
2237
}
2238
2238
} else if (!(sch_conn = tfw_http_get_srv_conn ((TfwMsg * )req ))) {
2239
2239
T_DBG ("Unable to find a backend server\n" );
2240
- tfw_http_send_resp (req , 502 , "request dropped: unable to"
2240
+ tfw_http_send_err_resp (req , 502 , "request dropped: unable to"
2241
2241
" find an available back end server" );
2242
2242
TFW_INC_STAT_BH (clnt .msgs_otherr );
2243
2243
return 0 ;
@@ -4893,7 +4893,7 @@ tfw_h1_resp_adjust_fwd(TfwHttpResp *resp)
4893
4893
*/
4894
4894
if (tfw_http_adjust_resp (resp )) {
4895
4895
tfw_http_conn_msg_free ((TfwHttpMsg * )resp );
4896
- tfw_http_send_resp (req , 500 ,
4896
+ tfw_http_send_err_resp (req , 500 ,
4897
4897
"response dropped: processing error" );
4898
4898
TFW_INC_STAT_BH (serv .msgs_otherr );
4899
4899
return ;
@@ -4966,15 +4966,15 @@ tfw_h2_error_resp(TfwHttpReq *req, int status, bool reply, bool attack,
4966
4966
* is already in locally closed state (switched in
4967
4967
* @tfw_h2_stream_id_close() during failed proxy/internal response
4968
4968
* creation) or will be switched into locally closed state in
4969
- * @tfw_h2_send_resp () (or in @tfw_h2_stream_id_close() if no error
4969
+ * @tfw_h2_send_err_resp () (or in @tfw_h2_stream_id_close() if no error
4970
4970
* response is needed) below; remotely (i.e. on client side) stream
4971
4971
* will be closed - due to END_STREAM flag set in the last frame of
4972
4972
* error response; in case of attack we must close entire connection,
4973
4973
* and GOAWAY frame should be sent (RFC 7540 section 6.8) after
4974
4974
* error response.
4975
4975
*/
4976
4976
if (reply ) {
4977
- tfw_h2_send_resp (req , status , 0 );
4977
+ tfw_h2_send_err_resp (req , status , 0 );
4978
4978
if (attack )
4979
4979
tfw_h2_conn_terminate_close (ctx , HTTP2_ECODE_PROTO ,
4980
4980
!on_req_recv_event );
@@ -5039,7 +5039,7 @@ tfw_h1_error_resp(TfwHttpReq *req, int status, bool reply, bool attack,
5039
5039
*/
5040
5040
if (on_req_recv_event || attack )
5041
5041
tfw_http_req_set_conn_close (req );
5042
- tfw_h1_send_resp (req , status );
5042
+ tfw_h1_send_err_resp (req , status );
5043
5043
}
5044
5044
/*
5045
5045
* Serve all pending requests if not under attack, close immediately
@@ -5263,7 +5263,7 @@ tfw_h2_resp_adjust_fwd(TfwHttpResp *resp)
5263
5263
T_WARN_ADDR_STATUS ("response dropped: processing error" ,
5264
5264
& req -> conn -> peer -> addr ,
5265
5265
TFW_NO_PORT , 500 );
5266
- tfw_h2_send_resp (req , 500 , stream_id );
5266
+ tfw_h2_send_err_resp (req , 500 , stream_id );
5267
5267
tfw_hpack_enc_release (& ctx -> hpack , resp -> flags );
5268
5268
TFW_INC_STAT_BH (serv .msgs_otherr );
5269
5269
@@ -5343,11 +5343,11 @@ tfw_http_req_cache_cb(TfwHttpMsg *msg)
5343
5343
goto conn_put ;
5344
5344
5345
5345
send_502 :
5346
- tfw_http_send_resp (req , 502 , "request dropped: processing error" );
5346
+ tfw_http_send_err_resp (req , 502 , "request dropped: processing error" );
5347
5347
TFW_INC_STAT_BH (clnt .msgs_otherr );
5348
5348
return ;
5349
5349
send_500 :
5350
- tfw_http_send_resp (req , 500 , "request dropped: processing error" );
5350
+ tfw_http_send_err_resp (req , 500 , "request dropped: processing error" );
5351
5351
TFW_INC_STAT_BH (clnt .msgs_otherr );
5352
5352
conn_put :
5353
5353
/*
@@ -5942,7 +5942,7 @@ tfw_http_req_process(TfwConn *conn, TfwStream *stream, struct sk_buff *skb)
5942
5942
* The request should either be stored or released.
5943
5943
* Otherwise we lose the reference to it and get a leak.
5944
5944
*/
5945
- tfw_http_send_resp (req , 500 , "request dropped:"
5945
+ tfw_http_send_err_resp (req , 500 , "request dropped:"
5946
5946
" processing error" );
5947
5947
TFW_INC_STAT_BH (clnt .msgs_otherr );
5948
5948
}
@@ -6178,7 +6178,7 @@ tfw_http_resp_cache(TfwHttpMsg *hmresp)
6178
6178
if (tfw_cache_process (hmresp , tfw_http_resp_cache_cb ))
6179
6179
{
6180
6180
tfw_http_conn_msg_free (hmresp );
6181
- tfw_http_send_resp (req , 500 , "response dropped:"
6181
+ tfw_http_send_err_resp (req , 500 , "response dropped:"
6182
6182
" processing error" );
6183
6183
TFW_INC_STAT_BH (serv .msgs_otherr );
6184
6184
/* Proceed with processing of the next response. */
0 commit comments