diff options
| author | jvoisin | 2018-01-11 11:26:07 +0100 |
|---|---|---|
| committer | jvoisin | 2018-01-11 11:26:07 +0100 |
| commit | 49a27fac20f757c158e5faa18a41337c5f33b17b (patch) | |
| tree | 2f289ae78a7419a39c7e591649dcc229b892f7d3 /src | |
| parent | 6f21bff1d40326f69bc3b75b1b83b03623180365 (diff) | |
Remove some legacy code
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp_utils.c | 4 | ||||
| -rw-r--r-- | src/sp_utils.h | 11 |
2 files changed, 2 insertions, 13 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c index 19b7179..52e494f 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c | |||
| @@ -93,7 +93,7 @@ static int construct_filename(char* filename, const char* folder, | |||
| 93 | PHP_SHA256Update(&context, (const unsigned char*)textual, strlen(textual)); | 93 | PHP_SHA256Update(&context, (const unsigned char*)textual, strlen(textual)); |
| 94 | PHP_SHA256Final(digest, &context); | 94 | PHP_SHA256Final(digest, &context); |
| 95 | make_digest_ex(strhash, digest, SHA256_SIZE); | 95 | make_digest_ex(strhash, digest, SHA256_SIZE); |
| 96 | snprintf(filename, MAX_FOLDER_LEN - 1, "%s/sp_dump.%s", folder, strhash); | 96 | snprintf(filename, PATH_MAX - 1, "%s/sp_dump.%s", folder, strhash); |
| 97 | 97 | ||
| 98 | return 0; | 98 | return 0; |
| 99 | } | 99 | } |
| @@ -102,7 +102,7 @@ int sp_log_request(const char* folder, const char* text_repr) { | |||
| 102 | FILE* file; | 102 | FILE* file; |
| 103 | const char* current_filename = zend_get_executed_filename(TSRMLS_C); | 103 | const char* current_filename = zend_get_executed_filename(TSRMLS_C); |
| 104 | const int current_line = zend_get_executed_lineno(TSRMLS_C); | 104 | const int current_line = zend_get_executed_lineno(TSRMLS_C); |
| 105 | char filename[MAX_FOLDER_LEN] = {0}; | 105 | char filename[PATH_MAX] = {0}; |
| 106 | const struct { | 106 | const struct { |
| 107 | const char* str; | 107 | const char* str; |
| 108 | const int key; | 108 | const int key; |
diff --git a/src/sp_utils.h b/src/sp_utils.h index a7b672f..ada7cf6 100644 --- a/src/sp_utils.h +++ b/src/sp_utils.h | |||
| @@ -17,17 +17,6 @@ | |||
| 17 | #define sp_const | 17 | #define sp_const |
| 18 | #endif | 18 | #endif |
| 19 | #endif | 19 | #endif |
| 20 | /* The dump filename are of the form | ||
| 21 | * `sp_dump_DATE_IPADDR.dump`, with: | ||
| 22 | * - DATE being the output of asctime, 26 chars long | ||
| 23 | * - IP_ADDR being an IP adress, with a maximum size of 15 | ||
| 24 | * | ||
| 25 | * We keep one char for the terminal \0, and one for the leading slash. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #define MAX_FOLDER_LEN \ | ||
| 29 | PATH_MAX - 1 - sizeof("sp_dump_") - 26 - sizeof("_") - 15 - \ | ||
| 30 | sizeof(".dump") - 1 | ||
| 31 | 20 | ||
| 32 | #define VAR_AND_LEN(var) var, strlen(var) | 21 | #define VAR_AND_LEN(var) var, strlen(var) |
| 33 | 22 | ||
