summaryrefslogtreecommitdiff
path: root/test/testsock.c
Commit message (Collapse)AuthorAgeFilesLines
* * test/testsock.c (test_zone): Remove duplicate test,jorton2017-12-081-3/+0
| | | | | | | thanks to rpluem. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1817485 13f79535-47bb-0310-9956-ffa450edef68
* * network_io/unix/sockaddr.c (apr_sockaddr_zone_set): Failjorton2017-11-291-1/+6
| | | | | | | | | | | for an address which is not link-local. * include/apr_network_io.h: Document the above. * test/testsock.c (test_zone): Test for that. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1816628 13f79535-47bb-0310-9956-ffa450edef68
* Support IPv6 link-local address scope/zone mapping.jorton2017-11-281-0/+93
| | | | | | | | | | | | | | | | | | | | * network_io/unix/sockaddr.c (apr_sockaddr_zone_set, apr_sockaddr_zone_get): New functions. (apr_sockaddr_ip_getbuf): Append %scope for link-local address. (apr_sockaddr_equal): Compare link-local address with different scopes as not equal. * include/apr_network_io.h: Add function declarations. * configure.in: Test for if_indextoname and if_nametoindex. * test/testsock.c (test_zone): New test case. * include/arch/win32/apr_private.h: Assume Windows supports if_nametoindex and if_indextoname. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1816527 13f79535-47bb-0310-9956-ffa450edef68
* * include/apr_network_io.h (APR_SO_FREEBIND): Add option.jorton2016-03-031-0/+34
| | | | | | | | | | | | * network_io/unix/sockopt.c (apr_socket_opt_set): Implement APR_SO_FREEBIND on Linux with IP_FREEBIND * test/testsock.c (test_freebind): Add test case. Submitted by: Ashley GC, jkaluza, jorton git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1733451 13f79535-47bb-0310-9956-ffa450edef68
* Add testcase for apr_sockaddr_info_copy()trawick2014-04-151-0/+51
| | | | | | | | Submitted by: Yann Ylavic <ylavic.dev gmail.com> Reviewed by: trawick git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1587543 13f79535-47bb-0310-9956-ffa450edef68
* pick up htons where neededcovener2013-12-211-0/+2
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1552846 13f79535-47bb-0310-9956-ffa450edef68
* Add testcase for broken handling of APR_O_NONBLOCK_INHERITEDtrawick2013-12-171-0/+49
| | | | | | | (as seen on FreeBSD 10). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1551650 13f79535-47bb-0310-9956-ffa450edef68
* add apr_sockaddr_is_wildcard() APItrawick2013-11-121-0/+11
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1541061 13f79535-47bb-0310-9956-ffa450edef68
* add a missing server socket closetrawick2011-04-061-0/+5
| | | | | | | | remove AF_UNIX socket from filsystem before trying to bind, in case it exists from a previous run git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1089428 13f79535-47bb-0310-9956-ffa450edef68
* avoid segfault when setup_socket() failstrawick2011-04-061-0/+3
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1089424 13f79535-47bb-0310-9956-ffa450edef68
* apr_sockaddr_info_get() on AIX: Fix a problem which could settrawick2011-03-131-0/+6
| | | | | | | | | | | | | the port field in the native socket address to 1 when 0 was specified. An AIX-specific hack to work around a service name limitation used "1" as the service name, but the 1 was not replaced later. PR: 46964 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1081120 13f79535-47bb-0310-9956-ffa450edef68
* * network_io/unix/sockets.c (apr_socket_connect): Copy the remotejorton2010-08-091-6/+29
| | | | | | | | | | | | | | address by value rather than by reference. This ensures that the sockaddr object returned by apr_socket_addr_get is allocated from the same pool as the socket object itself, as apr_socket_accept does; avoiding any potential lifetime mismatches. * test/testsock.c (test_get_addr): Enhance test case to cover this. PR: 49713 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@983618 13f79535-47bb-0310-9956-ffa450edef68
* Hide apr_wait_for_io_or_timeout() from public view and add insteadbjh2010-04-121-0/+60
| | | | | | | apr_socket_wait() and apr_file_pipe_wait(). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@933338 13f79535-47bb-0310-9956-ffa450edef68
* don't assume child process can both connect and close before parent cantrawick2009-11-081-1/+6
| | | | | | | | | | both accept and look for EOF (fixes intermittent failure seen on Linux and OpenSolaris) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@833907 13f79535-47bb-0310-9956-ffa450edef68
* * include/apr_network_io.h,jorton2009-10-121-5/+12
| | | | | | | | | | | | | | * network_io/unix/socket_util.c (apr_socket_atreadeof): Renamed from apr_socket_is_connected; adjusted to return an apr_status_t error code, and pass an "at EOF" flag via an output parameter. * test/testsock.c (test_atreadeof): Renamed from test_is_connected, adjusted for new API. Submitted by: jorton, rpluem git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@824500 13f79535-47bb-0310-9956-ffa450edef68
* * Add apr_socket_is_connected to detect whether the remote side of a socketrpluem2009-10-041-0/+50
| | | | | | | | | is still open. The origin of apr_socket_is_connected is r473278 from http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c in httpd. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@821524 13f79535-47bb-0310-9956-ffa450edef68
* Pass environment to children in testsock, testshm and testproc.bojan2009-09-011-0/+3
| | | | | | Further fixes for PR 47590. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@809854 13f79535-47bb-0310-9956-ffa450edef68
* Enable unix domain (AF_UNIX) sockets if supported by the OSmturk2009-02-191-5/+18
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@745763 13f79535-47bb-0310-9956-ffa450edef68
* Test for telnet service instead of http (Solaris 8 doesn't have http).bojan2008-08-111-3/+3
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@684616 13f79535-47bb-0310-9956-ffa450edef68
* Add test for apr_getservbyname().bojan2008-06-021-0/+21
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@662326 13f79535-47bb-0310-9956-ffa450edef68
* Without otherwise addressing the issues on Win32 when presentedwrowe2007-10-151-3/+8
| | | | | | | | with mixed-notation addresses and no IPv6 adapter present, at least avoid crashing. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@584660 13f79535-47bb-0310-9956-ffa450edef68
* Solve two sets of issues, only two possible changes, in onewrowe2007-10-061-3/+3
| | | | | | | | | | | batch commit; * P64 architectures require us to use ABTS_SIZE_EQUAL * We need to localize to TESTBINPATH for win32 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@582544 13f79535-47bb-0310-9956-ffa450edef68
* * test/testsock.c (setup_socket): Bind the socket to 127.0.0.1 ratherjorton2006-11-271-1/+1
| | | | | | | | than 0.0.0.0 since a connect() to the latter apparently doesn't work on Win32; the ./sockchild-based tests only use 127.0.0.1 anyway. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@479582 13f79535-47bb-0310-9956-ffa450edef68
* Better exception handling of deferred socket connect outcomes.wrowe2006-11-221-2/+8
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@478327 13f79535-47bb-0310-9956-ffa450edef68
* Fix the typo.jorton2006-08-031-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
* Update license header.jorton2006-08-031-6/+6
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
* There are -so- many reasons this code -could- fail, and anywrowe2006-03-131-3/+2
| | | | | | | of them will hang the remainder of the test. Better to simply fail them all, with an extra notice when the error is unusual. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@385594 13f79535-47bb-0310-9956-ffa450edef68
* * test/testsock.c (test_get_addr): Fix error handling.jorton2006-02-131-2/+11
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@377330 13f79535-47bb-0310-9956-ffa450edef68
* Don't error out if we get back EINPROGRESS from a nonblocking connect,rooneg2006-02-091-2/+2
| | | | | | | | | | | that's the expected behavior. * test/testsock.c (test_get_addr): Look for the expected EINPROGRESS error and only bail when we get something else from apr_socket_connect. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@376433 13f79535-47bb-0310-9956-ffa450edef68
* Avoid a hang when running the tests on win32.rooneg2006-02-091-3/+5
| | | | | | | * tesst/testsock.c (test_get_addr): Return if the apr_socket_connect fails. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@376196 13f79535-47bb-0310-9956-ffa450edef68
* * test/testsock.c (setup_socket): Set REUSEADDR option before bindingjorton2005-11-231-0/+3
| | | | | | | socket. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@348405 13f79535-47bb-0310-9956-ffa450edef68
* * test/testsock.c (test_print_addr): Add regression test for v4-mappedjorton2005-09-201-0/+14
| | | | | | | | address handling bug in apr_sockaddr_ip_getbuf (thanks Martin for fixing it!). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@290399 13f79535-47bb-0310-9956-ffa450edef68
* Fix apr_socket_addr_get(APR_REMOTE) after a non-blocking connect():jorton2005-09-091-0/+60
| | | | | | | | | | | | | | * network_io/unix/sockets.c (alloc_socket): Set remote_addr_unknown. (apr_socket_accept): Clear remote_addr_unknown. (apr_socket_connect): Clear remote_addr_unknown and set remote_addr iff the passed-in address was not the inaddr_any address. * test/testsock.c (test_get_addr): New test. PR: 32737 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@279727 13f79535-47bb-0310-9956-ffa450edef68
* Fix handling of %pI with psprintf; the psprintf implementation assumesjorton2005-09-081-0/+14
| | | | | | | | | | | | | | | | | | | that the vformatter code will not palloc. * include/apr_network_io.h (apr_sockaddr_ip_getbuf): Declare new function. * network_io/unix/sockaddr.c (apr_sockaddr_ip_getbuf): Rewrite of apr_sockaddr_ip_get, taking a buffer argument. (apr_sockaddr_ip_get): Reimplement using apr_sockaddr_ip_getbuf. * strings/apr_snprintf.c (conv_apr_sockaddr): Use apr_sockaddr_ip_getbuf to avoid use of pool. * test/testsock.c (test_print_addr): New test case. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@279566 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright year to 2005 and standardize on current copyright owner line.jerenkrantz2005-02-041-1/+2
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
* Presently if we fail in apr_assert_success we get the line number fordreid2004-06-071-20/+20
| | | | | | | | | | | | testutil.c reported. Not very useful. This change adds the passing of the (correct) line number and also a macro to ease said passing. I've changed all instances of apr_assert_success to use the new macro, but not all the tests build on this platform so others should check that all is well for them. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65171 13f79535-47bb-0310-9956-ffa450edef68
* * test/testsock.c (setup_socket): Return NULL if bind fails, fixingjorton2004-06-021-2/+8
| | | | | | | | test suite hang if port 8021 is in use; all callers updated. (come back longjmp, all is forgiven). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65147 13f79535-47bb-0310-9956-ffa450edef68
* Add the line number to the verbose output from abts. This also removesrbb2004-05-141-10/+10
| | | | | | | a test that is segfaulting in testshm. That will need to be fixed. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65095 13f79535-47bb-0310-9956-ffa450edef68
* Move the APR test suite from CuTest to abts. The output is cleaner,rbb2004-05-131-26/+26
| | | | | | | | | | | | and it prints output while running the test. Also, if a test fails the rest of the test function is run, allowing for proper cleanup. Finally, it is possible to call the same function multiple times with different data, and each call is considered a separate test. This is the first of a multi-step process to get a more useful test suite. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65091 13f79535-47bb-0310-9956-ffa450edef68
* * test/testsock.c (test_addr_info): Pass NULL as hostname rather thanjorton2004-03-181-2/+2
| | | | | | | an apr_interface_e. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65018 13f79535-47bb-0310-9956-ffa450edef68
* Fix compile warnings on Mac OS X.rbb2004-03-151-2/+2
| | | | | | | Submitted By: Garrett Rooney <rooneg@electricjellyfish.net> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64994 13f79535-47bb-0310-9956-ffa450edef68
* Fix the testsock tests on Windows, mostly.rbb2004-03-151-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64993 13f79535-47bb-0310-9956-ffa450edef68
* testsock no longer causes a GPF on Windows. Still doesn't pass the testsrbb2004-03-151-15/+13
| | | | | | | though. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64990 13f79535-47bb-0310-9956-ffa450edef68
* Port testsock to the unified framework. This doesn't include therbb2004-03-141-143/+182
| | | | | | | | | | | sendfile tests, those are next. Also, instead of having a server and client, testsock.c implements the server, and sockchild.c implements the client. I have also removed the part of the test that relied on apr_poll(). That is tested in testpoll, and just makes this code more confusing than it needs to be. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64987 13f79535-47bb-0310-9956-ffa450edef68
* Relicense APR under Apache License, Version 2.0jerenkrantz2004-02-131-49/+10
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright notices to 2003.thommay2003-01-011-1/+1
| | | | | | | No functional changes git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64251 13f79535-47bb-0310-9956-ffa450edef68
* Update our copyright for this year.fielding2002-03-131-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63117 13f79535-47bb-0310-9956-ffa450edef68
* Fix the reporting for child processes that die. This removesrbb2001-10-231-8/+8
| | | | | | | | | all of the non-portable W* macros from Apache. Submitted by: Jeff Trawick and Ryan Bloom git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62455 13f79535-47bb-0310-9956-ffa450edef68
* Add an extra parameter to all apr_proc_wait() calls for the new "exitcode"gstein2001-09-201-8/+8
| | | | | | | parameter. Pass NULL because we aren't interested in the value. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62351 13f79535-47bb-0310-9956-ffa450edef68
* These are (thankfully) now irrelevant stubs. apr_terminate is definedwrowe2001-06-081-6/+1
| | | | | | | | as _always_ compatible with atexit. A nice mindless exercise for my very sleep-deprived brain. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61735 13f79535-47bb-0310-9956-ffa450edef68