|
Lines 249-255
static int spice_uri_parse(SpiceSession *session, const char *original_uri)
Link Here
|
| 249 |
gchar key[32], value[128]; |
249 |
gchar key[32], value[128]; |
| 250 |
gchar *host = NULL, *port = NULL, *tls_port = NULL, *uri = NULL, *password = NULL; |
250 |
gchar *host = NULL, *port = NULL, *tls_port = NULL, *uri = NULL, *password = NULL; |
| 251 |
gchar **target_key; |
251 |
gchar **target_key; |
| 252 |
int len; |
|
|
| 253 |
gchar *path = NULL; |
252 |
gchar *path = NULL; |
| 254 |
gchar *authority = NULL; |
253 |
gchar *authority = NULL; |
| 255 |
gchar *query = NULL; |
254 |
gchar *query = NULL; |
|
Lines 277-288
static int spice_uri_parse(SpiceSession *session, const char *original_uri)
Link Here
|
| 277 |
|
276 |
|
| 278 |
if (path) { |
277 |
if (path) { |
| 279 |
size_t prefix = strcspn(path, URI_QUERY_START); |
278 |
size_t prefix = strcspn(path, URI_QUERY_START); |
| 280 |
if (len) |
279 |
query = path + prefix; |
| 281 |
query = path + prefix; |
|
|
| 282 |
} else { |
280 |
} else { |
| 283 |
size_t prefix = strcspn(authority, URI_QUERY_START); |
281 |
size_t prefix = strcspn(authority, URI_QUERY_START); |
| 284 |
if (len) |
282 |
query = authority + prefix; |
| 285 |
query = authority + prefix; |
|
|
| 286 |
} |
283 |
} |
| 287 |
|
284 |
|
| 288 |
if (query && query[0]) { |
285 |
if (query && query[0]) { |
|
Lines 320-325
static int spice_uri_parse(SpiceSession *session, const char *original_uri)
Link Here
|
| 320 |
} |
317 |
} |
| 321 |
|
318 |
|
| 322 |
while (query && query[0] != '\0') { |
319 |
while (query && query[0] != '\0') { |
|
|
320 |
int len; |
| 323 |
if (sscanf(query, "%31[-a-zA-Z0-9]=%127[^;&]%n", key, value, &len) != 2) { |
321 |
if (sscanf(query, "%31[-a-zA-Z0-9]=%127[^;&]%n", key, value, &len) != 2) { |
| 324 |
g_warning("Failed to parse URI query '%s'", query); |
322 |
g_warning("Failed to parse URI query '%s'", query); |
| 325 |
goto fail; |
323 |
goto fail; |
| 326 |
- |
|
|