[
https://issues.apache.org/jira/browse/DISPATCH-1898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17263547#comment-17263547
]
ASF GitHub Bot commented on DISPATCH-1898:
------------------------------------------
kgiusti commented on a change in pull request #972:
URL: https://github.com/apache/qpid-dispatch/pull/972#discussion_r555953085
##########
File path: src/adaptors/http1/http1_client.c
##########
@@ -815,6 +852,9 @@ static int _client_rx_body_cb(h1_codec_request_state_t
*hrs, qd_buffer_list_t *b
{
_client_request_t *hreq = (_client_request_t*)
h1_codec_request_state_get_context(hrs);
qdr_http1_connection_t *hconn = hreq->base.hconn;
+ if (hconn->cfg.event_channel &&
strcasecmp(h1_codec_request_state_method(hrs), POST_METHOD) != 0) {
+ return 0;
Review comment:
Need to free the body buffer list with qd_buffer_list_free_buffers as
ownership is assumed.
##########
File path: src/adaptors/http1/http1_server.c
##########
@@ -954,14 +966,19 @@ static int _server_rx_body_cb(h1_codec_request_state_t
*hrs, qd_buffer_list_t *b
{
_server_request_t *hreq = (_server_request_t*)
h1_codec_request_state_get_context(hrs);
qdr_http1_connection_t *hconn = hreq->base.hconn;
- _server_response_msg_t *rmsg = DEQ_TAIL(hreq->responses);
-
- qd_message_t *msg = rmsg->msg ? rmsg->msg :
qdr_delivery_message(rmsg->dlv);
qd_log(qdr_http1_adaptor->log, QD_LOG_TRACE,
"[C%"PRIu64"][L%"PRIu64"] HTTP response body received len=%zu.",
hconn->conn_id, hconn->in_link_id, len);
+ if (hconn->cfg.event_channel) {
+ return 0;
Review comment:
I think you also need to free the body list here via
qd_buffer_list_free_buffers(), since the caller passes ownership.
##########
File path: src/adaptors/http1/http1_client.c
##########
@@ -660,6 +679,17 @@ static int _client_rx_request_cb(h1_codec_request_state_t
*hrs,
qd_log(qdr_http1_adaptor->log, QD_LOG_TRACE,
"[C%"PRIu64"] HTTP request received: msg-id=%"PRIu64" method=%s
target=%s version=%"PRIi32".%"PRIi32,
hconn->conn_id, creq->base.msg_id, method, target, version_major,
version_minor);
+ if (hconn->cfg.event_channel) {
+ if (strcasecmp(method, POST_METHOD) == 0) {
+ creq->error_code = 204;
+ creq->error_text = "Event posted.";
+ qd_log(qdr_http1_adaptor->log, QD_LOG_DEBUG, "[C%"PRIu64"] Event
posted", hconn->conn_id);
+ } else {
+ creq->error_code = 405;
+ creq->error_text = "Invalid method for event channel, only POST is
allowed.";
+ qd_log(qdr_http1_adaptor->log, QD_LOG_INFO, "[C%"PRIu64"] HTTP %s
request not allowed for event channel", hconn->conn_id, method);
Review comment:
would a warning log level be more appropriate?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> support event channel option in http1 adaptor
> ----------------------------------------------
>
> Key: DISPATCH-1898
> URL: https://issues.apache.org/jira/browse/DISPATCH-1898
> Project: Qpid Dispatch
> Issue Type: New Feature
> Components: Protocol Adaptors
> Reporter: Gordon Sim
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]