version 1.22, 2002/09/20 19:40:11
|
version 1.23, 2002/09/21 15:39:28
|
|
|
p += 2; | p += 2; |
| |
//---------------------------------------------------------------------- | //---------------------------------------------------------------------- |
// Validate the hostname. Hostnames must match the following |
// Validate the hostname. A domain is allowed after the hostname. |
// regular expression: "[A-Za-z][A-Za-z0-9-]*" |
// Eg. xyz.company.com |
|
// Hostnames must match the following regular expression: |
|
// ^([A-Za-z][A-Za-z0-9-]*)(\.[A-Za-z][A-Za-z0-9-]*)*$ |
//---------------------------------------------------------------------- | //---------------------------------------------------------------------- |
| |
char* q = p; | char* q = p; |
| |
|
Boolean foundDot = true; |
|
while (foundDot == true) |
|
{ |
|
foundDot = false; |
|
|
if (!isalpha(*q)) | if (!isalpha(*q)) |
throw MalformedObjectNameException(objectName); | throw MalformedObjectNameException(objectName); |
| |
q++; | q++; |
| |
while (isalnum(*q) || *q == '-') | while (isalnum(*q) || *q == '-') |
|
{ |
q++; | q++; |
|
} |
|
|
|
if (*q == '.') |
|
{ |
|
q++; |
|
foundDot = true; |
|
} |
|
} |
| |
// We now expect a port (or default the port). | // We now expect a port (or default the port). |
| |