Skip to content

Commit

Permalink
As MSG_xxx constant strings are used in syslog() format strings, perc…
Browse files Browse the repository at this point in the history
…ent-encode the leading percent symbol (#51)
  • Loading branch information
nevali committed Sep 21, 2015
1 parent 258c350 commit 6dd405d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
32 changes: 16 additions & 16 deletions crawler/libcrawld.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,24 @@ struct processor_api_struct
/* Log messages */

/* crawld and utilities */
# define MSG_E_CRAWL_LINETOOLONG "%ANANSI-E-2000: line too long, skipping"
# define MSG_E_CRAWL_URIPARSE "%ANANSI-E-2001: failed to parse URI"
# define MSG_C_CRAWL_URIPARSE "%ANANSI-C-2001: failed to parse URI"
# define MSG_E_CRAWL_ADDFAILED "%ANANSI-E-2002: failed to add URI to crawl queue"
# define MSG_C_CRAWL_ADDFAILED "%ANANSI-E-2002: failed to add URI to crawl queue"
# define MSG_N_CRAWL_UPDATED "%ANANSI-N-2003: crawler queue updated"
# define MSG_E_CRAWL_LINETOOLONG "%%ANANSI-E-2000: line too long, skipping"
# define MSG_E_CRAWL_URIPARSE "%%ANANSI-E-2001: failed to parse URI"
# define MSG_C_CRAWL_URIPARSE "%%ANANSI-C-2001: failed to parse URI"
# define MSG_E_CRAWL_ADDFAILED "%%ANANSI-E-2002: failed to add URI to crawl queue"
# define MSG_C_CRAWL_ADDFAILED "%%ANANSI-E-2002: failed to add URI to crawl queue"
# define MSG_N_CRAWL_UPDATED "%%ANANSI-N-2003: crawler queue updated"

/* RDBMS queue */
# define MSG_C_DB_CONNECT "%ANANSI-C-5000: failed to connect to database"
# define MSG_C_DB_MIGRATE "%ANANSI-C-5001: database migration failed"
# define MSG_N_DB_MIGRATEONLY "%ANANSI-N-5002: performing schema migration only"
# define MSG_N_DB_TESTURI "%ANANSI-N-5003: using test URI"
# define MSG_C_DB_URIPARSE "%ANANSI-C-5004: failed to parse URI"
# define MSG_E_DB_URIPARSE "%ANANSI-E-5004: failed to parse URI"
# define MSG_E_DB_SQL "%ANSNSI-E-5005: SQL error"
# define MSG_C_DB_SQL "%ANSNSI-C-5005: SQL error"
# define MSG_N_DB_MIGRATING "%ANANSI-N-5006: migrating database schema"
# define MSG_C_DB_INVALIDROOT "%ANANSI-C-5007: invalid root key"
# define MSG_C_DB_CONNECT "%%ANANSI-C-5000: failed to connect to database"
# define MSG_C_DB_MIGRATE "%%ANANSI-C-5001: database migration failed"
# define MSG_N_DB_MIGRATEONLY "%%ANANSI-N-5002: performing schema migration only"
# define MSG_N_DB_TESTURI "%%ANANSI-N-5003: using test URI"
# define MSG_C_DB_URIPARSE "%%ANANSI-C-5004: failed to parse URI"
# define MSG_E_DB_URIPARSE "%%ANANSI-E-5004: failed to parse URI"
# define MSG_E_DB_SQL "%%ANSNSI-E-5005: SQL error"
# define MSG_C_DB_SQL "%%ANSNSI-C-5005: SQL error"
# define MSG_N_DB_MIGRATING "%%ANANSI-N-5006: migrating database schema"
# define MSG_C_DB_INVALIDROOT "%%ANANSI-C-5007: invalid root key"

CONTEXT *context_create(int crawler_offset);

Expand Down
26 changes: 13 additions & 13 deletions libcrawl/p_libcrawl.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@
# define CACHE_TMP_SUFFIX ".tmp"

/* Log messages - libcrawl */
# define MSG_C_NOMEM "%ANANSI-C-1000: Memory allocation failure"
# define MSG_N_NONEXT "%ANANSI-N-1001: crawl_perform(): no 'next resource' handler has been registered"
# define MSG_C_NOMEM "%%ANANSI-C-1000: Memory allocation failure"
# define MSG_N_NONEXT "%%ANANSI-N-1001: crawl_perform(): no 'next resource' handler has been registered"

/* disk cache */
# define MSG_E_DISK_PAYLOADREAD "%ANANSI-E-4000: disk: failed to open payload for reading"
# define MSG_E_DISK_INFOREAD "%ANANSI-E-4001: disk: failed to open sidecar for reading"
# define MSG_E_DISK_PAYLOADCOMMIT "%ANANSI-E-4002: disk: failed to rename temporary payload file"
# define MSG_E_DISK_INFOCOMMIT "%ANANSI-E-4003: disk: failed to rename temporary sidecar file"
# define MSG_E_DISK_PAYLOADRM "%ANANSI-E-4004: disk: failed to roll back payload"
# define MSG_E_DISK_INFORM "%ANANSI-E-4005: disk: failed to roll back sidecar"
# define MSG_E_DISK_PAYLOADWRITE "%ANANSI-E-4006: disk: failed to open temporary payload file for writing"
# define MSG_E_DISK_MKDIR "%ANANSI-E-4007: disk: failed to create cache directory"
# define MSG_E_DISK_DIRSTAT "%ANANSI-E-4008: disk: failed to stat cache directory"
# define MSG_E_DISK_PAYLOADREAD "%%ANANSI-E-4000: disk: failed to open payload for reading"
# define MSG_E_DISK_INFOREAD "%%ANANSI-E-4001: disk: failed to open sidecar for reading"
# define MSG_E_DISK_PAYLOADCOMMIT "%%ANANSI-E-4002: disk: failed to rename temporary payload file"
# define MSG_E_DISK_INFOCOMMIT "%%ANANSI-E-4003: disk: failed to rename temporary sidecar file"
# define MSG_E_DISK_PAYLOADRM "%%ANANSI-E-4004: disk: failed to roll back payload"
# define MSG_E_DISK_INFORM "%%ANANSI-E-4005: disk: failed to roll back sidecar"
# define MSG_E_DISK_PAYLOADWRITE "%%ANANSI-E-4006: disk: failed to open temporary payload file for writing"
# define MSG_E_DISK_MKDIR "%%ANANSI-E-4007: disk: failed to create cache directory"
# define MSG_E_DISK_DIRSTAT "%%ANANSI-E-4008: disk: failed to stat cache directory"

/* S3 cache */
# define MSG_E_S3_TMPFILE "%ANANSI-E-4100: S3: failed to create temporary file"
# define MSG_E_S3_HTTP "%ANANSI-E-4101: S3: failed to retrieve object from cache"
# define MSG_E_S3_TMPFILE "%%ANANSI-E-4100: S3: failed to create temporary file"
# define MSG_E_S3_HTTP "%%ANANSI-E-4101: S3: failed to retrieve object from cache"

struct crawl_struct
{
Expand Down

0 comments on commit 6dd405d

Please sign in to comment.