Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
base/net/web-net-query.c@147:ea6f647725a1, 2021-01-10 (annotated)
- Committer:
- andrewboyson
- Date:
- Sun Jan 10 11:53:12 2021 +0000
- Revision:
- 147:ea6f647725a1
- Parent:
- base/clock/web-web-query.c@131:a9793a9721c7
- Child:
- 153:eaee18d970c4
Added ability for the user to resolve a name.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| andrewboyson | 147:ea6f647725a1 | 1 | #include <string.h> |
| andrewboyson | 147:ea6f647725a1 | 2 | |
| andrewboyson | 103:91194cc19bbb | 3 | #include "http.h" |
| andrewboyson | 147:ea6f647725a1 | 4 | #include "nr.h" |
| andrewboyson | 103:91194cc19bbb | 5 | |
| andrewboyson | 147:ea6f647725a1 | 6 | void WebNetQuery(char* pQuery) |
| andrewboyson | 103:91194cc19bbb | 7 | { |
| andrewboyson | 103:91194cc19bbb | 8 | while (pQuery) |
| andrewboyson | 103:91194cc19bbb | 9 | { |
| andrewboyson | 103:91194cc19bbb | 10 | char* pName; |
| andrewboyson | 103:91194cc19bbb | 11 | char* pValue; |
| andrewboyson | 103:91194cc19bbb | 12 | pQuery = HttpQuerySplit(pQuery, &pName, &pValue); |
| andrewboyson | 103:91194cc19bbb | 13 | int value = HttpQueryValueAsInt(pValue); |
| andrewboyson | 103:91194cc19bbb | 14 | |
| andrewboyson | 147:ea6f647725a1 | 15 | if (HttpSameStr(pName, "name-to-resolve")) |
| andrewboyson | 103:91194cc19bbb | 16 | { |
| andrewboyson | 147:ea6f647725a1 | 17 | strncpy(NrTest, pValue, NR_NAME_MAX_LENGTH); |
| andrewboyson | 103:91194cc19bbb | 18 | } |
| andrewboyson | 147:ea6f647725a1 | 19 | if (HttpSameStr(pName, "request-AAAA")) |
| andrewboyson | 103:91194cc19bbb | 20 | { |
| andrewboyson | 147:ea6f647725a1 | 21 | NrMakeRequestForAddress6FromName(NrTest); |
| andrewboyson | 103:91194cc19bbb | 22 | } |
| andrewboyson | 147:ea6f647725a1 | 23 | if (HttpSameStr(pName, "request-A")) |
| andrewboyson | 147:ea6f647725a1 | 24 | { |
| andrewboyson | 147:ea6f647725a1 | 25 | NrMakeRequestForAddress4FromName(NrTest); |
| andrewboyson | 147:ea6f647725a1 | 26 | } |
| andrewboyson | 103:91194cc19bbb | 27 | } |
| andrewboyson | 103:91194cc19bbb | 28 | } |
| andrewboyson | 103:91194cc19bbb | 29 |