diff --git a/core/protocol.c b/core/protocol.c index d69cd7dc..c3ab7012 100644 --- a/core/protocol.c +++ b/core/protocol.c @@ -28,13 +28,6 @@ ssize_t send_udp_message(uint8_t modifier1, uint8_t modifier2, char *host, char struct uwsgi_header *uh; - if (message) { - uh = (struct uwsgi_header *) message; - } - else { - uh = (struct uwsgi_header *) uwsgi_malloc(4); - } - udp_port = strchr(host, ':'); if (udp_port) { udp_port[0] = 0; @@ -64,6 +57,13 @@ ssize_t send_udp_message(uint8_t modifier1, uint8_t modifier2, char *host, char } + if (message) { + uh = (struct uwsgi_header *) message; + } + else { + uh = (struct uwsgi_header *) uwsgi_malloc(4); + } + uh->modifier1 = modifier1; #ifdef __BIG_ENDIAN__ uh->pktsize = uwsgi_swap16(message_size);