Line 0
Link Here
|
|
|
1 |
--- libs/mod_tora/protocol.c.orig 2009-06-19 17:15:56.000000000 +0900 |
2 |
+++ libs/mod_tora/protocol.c 2009-06-19 17:17:33.000000000 +0900 |
3 |
@@ -37,7 +37,7 @@ |
4 |
cursor++; \ |
5 |
} |
6 |
|
7 |
-static int pwrite( mcontext *c, const char *buf, int len ) { |
8 |
+static int _pwrite( mcontext *c, const char *buf, int len ) { |
9 |
while( len > 0 ) { |
10 |
int k = send(c->sock,buf,len,MSG_NOSIGNAL); |
11 |
if( k <= 0 ) return 0; |
12 |
@@ -47,7 +47,7 @@ |
13 |
return 1; |
14 |
} |
15 |
|
16 |
-static int pread( mcontext *c, char *buf, int len ) { |
17 |
+static int _pread( mcontext *c, char *buf, int len ) { |
18 |
while( len > 0 ) { |
19 |
int k = recv(c->sock,buf,len,MSG_NOSIGNAL); |
20 |
if( k <= 0 ) return 0; |
21 |
@@ -63,8 +63,8 @@ |
22 |
h[1] = (unsigned char)len; |
23 |
h[2] = (unsigned char)(len >> 8); |
24 |
h[3] = (unsigned char)(len >> 16); |
25 |
- pwrite(c,(char*)h,4); |
26 |
- pwrite(c,str,len); |
27 |
+ _pwrite(c,(char*)h,4); |
28 |
+ _pwrite(c,str,len); |
29 |
} |
30 |
|
31 |
static void psend( mcontext *c, proto_code code, const char *str ) { |
32 |
@@ -329,7 +329,7 @@ |
33 |
int buflen = BUFSIZE; |
34 |
*exc = 0; |
35 |
while( true ) { |
36 |
- if( !pread(c,header,4) ) |
37 |
+ if( !_pread(c,header,4) ) |
38 |
ABORT("Connection Closed"); |
39 |
len = header[1] | (header[2] << 8) | (header[3] << 16); |
40 |
if( buflen <= len ) { |
41 |
@@ -338,7 +338,7 @@ |
42 |
free(buf); |
43 |
buf = (char*)malloc(buflen); |
44 |
} |
45 |
- if( !pread(c,buf,len) ) |
46 |
+ if( !_pread(c,buf,len) ) |
47 |
ABORT("Connection Closed"); |
48 |
buf[len] = 0; |
49 |
switch( *header ) { |