Package: liblo0-dev
Version: 0.23-2.2
Severity: normal

When using the client and server code below, the parsing of a blob 
argument is not correct. With liblo 0.26 it works as expected.

Client code:

int32_t testdata[] = {50000, 50001, 50002, 50003};

int main(int argc, char *argv[])
{
  lo_blob btest = lo_blob_new(sizeof(int32_t)*4, testdata);
  int i;
  int32_t* data = lo_blob_dataptr(btest);
  for (i=0; i<lo_blob_datasize(btest)/sizeof(int32_t); i++) {
    printf("data[%d] = %i\n", i, data[i]);
  }
  lo_address t = lo_address_new(NULL, "7770");
  lo_send(t, "/rwst", "b", btest);
  lo_blob_free(btest);
  return 0;
}
seems to build the blob correctly, according to the output:

Server Code:
int generic_handler(const char *path, const char *types, lo_arg **argv,
                    int argc, void *data, void *user_data)
{
  int i;
  for (i=0; i<argc; i++) {
    if (types[i] == 'b') {
      lo_blob b = argv[i];
      int j;
      int32_t *d = lo_blob_dataptr(b);
      for (j=0; j<lo_blob_datasize(b)/sizeof(int32_t); j++) {
        printf("d[%d]=%d\n", j, d[j]);
      }
    }
  }
  
  return 1;
}
int main()
{
    lo_server_thread st = lo_server_thread_new("7770", NULL);
    lo_server_thread_add_method(st, "/rwst", "b", generic_handler, NULL);
    lo_server_thread_start(st);
    while (1) usleep(1000);
    return 0;
}

outputs:
d[0]=50001
d[1]=50002
d[2]=50003
d[3]=0

while the correct output should be:

d[0]=50000
d[1]=50001
d[2]=50002
d[3]=50003

lo_blob_datasize seems to be ok, i tried with different sizes, I also 
tried with int32_t, chars and floats. The first value is always missing 
the last is always 0.
As said before, with 0.26 it works.

cheers,

thomas

-- System Information:
Debian Release: 5.0.2
  APT prefers proposed-updates
  APT policy: (500, 'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages liblo0-dev depends on:
ii  liblo0ldbl                    0.23-2.2   Lightweight OSC library

liblo0-dev recommends no packages.

liblo0-dev suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to