Showing
3 changed files
with
25 additions
and
7 deletions
@@ -16,5 +16,12 @@ coverage-html: | @@ -16,5 +16,12 @@ coverage-html: | ||
16 | -$(MAKE) -C tests $(AM_MAKEFLAGS) -k $@ | 16 | -$(MAKE) -C tests $(AM_MAKEFLAGS) -k $@ |
17 | endif | 17 | endif |
18 | 18 | ||
19 | +REGEX_CCLASS=/^[ \t]*\(TR_CLASS\|TR_INTERFACE\)\(([a-zA-Z0-9_]+)/\2/d,definition/ | ||
19 | tags: | 20 | tags: |
20 | - ctags -R -V --langdef=cclass --langmap=cclass:.h --regex-cclass='/^[ \t]*\(TR_CLASS\|TR_INTERFACE\)\(([a-zA-Z0-9_]+)/\2/d,definition/' | 21 | + @ctags -R -V --langdef=cclass --langmap=cclass:.h \ |
22 | + --regex-cclass='$(REGEX_CCLASS)' | ||
23 | + | ||
24 | +loc: | ||
25 | + @find src/ include/ -not -path testers -and -name "*.[ch]" \ | ||
26 | + -exec sed '/\/\*/,/\*\//d;/\/\//d' {} \; | wc -l | ||
27 | + |
@@ -81,7 +81,11 @@ protocolRawParse(void * _this, TR_ProtoMessage _message, TR_RemoteData _data) | @@ -81,7 +81,11 @@ protocolRawParse(void * _this, TR_ProtoMessage _message, TR_RemoteData _data) | ||
81 | } | 81 | } |
82 | 82 | ||
83 | if (size >= message->size - message->size_done) { | 83 | if (size >= message->size - message->size_done) { |
84 | - memcpy(message->data, data, message->size - message->size_done); | 84 | + memcpy( |
85 | + message->data + message->size_done, | ||
86 | + data, | ||
87 | + message->size - message->size_done); | ||
88 | + | ||
85 | size -= message->size - message->size_done; | 89 | size -= message->size - message->size_done; |
86 | data += message->size - message->size_done; | 90 | data += message->size - message->size_done; |
87 | message->size_done = message->size; | 91 | message->size_done = message->size; |
@@ -91,8 +95,8 @@ protocolRawParse(void * _this, TR_ProtoMessage _message, TR_RemoteData _data) | @@ -91,8 +95,8 @@ protocolRawParse(void * _this, TR_ProtoMessage _message, TR_RemoteData _data) | ||
91 | retval = TR_new(TR_RemoteData, data, size, _data->remote); | 95 | retval = TR_new(TR_RemoteData, data, size, _data->remote); |
92 | } | 96 | } |
93 | } else { | 97 | } else { |
94 | - memcpy(message->data, data, size); | ||
95 | - message->size_done = size; | 98 | + memcpy(message->data + message->size_done, data, size); |
99 | + message->size_done += size; | ||
96 | } | 100 | } |
97 | 101 | ||
98 | TR_delete(_data); | 102 | TR_delete(_data); |
@@ -32,7 +32,7 @@ main (int argc, char * argv[]) | @@ -32,7 +32,7 @@ main (int argc, char * argv[]) | ||
32 | 32 | ||
33 | client = TR_new(TR_SimpleClient, connection); | 33 | client = TR_new(TR_SimpleClient, connection); |
34 | 34 | ||
35 | - for (i=0; i<100000; i++) { | 35 | + for (i=0; i<10000000; i++) { |
36 | message = (TR_ProtoMessageRaw)TR_protoCreateRequest( | 36 | message = (TR_ProtoMessageRaw)TR_protoCreateRequest( |
37 | protocol, (TR_Socket)socket); | 37 | protocol, (TR_Socket)socket); |
38 | message->size = sizeof("test"); | 38 | message->size = sizeof("test"); |
@@ -42,13 +42,20 @@ main (int argc, char * argv[]) | @@ -42,13 +42,20 @@ main (int argc, char * argv[]) | ||
42 | message = (TR_ProtoMessageRaw)TR_simpleClientIssue( | 42 | message = (TR_ProtoMessageRaw)TR_simpleClientIssue( |
43 | client, | 43 | client, |
44 | (TR_ProtoMessage)message, | 44 | (TR_ProtoMessage)message, |
45 | - 10000000); | 45 | + 100); |
46 | 46 | ||
47 | + if (! message) break; | ||
47 | #if 0 | 48 | #if 0 |
48 | printf("%s\n", message->data); | 49 | printf("%s\n", message->data); |
49 | #else | 50 | #else |
50 | if (0 == strncmp("test", message->data, sizeof("test")-1)) { | 51 | if (0 == strncmp("test", message->data, sizeof("test")-1)) { |
51 | - if (i % 1000 == 0) printf("%c", '.'); | 52 | + if (i % 1000 == 0) { |
53 | + if (i % 10000 == 0) { | ||
54 | + printf("%c", '#'); | ||
55 | + } else { | ||
56 | + printf("%c", '.'); | ||
57 | + } | ||
58 | + } | ||
52 | } else { | 59 | } else { |
53 | printf("%c", 'f'); | 60 | printf("%c", 'f'); |
54 | } | 61 | } |
Please
register
or
login
to post a comment