You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@hyperreal.org on 2000/01/26 06:01:21 UTC
cvs commit: apache-2.0/src/lib/apr/network_io/unix sendrecv.c
stoddard 00/01/25 21:01:19
Modified: src/os/unix iol_socket.c
src/lib/apr/network_io/unix sendrecv.c
Log:
Fix a couple of bugs in the Unix side of the house. Not tested (no machine available).
First bug: Use ap_sendv to implement iol_writev. The previous implementation would
only send the first buffer in the chain.
Second bug: ap_sendfile() on HP needs to put all the headers (trailers) into a single
header (trailer) buffer. The data was not being copied into the buffers correctly.
Revision Changes Path
1.14 +1 -2 apache-2.0/src/os/unix/iol_socket.c
Index: iol_socket.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/os/unix/iol_socket.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- iol_socket.c 2000/01/19 01:16:21 1.13
+++ iol_socket.c 2000/01/26 05:01:13 1.14
@@ -109,8 +109,7 @@
static ap_status_t unix_writev(ap_iol *viol, const struct iovec *vec, int nvec,
ap_ssize_t *nbytes)
{
- *nbytes = vec[0].iov_len;
- return ap_send(((iol_socket *)viol)->sock, vec[0].iov_base, nbytes);
+ return ap_sendv(((iol_socket *)viol)->sock, vec, nvec, nbytes);
}
static ap_status_t unix_read(ap_iol *viol, char* buf, ap_size_t size,
1.9 +2 -2 apache-2.0/src/lib/apr/network_io/unix/sendrecv.c
Index: sendrecv.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sendrecv.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- sendrecv.c 1999/12/04 21:48:34 1.8
+++ sendrecv.c 2000/01/26 05:01:16 1.9
@@ -465,7 +465,7 @@
headerbuf = ap_palloc(sock->cntxt, headerlen);
for (i = 0; i < hdtr->numheaders; i++) {
- memcpy(headerbuf, hdtr->headers[i].iov_base + ptr,
+ memcpy(headerbuf + ptr, hdtr->headers[i].iov_base,
hdtr->headers[i].iov_len);
ptr += hdtr->headers[i].iov_len;
}
@@ -477,7 +477,7 @@
trailerbuf = ap_palloc(sock->cntxt, trailerlen);
for (i = 0; i < hdtr->numtrailers; i++) {
- memcpy(trailerbuf, hdtr->trailers[i].iov_base + ptr,
+ memcpy(trailerbuf + ptr, hdtr->trailers[i].iov_base,
hdtr->trailers[i].iov_len);
ptr += hdtr->trailers[i].iov_len;
}
Re: cvs commit: apache-2.0/src/lib/apr/network_io/unix sendrecv.c
Posted by Dale Ghent <da...@elemental.org>.
On Fri, 28 Jan 2000 rbb@apache.org wrote:
| I don't remember if I replied to this lready or not. I have investigated
| this, and I can't see why HAVE_SOCKLEN_T isn't being defined on Solaris.
| It is being defined correctly on Linux. I don't currently have access to
| a Solaris machine. If I can get an account on one soon, I'll fix this.
| If not, it will have to wait until I can find a Solaris box.
This I can definitely provide you. Talk to me privately on what you need
as far the account goes and I'll get it set up for you.
/dale
Re: cvs commit: apache-2.0/src/lib/apr/network_io/unix sendrecv.c
Posted by rb...@apache.org.
I don't remember if I replied to this lready or not. I have investigated
this, and I can't see why HAVE_SOCKLEN_T isn't being defined on Solaris.
It is being defined correctly on Linux. I don't currently have access to
a Solaris machine. If I can get an account on one soon, I'll fix this.
If not, it will have to wait until I can find a Solaris box.
Ryan
On Tue, 25 Jan 2000, Dale Ghent wrote:
> On 26 Jan 2000 stoddard@hyperreal.org wrote:
>
> | stoddard 00/01/25 21:01:19
> |
> | Modified: src/os/unix iol_socket.c
> | src/lib/apr/network_io/unix sendrecv.c
>
> Since you're working on apr stuff, There's one compile problem that stops
> 2.0 from building on at least Solaris 2.7. The "HAVE_SOCKLEN_T" #define is
> not making it's way into src/lib/apr/include/apr_config.h. Solaris does
> indeed have this typedef, and the lack of "#define HAVE_SOCKLEN_T 1" is
> causing the !define at the bottom to kick in, redefining socklen_t, and
> thus causing gcc to revolt in disgust:
>
> gcc -DSOLARIS2=270 -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS
> -D_REENTRANT -pthreads -c -I../include -I../misc/unix apr_snprintf.c
> In file included from apr_snprintf.c:77:
> /usr/include/sys/socket.h:56: conflicting types for `socklen_t'
> ../include/apr_config.h:354: previous declaration of `socklen_t'
> make[5]: *** [apr_snprintf.o] Error 1
>
> The interesting thing is that, from looking at the config.status output,
> the test for socklen_t was successful, but unfortunately, my
> autoconf/header-fu is not at the level I'd like it to be, and after
> looking at acconfig.h, aclocal.m4, and configure.in, I can't for the life
> of me find the reason why HAVE_SOCKLEN_T isnt being put in apr_config.h
> when autoheader generates it during the initial configure. Yes, I am using
> GNU m4, and not /usr/ccs/bin/m4.
>
> Thoughts?
> /dale
>
>
Come to the first official Apache Software Foundation
Conference!!! <http://ApacheCon.Com/>
_______________________________________________________________________________
Ryan Bloom rbb@ntrnet.net
2121 Stonehenge Dr. Apt #3
Raleigh, NC 27615 Ryan Bloom -- thinker, adventurer, artist,
writer, but mostly, friend.
-------------------------------------------------------------------------------
Re: cvs commit: apache-2.0/src/lib/apr/network_io/unix sendrecv.c
Posted by Dale Ghent <da...@elemental.org>.
On 26 Jan 2000 stoddard@hyperreal.org wrote:
| stoddard 00/01/25 21:01:19
|
| Modified: src/os/unix iol_socket.c
| src/lib/apr/network_io/unix sendrecv.c
Since you're working on apr stuff, There's one compile problem that stops
2.0 from building on at least Solaris 2.7. The "HAVE_SOCKLEN_T" #define is
not making it's way into src/lib/apr/include/apr_config.h. Solaris does
indeed have this typedef, and the lack of "#define HAVE_SOCKLEN_T 1" is
causing the !define at the bottom to kick in, redefining socklen_t, and
thus causing gcc to revolt in disgust:
gcc -DSOLARIS2=270 -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT -pthreads -c -I../include -I../misc/unix apr_snprintf.c
In file included from apr_snprintf.c:77:
/usr/include/sys/socket.h:56: conflicting types for `socklen_t'
../include/apr_config.h:354: previous declaration of `socklen_t'
make[5]: *** [apr_snprintf.o] Error 1
The interesting thing is that, from looking at the config.status output,
the test for socklen_t was successful, but unfortunately, my
autoconf/header-fu is not at the level I'd like it to be, and after
looking at acconfig.h, aclocal.m4, and configure.in, I can't for the life
of me find the reason why HAVE_SOCKLEN_T isnt being put in apr_config.h
when autoheader generates it during the initial configure. Yes, I am using
GNU m4, and not /usr/ccs/bin/m4.
Thoughts?
/dale