diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-20 14:23:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-20 14:23:53 +0000 |
commit | 36eca5bf2cdc547f3a86dd2916c1559281952d17 (patch) | |
tree | d91b22378062fd112b9e4be1c1c2777c4e00a443 /src/regex | |
parent | 8b4c42b20a6049b036713f92863b20bf6b5cc5dd (diff) | |
download | gnunet-36eca5bf2cdc547f3a86dd2916c1559281952d17.tar.gz gnunet-36eca5bf2cdc547f3a86dd2916c1559281952d17.zip |
-give nicer warning about big regex
Diffstat (limited to 'src/regex')
-rw-r--r-- | src/regex/regex_api.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/regex/regex_api.c b/src/regex/regex_api.c index e18674d65..0da97d072 100644 --- a/src/regex/regex_api.c +++ b/src/regex/regex_api.c | |||
@@ -105,7 +105,7 @@ handle_a_reconnect (void *cls, | |||
105 | 105 | ||
106 | /** | 106 | /** |
107 | * Announce the given peer under the given regular expression. Does | 107 | * Announce the given peer under the given regular expression. Does |
108 | * not free resources, must call GNUNET_REGEX_announce_cancel for | 108 | * not free resources, must call #GNUNET_REGEX_announce_cancel for |
109 | * that. | 109 | * that. |
110 | * | 110 | * |
111 | * @param cfg configuration to use | 111 | * @param cfg configuration to use |
@@ -113,7 +113,7 @@ handle_a_reconnect (void *cls, | |||
113 | * @param refresh_delay after what delay should the announcement be repeated? | 113 | * @param refresh_delay after what delay should the announcement be repeated? |
114 | * @param compression How many characters per edge can we squeeze? | 114 | * @param compression How many characters per edge can we squeeze? |
115 | * @return Handle to reuse o free cached resources. | 115 | * @return Handle to reuse o free cached resources. |
116 | * Must be freed by calling GNUNET_REGEX_announce_cancel. | 116 | * Must be freed by calling #GNUNET_REGEX_announce_cancel. |
117 | */ | 117 | */ |
118 | struct GNUNET_REGEX_Announcement * | 118 | struct GNUNET_REGEX_Announcement * |
119 | GNUNET_REGEX_announce (const struct GNUNET_CONFIGURATION_Handle *cfg, | 119 | GNUNET_REGEX_announce (const struct GNUNET_CONFIGURATION_Handle *cfg, |
@@ -127,6 +127,9 @@ GNUNET_REGEX_announce (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
127 | slen = strlen (regex) + 1; | 127 | slen = strlen (regex) + 1; |
128 | if (slen + sizeof (struct AnnounceMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) | 128 | if (slen + sizeof (struct AnnounceMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) |
129 | { | 129 | { |
130 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
131 | _("Regex `%s' is too long!\n"), | ||
132 | regex); | ||
130 | GNUNET_break (0); | 133 | GNUNET_break (0); |
131 | return NULL; | 134 | return NULL; |
132 | } | 135 | } |
@@ -269,7 +272,7 @@ handle_search_response (void *cls, | |||
269 | s->callback (s->callback_cls, | 272 | s->callback (s->callback_cls, |
270 | pid, | 273 | pid, |
271 | &pid[1], gpl, | 274 | &pid[1], gpl, |
272 | &pid[1 + gpl], ppl); | 275 | &pid[1 + gpl], ppl); |
273 | return; | 276 | return; |
274 | } | 277 | } |
275 | } | 278 | } |