-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started with the support of compression
- Loading branch information
1 parent
30d5d10
commit 8164ac4
Showing
5 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "compressionHandler.h" | ||
|
||
char *compressString(char *content, compression_t type, char *compressed) | ||
{ | ||
return content; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include <strings.h> | ||
|
||
typedef enum | ||
{ | ||
GZIP, | ||
COMPRESS, | ||
DEFLATE, | ||
IDENTITY, | ||
BR, | ||
UNDEFINED | ||
} compression_t; | ||
|
||
char *compressString(char *content, compression_t type, char *compressed); | ||
|
||
compression_t getEnumFromChar(char *type) | ||
{ | ||
if (strcasecmp("gzip", type) == 0) | ||
{ | ||
return GZIP; | ||
} | ||
else if (strcasecmp("compress", type) == 0) | ||
{ | ||
return COMPRESS; | ||
} | ||
else if (strcasecmp("deflate", type) == 0) | ||
{ | ||
return DEFLATE; | ||
} | ||
else if (strcasecmp("br", type) == 0) | ||
{ | ||
return BR; | ||
} | ||
else if (strcasecmp("identity", type) == 0) | ||
{ | ||
return IDENTITY; | ||
} | ||
else if (strcasecmp("*", type) == 0) | ||
{ | ||
//DEFAULT we just use GZIP | ||
return GZIP; | ||
} | ||
return UNDEFINED; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters