| 383 | } |
| 384 | |
| 385 | unsigned short HttpServletRequest::getLocalPort(void) const |
| 386 | { |
| 387 | if (cgi_mode_) { |
| 388 | return 0; |
| 389 | } |
| 390 | |
| 391 | if (client_ == NULL) { |
| 392 | return 0; |
| 393 | } |
| 394 | |
| 395 | const char* ptr = client_->get_stream().get_local(true); |
| 396 | if (*ptr == 0) { |
| 397 | return 0; |
| 398 | } |
| 399 | |
| 400 | char* p = (char*) strchr(ptr, ':'); |
| 401 | if (p == NULL || *(++p) == 0) { |
| 402 | return 0; |
| 403 | } |
| 404 | |
| 405 | return atoi(p); |
| 406 | } |
| 407 | |
| 408 | const char* HttpServletRequest::getRemoteAddr(void) const |
| 409 | { |
no test coverage detected