aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/url.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-06 11:27:24 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-09 10:46:11 +0000
commitf1d8615a328e2e7361445bcc91d96d2d42cddbb8 (patch)
tree809fe90c779d9e9818dbc0e9ad28dfe5273fcbf7 /src/libserver/url.h
parent369d9c23902ce6c8350884b8e5fbb5138d0340af (diff)
downloadrspamd-f1d8615a328e2e7361445bcc91d96d2d42cddbb8.tar.gz
rspamd-f1d8615a328e2e7361445bcc91d96d2d42cddbb8.zip
[Rework] Rework URL structure: user field
Diffstat (limited to 'src/libserver/url.h')
-rw-r--r--src/libserver/url.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libserver/url.h b/src/libserver/url.h
index 53c4abbeb..78330d814 100644
--- a/src/libserver/url.h
+++ b/src/libserver/url.h
@@ -47,7 +47,9 @@ struct rspamd_url {
guint protocol;
guint port;
- gchar *user;
+ guint usershift;
+ guint userlen;
+
gchar *host;
gchar *data;
gchar *query;
@@ -58,7 +60,6 @@ struct rspamd_url {
struct rspamd_url *phished_url;
guint protocollen;
- guint userlen;
guint hostlen;
guint datalen;
guint querylen;
@@ -71,6 +72,9 @@ struct rspamd_url {
guint count;
};
+#define rspamd_url_user(u) ((u)->userlen > 0 ? (u)->string + (u)->usershift : NULL)
+#define rspamd_url_user_unsafe(u) ((u)->string + (u)->usershift)
+
enum uri_errno {
URI_ERRNO_OK = 0, /* Parsing went well */
URI_ERRNO_EMPTY, /* The URI string was empty */