summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstoddard <stoddard@13f79535-47bb-0310-9956-ffa450edef68>2000-01-24 20:58:20 +0000
committerstoddard <stoddard@13f79535-47bb-0310-9956-ffa450edef68>2000-01-24 20:58:20 +0000
commitd2d04550d8122ce765525704b834e4a251debfd2 (patch)
treebd880a37f95bade7d485d00b6695e51f7bfc3feb
parent6a82a5e8d12d2dbabd0446bc1b972c60eb399c1e (diff)
downloadlibapr-d2d04550d8122ce765525704b834e4a251debfd2.tar.gz
More sendfile tweaks for Windows. Still not ready for prime time.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@59618 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--apr.dsp4
-rw-r--r--aprlib.dsp4
-rw-r--r--aprlib.mak220
-rw-r--r--network_io/win32/sendrecv.c53
4 files changed, 58 insertions, 223 deletions
diff --git a/apr.dsp b/apr.dsp
index b1d2b2904..6cea11603 100644
--- a/apr.dsp
+++ b/apr.dsp
@@ -52,7 +52,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /machine:I386
!ELSEIF "$(CFG)" == "aprlib - Win32 Debug"
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
!ENDIF
diff --git a/aprlib.dsp b/aprlib.dsp
index b1d2b2904..6cea11603 100644
--- a/aprlib.dsp
+++ b/aprlib.dsp
@@ -52,7 +52,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /machine:I386
!ELSEIF "$(CFG)" == "aprlib - Win32 Debug"
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
!ENDIF
diff --git a/aprlib.mak b/aprlib.mak
index 0cc9c77e3..3a32b4338 100644
--- a/aprlib.mak
+++ b/aprlib.mak
@@ -105,8 +105,8 @@ BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
- odbccp32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:no\
- /pdb:"$(OUTDIR)\aprlib.pdb" /machine:I386 /def:".\aprlib.def"\
+ odbccp32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll\
+ /incremental:no /pdb:"$(OUTDIR)\aprlib.pdb" /machine:I386 /def:".\aprlib.def"\
/out:"$(OUTDIR)\aprlib.dll" /implib:"$(OUTDIR)\aprlib.lib"
DEF_FILE= \
".\aprlib.def"
@@ -232,9 +232,10 @@ BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
- odbccp32.lib ws2_32.lib /nologo /subsystem:windows /dll /incremental:yes\
- /pdb:"$(OUTDIR)\aprlib.pdb" /debug /machine:I386 /def:".\aprlib.def"\
- /out:"$(OUTDIR)\aprlib.dll" /implib:"$(OUTDIR)\aprlib.lib" /pdbtype:sept
+ odbccp32.lib ws2_32.lib mswsock.lib /nologo /subsystem:windows /dll\
+ /incremental:yes /pdb:"$(OUTDIR)\aprlib.pdb" /debug /machine:I386\
+ /def:".\aprlib.def" /out:"$(OUTDIR)\aprlib.dll" /implib:"$(OUTDIR)\aprlib.lib"\
+ /pdbtype:sept
DEF_FILE= \
".\aprlib.def"
LINK32_OBJS= \
@@ -328,10 +329,6 @@ DEP_CPP_ACCES=\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
".\time\win32\atime.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_ACCES=\
- ".\include\apr.h"\
"$(INTDIR)\access.obj" : $(SOURCE) $(DEP_CPP_ACCES) "$(INTDIR)"
@@ -371,11 +368,6 @@ DEP_CPP_APR_C=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_APR_C=\
- ".\include\apr.h"\
- ".\lib\apr_config.h"\
"$(INTDIR)\apr_cpystrn.obj" : $(SOURCE) $(DEP_CPP_APR_C) "$(INTDIR)"
@@ -403,25 +395,10 @@ DEP_CPP_APR_C=\
SOURCE=.\lib\apr_execve.c
-!IF "$(CFG)" == "aprlib - Win32 Release"
-
-NODEP_CPP_APR_E=\
- ".\lib\apr_config.h"\
-
-
-"$(INTDIR)\apr_execve.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-!ELSEIF "$(CFG)" == "aprlib - Win32 Debug"
-
-
"$(INTDIR)\apr_execve.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
-!ENDIF
-
SOURCE=.\lib\apr_fnmatch.c
!IF "$(CFG)" == "aprlib - Win32 Release"
@@ -435,11 +412,6 @@ DEP_CPP_APR_F=\
".\include\apr_thread_proc.h"\
".\include\apr_time.h"\
".\include\apr_win.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_APR_F=\
- ".\include\apr.h"\
- ".\lib\apr_config.h"\
"$(INTDIR)\apr_fnmatch.obj" : $(SOURCE) $(DEP_CPP_APR_F) "$(INTDIR)"
@@ -478,11 +450,6 @@ DEP_CPP_APR_G=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_APR_G=\
- ".\include\apr.h"\
- ".\lib\apr_config.h"\
"$(INTDIR)\apr_getpass.obj" : $(SOURCE) $(DEP_CPP_APR_G) "$(INTDIR)"
@@ -521,11 +488,6 @@ DEP_CPP_APR_M=\
".\include\apr_thread_proc.h"\
".\include\apr_time.h"\
".\include\apr_win.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_APR_M=\
- ".\include\apr.h"\
- ".\lib\apr_config.h"\
"$(INTDIR)\apr_md5.obj" : $(SOURCE) $(DEP_CPP_APR_M) "$(INTDIR)"
@@ -568,12 +530,6 @@ DEP_CPP_APR_P=\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
".\misc\win32\misc.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_APR_P=\
- ".\include\apr.h"\
- ".\lib\apr_config.h"\
"$(INTDIR)\apr_pools.obj" : $(SOURCE) $(DEP_CPP_APR_P) "$(INTDIR)"
@@ -616,12 +572,6 @@ DEP_CPP_APR_S=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_APR_S=\
- ".\include\apr.h"\
- ".\lib\apr_config.h"\
- ".\lib\http_log.h"\
CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I "./include" /I "./inc" /I\
"./misc/win32" /I "./file_io/win32" /I "./misc/win32/" /I "./file_io/win32/" /D\
@@ -660,9 +610,6 @@ CPP_SWITCHES=/nologo /MTd /W3 /Gm /GX /Zi /Od /I "./include" /I "./inc" /I\
!ENDIF
SOURCE=.\lib\apr_snprintf.c
-
-!IF "$(CFG)" == "aprlib - Win32 Release"
-
DEP_CPP_APR_SN=\
".\include\apr_errno.h"\
".\include\apr_file_io.h"\
@@ -672,36 +619,12 @@ DEP_CPP_APR_SN=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_APR_SN=\
- ".\include\apr.h"\
- ".\lib\apr_config.h"\
"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_SN) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
-!ELSEIF "$(CFG)" == "aprlib - Win32 Debug"
-
-DEP_CPP_APR_SN=\
- ".\include\apr_errno.h"\
- ".\include\apr_file_io.h"\
- ".\include\apr_general.h"\
- ".\include\apr_lib.h"\
- ".\include\apr_thread_proc.h"\
- ".\include\apr_time.h"\
- ".\include\apr_win.h"\
- ".\include\apr_winconfig.h"\
-
-
-"$(INTDIR)\apr_snprintf.obj" : $(SOURCE) $(DEP_CPP_APR_SN) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-!ENDIF
-
SOURCE=.\lib\apr_tables.c
!IF "$(CFG)" == "aprlib - Win32 Release"
@@ -718,11 +641,6 @@ DEP_CPP_APR_T=\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
".\misc\win32\misc.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_APR_T=\
- ".\include\apr.h"\
- ".\lib\apr_config.h"\
"$(INTDIR)\apr_tables.obj" : $(SOURCE) $(DEP_CPP_APR_T) "$(INTDIR)"
@@ -769,11 +687,6 @@ DEP_CPP_DIR_C=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_DIR_C=\
- ".\include\apr.h"\
"$(INTDIR)\dir.obj" : $(SOURCE) $(DEP_CPP_DIR_C) "$(INTDIR)"
@@ -819,11 +732,6 @@ DEP_CPP_FILEA=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_FILEA=\
- ".\include\apr.h"\
"$(INTDIR)\fileacc.obj" : $(SOURCE) $(DEP_CPP_FILEA) "$(INTDIR)"
@@ -866,11 +774,6 @@ DEP_CPP_FILED=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_FILED=\
- ".\include\apr.h"\
"$(INTDIR)\filedup.obj" : $(SOURCE) $(DEP_CPP_FILED) "$(INTDIR)"
@@ -913,11 +816,6 @@ DEP_CPP_FILES=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_FILES=\
- ".\include\apr.h"\
"$(INTDIR)\filestat.obj" : $(SOURCE) $(DEP_CPP_FILES) "$(INTDIR)"
@@ -957,10 +855,6 @@ DEP_CPP_GETOP=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\misc\win32\misc.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_GETOP=\
- ".\include\apr.h"\
"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)"
@@ -1001,10 +895,6 @@ DEP_CPP_LOCKS=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\locks\win32\locks.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_LOCKS=\
- ".\include\apr.h"\
"$(INTDIR)\locks.obj" : $(SOURCE) $(DEP_CPP_LOCKS) "$(INTDIR)"
@@ -1046,11 +936,6 @@ DEP_CPP_NAMES=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_NAMES=\
- ".\include\apr.h"\
"$(INTDIR)\names.obj" : $(SOURCE) $(DEP_CPP_NAMES) "$(INTDIR)"
@@ -1094,11 +979,6 @@ DEP_CPP_OPEN_=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_OPEN_=\
- ".\include\apr.h"\
"$(INTDIR)\open.obj" : $(SOURCE) $(DEP_CPP_OPEN_) "$(INTDIR)"
@@ -1144,11 +1024,6 @@ DEP_CPP_PIPE_=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_PIPE_=\
- ".\include\apr.h"\
"$(INTDIR)\pipe.obj" : $(SOURCE) $(DEP_CPP_PIPE_) "$(INTDIR)"
@@ -1190,10 +1065,6 @@ DEP_CPP_POLL_=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\network_io\win32\networkio.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_POLL_=\
- ".\include\apr.h"\
"$(INTDIR)\poll.obj" : $(SOURCE) $(DEP_CPP_POLL_) "$(INTDIR)"
@@ -1239,11 +1110,6 @@ DEP_CPP_PROC_=\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
".\threadproc\win32\threadproc.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_PROC_=\
- ".\include\apr.h"\
"$(INTDIR)\proc.obj" : $(SOURCE) $(DEP_CPP_PROC_) "$(INTDIR)"
@@ -1276,30 +1142,14 @@ DEP_CPP_PROC_=\
!ENDIF
SOURCE=.\file_io\win32\readdir.c
-
-!IF "$(CFG)" == "aprlib - Win32 Release"
-
DEP_CPP_READD=\
".\file_io\win32\readdir.h"\
- {$(INCLUDE)}"sys\types.h"\
"$(INTDIR)\readdir.obj" : $(SOURCE) $(DEP_CPP_READD) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
-!ELSEIF "$(CFG)" == "aprlib - Win32 Debug"
-
-DEP_CPP_READD=\
- ".\file_io\win32\readdir.h"\
-
-
-"$(INTDIR)\readdir.obj" : $(SOURCE) $(DEP_CPP_READD) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-!ENDIF
-
SOURCE=.\file_io\win32\readwrite.c
!IF "$(CFG)" == "aprlib - Win32 Release"
@@ -1315,11 +1165,6 @@ DEP_CPP_READW=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_READW=\
- ".\include\apr.h"\
"$(INTDIR)\readwrite.obj" : $(SOURCE) $(DEP_CPP_READW) "$(INTDIR)"
@@ -1362,11 +1207,6 @@ DEP_CPP_SEEK_=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_SEEK_=\
- ".\include\apr.h"\
"$(INTDIR)\seek.obj" : $(SOURCE) $(DEP_CPP_SEEK_) "$(INTDIR)"
@@ -1408,10 +1248,6 @@ DEP_CPP_SENDR=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\network_io\win32\networkio.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_SENDR=\
- ".\include\apr.h"\
"$(INTDIR)\sendrecv.obj" : $(SOURCE) $(DEP_CPP_SENDR) "$(INTDIR)"
@@ -1421,14 +1257,17 @@ NODEP_CPP_SENDR=\
!ELSEIF "$(CFG)" == "aprlib - Win32 Debug"
DEP_CPP_SENDR=\
+ ".\file_io\win32\fileio.h"\
".\include\apr_errno.h"\
".\include\apr_file_io.h"\
".\include\apr_general.h"\
".\include\apr_lib.h"\
".\include\apr_network_io.h"\
+ ".\include\apr_pools.h"\
".\include\apr_thread_proc.h"\
".\include\apr_time.h"\
".\include\apr_win.h"\
+ ".\include\apr_winconfig.h"\
".\network_io\win32\networkio.h"\
@@ -1454,11 +1293,6 @@ DEP_CPP_SIGNA=\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
".\threadproc\win32\threadproc.h"\
- {$(INCLUDE)}"sys\stat.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_SIGNA=\
- ".\include\apr.h"\
"$(INTDIR)\signals.obj" : $(SOURCE) $(DEP_CPP_SIGNA) "$(INTDIR)"
@@ -1501,10 +1335,6 @@ DEP_CPP_SOCKA=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\network_io\win32\networkio.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_SOCKA=\
- ".\include\apr.h"\
"$(INTDIR)\sockaddr.obj" : $(SOURCE) $(DEP_CPP_SOCKA) "$(INTDIR)"
@@ -1547,10 +1377,6 @@ DEP_CPP_SOCKE=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\network_io\win32\networkio.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_SOCKE=\
- ".\include\apr.h"\
"$(INTDIR)\sockets.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)"
@@ -1593,10 +1419,6 @@ DEP_CPP_SOCKO=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\network_io\win32\networkio.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_SOCKO=\
- ".\include\apr.h"\
"$(INTDIR)\sockopt.obj" : $(SOURCE) $(DEP_CPP_SOCKO) "$(INTDIR)"
@@ -1639,10 +1461,6 @@ DEP_CPP_START=\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
".\misc\win32\misc.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_START=\
- ".\include\apr.h"\
"$(INTDIR)\start.obj" : $(SOURCE) $(DEP_CPP_START) "$(INTDIR)"
@@ -1688,10 +1506,6 @@ DEP_CPP_THREA=\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
".\threadproc\win32\threadproc.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_THREA=\
- ".\include\apr.h"\
"$(INTDIR)\thread.obj" : $(SOURCE) $(DEP_CPP_THREA) "$(INTDIR)"
@@ -1733,10 +1547,6 @@ DEP_CPP_THREAD=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\threadproc\win32\threadproc.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_THREAD=\
- ".\include\apr.h"\
"$(INTDIR)\threadcancel.obj" : $(SOURCE) $(DEP_CPP_THREAD) "$(INTDIR)"
@@ -1777,10 +1587,6 @@ DEP_CPP_THREADP=\
".\include\apr_time.h"\
".\include\apr_win.h"\
".\threadproc\win32\threadproc.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_THREADP=\
- ".\include\apr.h"\
"$(INTDIR)\threadpriv.obj" : $(SOURCE) $(DEP_CPP_THREADP) "$(INTDIR)"
@@ -1826,10 +1632,6 @@ DEP_CPP_TIME_=\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
".\time\win32\atime.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_TIME_=\
- ".\include\apr.h"\
"$(INTDIR)\time.obj" : $(SOURCE) $(DEP_CPP_TIME_) "$(INTDIR)"
@@ -1875,10 +1677,6 @@ DEP_CPP_TIMES=\
".\include\apr_win.h"\
".\include\apr_winconfig.h"\
".\time\win32\atime.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_TIMES=\
- ".\include\apr.h"\
"$(INTDIR)\timestr.obj" : $(SOURCE) $(DEP_CPP_TIMES) "$(INTDIR)"
diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
index 28badcdc2..34ed2c017 100644
--- a/network_io/win32/sendrecv.c
+++ b/network_io/win32/sendrecv.c
@@ -60,6 +60,7 @@
#include "apr_general.h"
#include "apr_network_io.h"
#include "apr_lib.h"
+#include "fileio.h"
#include <time.h>
ap_status_t ap_send(struct socket_t *sock, const char *buf, ap_ssize_t *len)
@@ -194,13 +195,13 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file,
ap_int32_t flags)
{
ap_ssize_t rv;
- int rv;
- int lasterror;
+ OVERLAPPED Overlapped, *pOverlapped;
+ TRANSMIT_FILE_BUFFERS TFBuffs, *pTFBuffs;
+ int i, lasterror, ptr = 0;
int timeout = sock->timeout * 1000; /* Need timeout in milliseconds */
- HANDLE nfd;
DWORD dwFlags = 0;
-
- ap_get_os_file(&nfd, file);
+ size_t headerlen = 0, trailerlen = 0;
+ void *headerbuf, *trailerbuf;
rv = setsockopt(sock->sock, SOL_SOCKET, SO_SNDTIMEO,
(char*) &timeout, sizeof(timeout));
@@ -212,18 +213,54 @@ ap_status_t ap_sendfile(ap_socket_t * sock, ap_file_t * file,
#else
dwFlags = 0; // TF_DISCONNECT;TF_WRITE_BEHIND;TF_REUSE_SOCKET;
#endif
+
+ /* TransmitFile can only send one header and one footer */
+ pTFBuffs = NULL;
+ memset(&TFBuffs, '0', sizeof (TFBuffs));
+ if (hdtr->numheaders) {
+ for (i = 0; i < hdtr->numheaders; i++) {
+ TFBuffs.HeadLength += hdtr->headers[i].iov_len;
+ }
+
+ TFBuffs.Head = ap_palloc(sock->cntxt, headerlen); /* should this be a malloc? */
+
+ for (i = 0; i < hdtr->numheaders; i++) {
+ memcpy(&TFBuffs.Head, hdtr->headers[i].iov_base + ptr,
+ hdtr->headers[i].iov_len);
+ ptr += hdtr->headers[i].iov_len;
+ }
+ pTFBuffs = &TFBuffs;
+ }
+ if (hdtr->numtrailers) {
+ for (i = 0; i < hdtr->numtrailers; i++) {
+ TFBuffs.TailLength += hdtr->headers[i].iov_len;
+ }
+
+ TFBuffs.Tail = ap_palloc(sock->cntxt, trailerlen); /* Should this be a malloc */
+
+ for (i = 0; i < hdtr->numtrailers; i++) {
+ memcpy(&TFBuffs.Tail, hdtr->trailers[i].iov_base + ptr,
+ hdtr->trailers[i].iov_len);
+ ptr += hdtr->trailers[i].iov_len;
+ }
+
+ pTFBuffs = &TFBuffs;
+ }
+
+// memset(&overlapped,'0', sizeof(overlapped));
rv = TransmitFile(sock->sock, /* socket */
- nfd, /* open file descriptor of the file to be sent */
- filelen, /* number of bytes to send. 0==> send all */
+ file->filehand, /* open file descriptor of the file to be sent */
+ *len, /* number of bytes to send. 0==> send all */
0, /* Number of bytes per send. 0=> use default */
NULL, /* OVERLAPPED structure */
- NULL, /* header and trailer buffers */
+ pTFBuffs, /* header and trailer buffers */
dwFlags); /* flags to control various aspects of TransmitFIle */
if (!rv) {
lasterror = WSAGetLastError();
printf("TransmitFile failed with error %d\n", lasterror);
return lasterror;
}
+
return APR_SUCCESS;
}
#endif