comparison src/os/win32/ngx_wsarecv.c @ 292:a472bfb778b3

nginx-0.0.3-2004-03-17-00:26:01 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 16 Mar 2004 21:26:01 +0000
parents 30310107dbc9
children da8c5707af39
comparison
equal deleted inserted replaced
291:117ccc7c4055 292:a472bfb778b3
2 #include <ngx_config.h> 2 #include <ngx_config.h>
3 #include <ngx_core.h> 3 #include <ngx_core.h>
4 #include <ngx_event.h> 4 #include <ngx_event.h>
5 5
6 6
7 ssize_t ngx_wsarecv(ngx_connection_t *c, char *buf, size_t size) 7 ssize_t ngx_wsarecv(ngx_connection_t *c, u_char *buf, size_t size)
8 { 8 {
9 int rc; 9 int rc;
10 u_long bytes, flags; 10 u_long bytes, flags;
11 WSABUF wsabuf[1]; 11 WSABUF wsabuf[1];
12 ngx_err_t err; 12 ngx_err_t err;
13 ngx_event_t *rev; 13 ngx_event_t *rev;
14 14
15 wsabuf[0].buf = buf; 15 wsabuf[0].buf = (char *) buf;
16 wsabuf[0].len = size; 16 wsabuf[0].len = size;
17 flags = 0; 17 flags = 0;
18 bytes = 0; 18 bytes = 0;
19 19
20 rc = WSARecv(c->fd, wsabuf, 1, &bytes, &flags, NULL, NULL); 20 rc = WSARecv(c->fd, wsabuf, 1, &bytes, &flags, NULL, NULL);
50 50
51 return bytes; 51 return bytes;
52 } 52 }
53 53
54 54
55 ssize_t ngx_overlapped_wsarecv(ngx_connection_t *c, char *buf, size_t size) 55 ssize_t ngx_overlapped_wsarecv(ngx_connection_t *c, u_char *buf, size_t size)
56 { 56 {
57 int rc; 57 int rc;
58 u_long bytes, flags; 58 u_long bytes, flags;
59 WSABUF wsabuf[1]; 59 WSABUF wsabuf[1];
60 ngx_err_t err; 60 ngx_err_t err;
93 return bytes; 93 return bytes;
94 } 94 }
95 95
96 ovlp = (LPWSAOVERLAPPED) &rev->ovlp; 96 ovlp = (LPWSAOVERLAPPED) &rev->ovlp;
97 ngx_memzero(ovlp, sizeof(WSAOVERLAPPED)); 97 ngx_memzero(ovlp, sizeof(WSAOVERLAPPED));
98 wsabuf[0].buf = buf; 98 wsabuf[0].buf = (char *) buf;
99 wsabuf[0].len = size; 99 wsabuf[0].len = size;
100 flags = 0; 100 flags = 0;
101 bytes = 0; 101 bytes = 0;
102 102
103 rc = WSARecv(c->fd, wsabuf, 1, &bytes, &flags, ovlp, NULL); 103 rc = WSARecv(c->fd, wsabuf, 1, &bytes, &flags, ovlp, NULL);