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@153:eaee18d970c4, 2021-01-21 (annotated)
- Committer:
- andrewboyson
- Date:
- Thu Jan 21 13:33:44 2021 +0000
- Revision:
- 153:eaee18d970c4
- Parent:
- 147:ea6f647725a1
- Child:
- 154:306e328871ee
Added button to test resolution of a name from an address.
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 | 153:eaee18d970c4 | 5 | #include "nrtest.h" |
| andrewboyson | 103:91194cc19bbb | 6 | |
| andrewboyson | 147:ea6f647725a1 | 7 | void WebNetQuery(char* pQuery) |
| andrewboyson | 103:91194cc19bbb | 8 | { |
| andrewboyson | 103:91194cc19bbb | 9 | while (pQuery) |
| andrewboyson | 103:91194cc19bbb | 10 | { |
| andrewboyson | 103:91194cc19bbb | 11 | char* pName; |
| andrewboyson | 103:91194cc19bbb | 12 | char* pValue; |
| andrewboyson | 103:91194cc19bbb | 13 | pQuery = HttpQuerySplit(pQuery, &pName, &pValue); |
| andrewboyson | 103:91194cc19bbb | 14 | int value = HttpQueryValueAsInt(pValue); |
| andrewboyson | 103:91194cc19bbb | 15 | |
| andrewboyson | 147:ea6f647725a1 | 16 | if (HttpSameStr(pName, "name-to-resolve")) |
| andrewboyson | 103:91194cc19bbb | 17 | { |
| andrewboyson | 147:ea6f647725a1 | 18 | strncpy(NrTest, pValue, NR_NAME_MAX_LENGTH); |
| andrewboyson | 103:91194cc19bbb | 19 | } |
| andrewboyson | 147:ea6f647725a1 | 20 | if (HttpSameStr(pName, "request-AAAA")) |
| andrewboyson | 103:91194cc19bbb | 21 | { |
| andrewboyson | 147:ea6f647725a1 | 22 | NrMakeRequestForAddress6FromName(NrTest); |
| andrewboyson | 103:91194cc19bbb | 23 | } |
| andrewboyson | 147:ea6f647725a1 | 24 | if (HttpSameStr(pName, "request-A")) |
| andrewboyson | 147:ea6f647725a1 | 25 | { |
| andrewboyson | 147:ea6f647725a1 | 26 | NrMakeRequestForAddress4FromName(NrTest); |
| andrewboyson | 147:ea6f647725a1 | 27 | } |
| andrewboyson | 153:eaee18d970c4 | 28 | if (HttpSameStr(pName, "request-PTR")) |
| andrewboyson | 153:eaee18d970c4 | 29 | { |
| andrewboyson | 153:eaee18d970c4 | 30 | NrTestNameFromAddress(); |
| andrewboyson | 153:eaee18d970c4 | 31 | } |
| andrewboyson | 103:91194cc19bbb | 32 | } |
| andrewboyson | 103:91194cc19bbb | 33 | } |
| andrewboyson | 103:91194cc19bbb | 34 |