MCPcopy Create free account
hub / github.com/acl-dev/acl / getLocalPort

Method getLocalPort

lib_acl_cpp/src/http/HttpServletRequest.cpp:385–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385unsigned 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
408const char* HttpServletRequest::getRemoteAddr(void) const
409{

Callers 2

doPostMethod · 0.80
doPostMethod · 0.80

Calls 2

get_localMethod · 0.45
get_streamMethod · 0.45

Tested by

no test coverage detected