rbb 2004/03/14 18:42:50
Modified: test sockchild.c testsock.c
Log:
Fix the testsock tests on Windows, mostly.
Revision Changes Path
1.3 +4 -2 apr/test/sockchild.c
Index: sockchild.c
===================================================================
RCS file: /home/cvs/apr/test/sockchild.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sockchild.c 15 Mar 2004 02:14:58 -0000 1.2
+++ sockchild.c 15 Mar 2004 02:42:50 -0000 1.3
@@ -53,10 +53,12 @@
if (!strcmp("read", argv[1])) {
char datarecv[STRLEN];
apr_size_t length = STRLEN;
+ apr_status_t rv;
- apr_status_t rv = apr_socket_recv(sock, datarecv, &length);
+ memset(datarecv, 0, STRLEN);
+ rv = apr_socket_recv(sock, datarecv, &length);
apr_socket_close(sock);
- if (rv == APR_TIMEUP) {
+ if (APR_STATUS_IS_TIMEUP(rv)) {
exit(SOCKET_TIMEOUT);
}
1.30 +1 -1 apr/test/testsock.c
Index: testsock.c
===================================================================
RCS file: /home/cvs/apr/test/testsock.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- testsock.c 15 Mar 2004 02:06:51 -0000 1.29
+++ testsock.c 15 Mar 2004 02:42:50 -0000 1.30
@@ -152,7 +152,7 @@
apr_socket_protocol_get(sock2, &protocol);
CuAssertIntEquals(tc, APR_PROTO_TCP, protocol);
- length = strlen(DATASTR);
+ memset(datastr, 0, STRLEN);
apr_socket_recv(sock2, datastr, &length);
/* Make sure that the server received the data we sent */