]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afh_recv.c
paraslash 0.7.3
[paraslash.git] / afh_recv.c
index 889fdce821f4b9aec85c1b01976e4fae6e05e176..8449e787f96fa24b60c2c3af9ec5218eb264ff53 100644 (file)
@@ -75,7 +75,7 @@ static int afh_recv_open(struct receiver_node *rn)
 
        if (!fn || *fn == '\0')
                return -E_AFH_RECV_BAD_FILENAME;
-       rn->private_data = pard = para_calloc(sizeof(*pard));
+       rn->private_data = pard = zalloc(sizeof(*pard));
        afhi = &pard->afhi;
        ret = mmap_full_file(fn, O_RDONLY, &pard->map,
                &pard->map_size, &pard->fd);
@@ -188,7 +188,7 @@ static int afh_recv_post_monitor(__a_unused struct sched *s, void *context)
                        pard->map_size, &header, &size);
                if (size > 0) {
                        PARA_INFO_LOG("writing header (%zu bytes)\n", size);
-                       buf = para_malloc(size);
+                       buf = alloc(size);
                        memcpy(buf, header, size);
                        btr_add_output(buf, size, btrn);
                        afh_free_header(header, pard->audio_format_num);
@@ -205,7 +205,7 @@ static int afh_recv_post_monitor(__a_unused struct sched *s, void *context)
                        PARA_DEBUG_LOG("adding %u bytes\n", len);
                        btr_add_output_dont_free(start, len, btrn);
                }
-               ret = -E_RECV_EOF;
+               ret = -E_EOF;
                goto out;
        }
        if (pard->current_chunk == pard->first_chunk)
@@ -226,7 +226,7 @@ static int afh_recv_post_monitor(__a_unused struct sched *s, void *context)
        PARA_DEBUG_LOG("adding chunk %u\n", pard->current_chunk);
        btr_add_output_dont_free(start, len, btrn);
        if (pard->current_chunk >= pard->last_chunk) {
-               ret = -E_RECV_EOF;
+               ret = -E_EOF;
                goto out;
        }
        pard->current_chunk++;