comparison src/os/win32/ngx_sendfile.c @ 3:34a521b1a148

nginx-0.0.1-2002-08-20-18:48:28 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 20 Aug 2002 14:48:28 +0000
parents 4eff17414a43
children c5f071d376e5
comparison
equal deleted inserted replaced
2:ffffe1499bce 3:34a521b1a148
1 1
2 #include <ngx_config.h> 2 #include <ngx_config.h>
3 #include <ngx_types.h> 3 #include <ngx_types.h>
4 #include <ngx_socket.h>
4 #include <ngx_errno.h> 5 #include <ngx_errno.h>
5 #include <ngx_log.h> 6 #include <ngx_log.h>
6 #include <ngx_sendv.h> 7 #include <ngx_sendv.h>
7 #include <ngx_sendfile.h> 8 #include <ngx_sendfile.h>
8 9
50 51
51 } else { 52 } else {
52 ptfb = NULL; 53 ptfb = NULL;
53 } 54 }
54 55
56 #if 0
55 tfrc = TransmitFile(s, fd, nbytes, 0, &olp, ptfb, 0); 57 tfrc = TransmitFile(s, fd, nbytes, 0, &olp, ptfb, 0);
58 #else
59 tfrc = TransmitFile(s, fd, nbytes, 0, NULL, ptfb, 0);
60 #endif
56 61
57 if (tfrc == 0) 62 if (tfrc == 0)
58 tf_err = ngx_socket_errno; 63 tf_err = ngx_socket_errno;
59 64
60 /* set sent */ 65 /* set sent */
66 #if 0
61 rc = WSAGetOverlappedResult(s, &olp, (unsigned long *) sent, 0, NULL); 67 rc = WSAGetOverlappedResult(s, &olp, (unsigned long *) sent, 0, NULL);
68 #endif
62 69
63 ngx_log_debug(log, "ngx_sendfile: %d, @%qd %d:%qd" _ 70 ngx_log_debug(log, "ngx_sendfile: %d, @%I64d %I64d:%d" _
64 tfrc _ offset _ nbytes _ *sent); 71 tfrc _ offset _ *sent _ nbytes);
65 72
66 if (rc == 0) { 73 if (rc == 0) {
67 err = ngx_socket_errno; 74 err = ngx_socket_errno;
68 ngx_log_error(NGX_LOG_ERR, log, err, 75 ngx_log_error(NGX_LOG_ERR, log, err,
69 "ngx_sendfile: WSAGetOverlappedResult failed"); 76 "ngx_sendfile: WSAGetOverlappedResult failed");
75 "ngx_sendfile: TransmitFile failed"); 82 "ngx_sendfile: TransmitFile failed");
76 return -1; 83 return -1;
77 } 84 }
78 85
79 ngx_log_error(NGX_LOG_INFO, log, tf_err, 86 ngx_log_error(NGX_LOG_INFO, log, tf_err,
80 "ngx_sendfile: TransmitFile sent only %qd bytes", *sent); 87 "ngx_sendfile: TransmitFile sent only %I64d bytes",
88 *sent);
81 } 89 }
82 90
83 if (rc == 0) 91 if (rc == 0)
84 return -1; 92 return -1;
85 93