diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2011-09-18 20:05:37 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2011-09-18 20:05:37 +0000 |
commit | c0f6d828da7bea8db1b162ff902834fddec75a65 (patch) | |
tree | ad79fd8916cebf15b822c50f5a0e345bc62b706a /test | |
parent | 457dc45cf439893b9e9a9622b743fe891846aeaf (diff) | |
download | neon-c0f6d828da7bea8db1b162ff902834fddec75a65.tar.gz |
* test/common/child.c: Better debugging output.
git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@1859 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'test')
-rw-r--r-- | test/common/child.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/common/child.c b/test/common/child.c index 33163cb..8ff7253 100644 --- a/test/common/child.c +++ b/test/common/child.c @@ -1,6 +1,6 @@ /* Framework for testing with a server process - Copyright (C) 2001-2009, Joe Orton <joe@manyfish.co.uk> + Copyright (C) 2001-2010, Joe Orton <joe@manyfish.co.uk> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -284,8 +284,8 @@ int spawn_server_repeat(int port, server_fn fn, void *userdata, int n) NE_DEBUG(NE_DBG_HTTP, "child awaiting connection #%d.\n", count); ONN("accept failed", ne_sock_accept(sock, listener)); ret = fn(sock, userdata); + NE_DEBUG(NE_DBG_HTTP, "child handled connection, %d.\n", ret); close_socket(sock); - NE_DEBUG(NE_DBG_HTTP, "child served request, %d.\n", ret); if (ret) { printf("server child failed (%s, iteration %d/%d): %s\n", tests[test_num].name, count, n, test_context); @@ -347,7 +347,9 @@ int new_spawn_server(int count, server_fn fn, void *userdata, do { ne_socket *sock = ne_sock_create(); - + char errbuf[256]; + int cret; + NE_DEBUG(NE_DBG_HTTP, "child iteration #%d (of %d), " "awaiting connection...\n", iter, count); @@ -362,7 +364,11 @@ int new_spawn_server(int count, server_fn fn, void *userdata, NE_DEBUG(NE_DBG_HTTP, "child iteration #%d returns %d\n", iter, ret); - close_socket(sock); + cret = close_socket(sock); + NE_DEBUG(NE_DBG_HTTP, "child closed connection, %d: %s.\n", cret, + cret ? ne_strerror(cret, errbuf, sizeof errbuf) + : "no error"); + } while (ret == 0 && ++iter <= count); NE_DEBUG(NE_DBG_HTTP, "child terminating with %d\n", ret); |