src/etpan_mime.c
branchENGINE-298
changeset 2200 644d22d740f0
parent 2011 86bbefb0e806
child 2562 a381a9bd101c
     1.1 --- a/src/etpan_mime.c	Tue Oct 24 15:21:48 2017 +0200
     1.2 +++ b/src/etpan_mime.c	Wed Oct 25 10:29:16 2017 +0200
     1.3 @@ -284,7 +284,8 @@
     1.4          pEp_rid_list_t* resource,
     1.5          const char * mime_type,
     1.6          char * data,
     1.7 -        size_t length
     1.8 +        size_t length,
     1.9 +        bool transport_encode
    1.10      )
    1.11  {
    1.12      char * disposition_name = NULL;
    1.13 @@ -330,10 +331,14 @@
    1.14      if (content == NULL)
    1.15          goto enomem;
    1.16  
    1.17 -    encoding_type = MAILMIME_MECHANISM_BASE64;
    1.18 -    encoding = mailmime_mechanism_new(encoding_type, NULL);
    1.19 -    if (encoding == NULL)
    1.20 -        goto enomem;
    1.21 +    encoding = NULL;
    1.22 +
    1.23 +    if (transport_encode) {
    1.24 +        encoding_type = MAILMIME_MECHANISM_BASE64;
    1.25 +        encoding = mailmime_mechanism_new(encoding_type, NULL);
    1.26 +        if (encoding == NULL)
    1.27 +            goto enomem;
    1.28 +    }
    1.29  
    1.30      mime_fields = mailmime_fields_new_with_data(encoding, content_id, NULL,
    1.31              disposition, NULL);