src/transport.c
changeset 41 b30cc1842d9c
parent 40 3e7aa2f67b7e
child 46 7471e31bb278
     1.1 --- a/src/transport.c	Tue Dec 30 18:39:59 2014 +0100
     1.2 +++ b/src/transport.c	Tue Dec 30 23:33:42 2014 +0100
     1.3 @@ -93,8 +93,6 @@
     1.4      bloblist_t * bloblist = calloc(1, sizeof(bloblist_t));
     1.5      if (bloblist == NULL)
     1.6          return NULL;
     1.7 -    bloblist->data_ref = blob;
     1.8 -    bloblist->size = size;
     1.9      if (mime_type) {
    1.10          bloblist->mime_type = strdup(mime_type);
    1.11          if (bloblist->mime_type == NULL) {
    1.12 @@ -110,34 +108,19 @@
    1.13              return NULL;
    1.14          }
    1.15      }
    1.16 +    bloblist->data = blob;
    1.17 +    bloblist->size = size;
    1.18      return bloblist;
    1.19  }
    1.20  
    1.21 -bloblist_t *bloblist_dup(const bloblist_t *src)
    1.22 -{
    1.23 -    assert(src);
    1.24 -
    1.25 -    if (src) {
    1.26 -        bloblist_t * dst = new_bloblist(src->data_ref, src->size,
    1.27 -                src->mime_type, src->file_name);
    1.28 -        if (dst == NULL)
    1.29 -            return NULL;
    1.30 -        dst->next = bloblist_dup(src->next);
    1.31 -        return dst;
    1.32 -    }
    1.33 -    else
    1.34 -        return NULL;
    1.35 -}
    1.36 -
    1.37  void free_bloblist(bloblist_t *bloblist)
    1.38  {
    1.39      if (bloblist) {
    1.40          if (bloblist->next)
    1.41              free_bloblist(bloblist->next);
    1.42 -        if (bloblist->mime_type)
    1.43 -            free(bloblist->mime_type);
    1.44 -        if (bloblist->file_name)
    1.45 -            free(bloblist->file_name);
    1.46 +        free(bloblist->data);
    1.47 +        free(bloblist->mime_type);
    1.48 +        free(bloblist->file_name);
    1.49          free(bloblist);
    1.50      }
    1.51  }
    1.52 @@ -150,9 +133,7 @@
    1.53      if (bloblist == NULL)
    1.54          return new_bloblist(blob, size, mime_type, file_name);
    1.55  
    1.56 -    if (bloblist->data_ref == NULL) {
    1.57 -        bloblist->data_ref = blob;
    1.58 -        bloblist->size = size;
    1.59 +    if (bloblist->data == NULL) {
    1.60          if (mime_type) {
    1.61              bloblist->mime_type = strdup(mime_type);
    1.62              if (bloblist->mime_type == NULL) {
    1.63 @@ -168,6 +149,8 @@
    1.64                  return NULL;
    1.65              }
    1.66          }
    1.67 +        bloblist->data = blob;
    1.68 +        bloblist->size = size;
    1.69          return bloblist;
    1.70      }
    1.71