This commit is contained in:
qowevisa 2024-06-08 22:14:38 +03:00
parent 1c9d112d6c
commit b893e0af71
2 changed files with 3 additions and 3 deletions

View File

@ -132,7 +132,7 @@ func readFromWebSocket(conn net.Conn, ws *websocket.Conn) {
log.Printf("I generated link: %v\n", l)
log.Printf("Link data as string is: %s\n", string(l.Data))
tmpLink = &l
answ, err := com.ClientSendServerLink(l)
answ, err := com.ClientSendServerLink(r.ID, l)
if err != nil {
log.Printf("Error: com: %v", err)
continue

View File

@ -167,7 +167,7 @@ func DecodeLink(data []byte) (*Link, error) {
return &l, nil
}
func ClientSendServerLink(l Link) ([]byte, error) {
func ClientSendServerLink(from uint16, l Link) ([]byte, error) {
bb, err := l.Bytes()
if err != nil {
return nil, err
@ -175,7 +175,7 @@ func ClientSendServerLink(l Link) ([]byte, error) {
c := Message{
Version: V1,
ID: ID_CLIENT_SEND_SERVER_LINK,
FromID: 0,
FromID: from,
ToID: 0,
DataLen: uint16(len(bb)),
Data: bb,