- case encoding_plain_e: break;
- case encoding_gzip_e: VERBOSE (WARNING, PRINT ("Gzip encoding not supported yet\n")); break;
- case encoding_compress_e: VERBOSE (WARNING, PRINT ("Compress encoding not supported yet\n")); break;
+ case encoding_plain_e:
+ break;
+
+ case encoding_gzip_e:
+ fcomp = tempname (conf->temp, ".gz");
+ writefile (fcomp, body, len);
+ command = createcommand ("gunzip %s", fcomp);
+ system (command);
+ fdecomp = strdup (fcomp);
+ for (i = strlen (fdecomp) - 1; i > 0; i--) {
+ if (fdecomp[i] == '.') {
+ fdecomp[i] = 0;
+ break;
+ }
+ }
+ len = readfile (&newbody, fdecomp);
+ break;
+
+ case encoding_compress_e:
+ fcomp = tempname (conf->temp, ".Z");
+ writefile (fcomp, body, len);
+ command = createcommand ("compress %s", fcomp);
+ system (command);
+ fdecomp = strdup (fcomp);
+ for (i = strlen (fdecomp) - 1; i > 0; i--) {
+ if (fdecomp[i] == '.') {
+ fdecomp[i] = 0;
+ break;
+ }
+ }
+ len = readfile (&newbody, fdecomp);
+ break;
+ }
+
+ if (fcomp) {
+ unlink (fcomp);
+ free (fcomp);
+ }
+ if (fdecomp) {
+ unlink (fdecomp);
+ free (fdecomp);
+ }
+ if (command) {
+ free (command);