frame_t *handler_stomp_begin(frame_t *frame) { char *transaction_id = NULL; assert(frame != NULL); if(iterate_header(&frame->h_attrs, handlers, &transaction_id) == RET_ERROR) { err("(handle_stomp_ack) validation error"); stomp_send_error(frame->sock, "failed to validate header\n"); return NULL; } if(transaction_id != NULL) { transaction_start(transaction_id); } else { stomp_send_error(frame->sock, "BEGIN frame MUST be specified transaction header"); } return NULL; }
frame_t *handler_stomp_ack(frame_t *frame) { stomp_msginfo_t *msginfo; assert(frame != NULL); assert(frame->cinfo != NULL); msginfo = alloc_msginfo(); if(msginfo == NULL) { return NULL; } if(iterate_header(&frame->h_attrs, handlers, msginfo) == RET_ERROR) { err("(handle_stomp_ack) validation error"); stomp_send_error(frame->sock, "failed to validate header\n"); return NULL; } /* implementation for ack */ free_msginfo(msginfo); return NULL; }