Skip to content

Commit

Permalink
common: use define instead of magic
Browse files Browse the repository at this point in the history
  • Loading branch information
liudongmiao committed Apr 7, 2024
1 parent 54d3e0e commit 2cfaf62
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ static enum bufferevent_filter_result wss_input_filter(struct evbuffer *src, str
evbuffer_add(dst, udp_frame.buffer, info.payload_size);
} else {
udp_frame.length = ntohs(info.payload_size);
evbuffer_add(dst, &udp_frame, info.payload_size + 2);
evbuffer_add(dst, &udp_frame, info.payload_size + UDP_FRAME_LENGTH_SIZE);
}
return BEV_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion wss-proxy-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static void udp_read_cb_client(evutil_socket_t sock, short event, void *ctx) {
if ((data = init_udp_client(&key, context, sock, get_port(key.sockaddr))) == NULL) {
break;
}
evbuffer_add(data->be.input, &udp_frame, size + 2);
evbuffer_add(data->be.input, &udp_frame, size + UDP_FRAME_LENGTH_SIZE);
}
}

Expand Down
2 changes: 1 addition & 1 deletion wss-proxy-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static void udp_read_cb_server(evutil_socket_t sock, short event, void *ctx) {
if ((size = udp_read(sock, &udp_frame, (struct sockaddr *) &sockaddr, &socklen)) < 0) {
break;
}
evbuffer_add(raw->input, &udp_frame, size + 2);
evbuffer_add(raw->input, &udp_frame, size + UDP_FRAME_LENGTH_SIZE);
}
}
}
Expand Down

0 comments on commit 2cfaf62

Please sign in to comment.